Public Member Functions | Protected Attributes | List of all members

Implements the scalar quotient operator within the symbolic operators family. More...

#include <quotient.hpp>

Inheritance diagram for Quotient:
Inheritance graph
[legend]

Public Member Functions

virtual returnValue AD_backward (int dim, VariableType *varType, int *component, Operator *seed, Operator **df, int &nNewIS, TreeProjection ***newIS)
 
virtual returnValue AD_backward (int number, double seed, double *df)
 
virtual returnValue AD_backward2 (int number, double seed1, double seed2, double *df, double *ddf)
 
virtual OperatorAD_forward (int dim, VariableType *varType, int *component, Operator **seed, int &nNewIS, TreeProjection ***newIS)
 
virtual returnValue AD_forward (int number, double *seed, double *df)
 
virtual returnValue AD_forward (int number, double *x, double *seed, double *f, double *df)
 
virtual returnValue AD_forward2 (int number, double *seed1, double *seed2, double *df, double *ddf)
 
virtual returnValue AD_symmetric (int dim, VariableType *varType, int *component, Operator *l, Operator **S, int dimS, Operator **dfS, Operator **ldf, Operator **H, int &nNewLIS, TreeProjection ***newLIS, int &nNewSIS, TreeProjection ***newSIS, int &nNewHIS, TreeProjection ***newHIS)
 
virtual Operatorclone () const
 
virtual Operatordifferentiate (int index)
 
virtual returnValue evaluate (int number, double *x, double *result)
 
virtual returnValue evaluate (EvaluationBase *x)
 
virtual CurvatureType getCurvature ()
 
virtual MonotonicityType getMonotonicity ()
 
virtual OperatorName getName ()
 
virtual double getValue () const
 
virtual returnValue initDerivative ()
 
virtual BooleanType isLinearIn (int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
 
virtual BooleanType isPolynomialIn (int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
 
virtual BooleanType isRationalIn (int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
 
Quotientoperator= (const Quotient &arg)
 
virtual std::ostream & print (std::ostream &stream) const
 
 Quotient ()
 
 Quotient (Operator *_argument1, Operator *_argument2)
 
 Quotient (const Quotient &arg)
 
virtual Operatorsubstitute (int index, const Operator *sub)
 
 ~Quotient ()
 
- Public Member Functions inherited from BinaryOperator
 BinaryOperator ()
 
 BinaryOperator (Operator *_argument1, Operator *_argument2)
 
 BinaryOperator (const BinaryOperator &arg)
 
virtual returnValue clearBuffer ()
 
virtual returnValue enumerateVariables (SymbolicIndexList *indexList)
 
virtual BooleanType isDependingOn (VariableType var) const
 
virtual BooleanType isDependingOn (int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
 
virtual NeutralElement isOneOrZero () const
 
virtual BooleanType isSymbolic () const
 
virtual BooleanType isVariable (VariableType &varType, int &component) const
 
virtual returnValue loadIndices (SymbolicIndexList *indexList)
 
BinaryOperatoroperator= (const BinaryOperator &arg)
 
virtual returnValue setCurvature (CurvatureType curvature_)
 
virtual returnValue setMonotonicity (MonotonicityType monotonicity_)
 
virtual returnValue setVariableExportName (const VariableType &_type, const std::vector< std::string > &_name)
 
virtual ~BinaryOperator ()
 
- Public Member Functions inherited from SmoothOperator
virtual TreeProjectioncloneTreeProjection () const
 
virtual int getGlobalIndex () const
 
virtual BooleanType isSmooth () const
 
Expression operator* (const double &arg) const
 
Expression operator* (const DVector &arg) const
 
Expression operator* (const DMatrix &arg) const
 
Expression operator* (const Operator &arg) const
 
Expression operator* (const Expression &arg) const
 
Operatoroperator*= (const double &arg)
 
Operatoroperator*= (const DVector &arg)
 
Operatoroperator*= (const DMatrix &arg)
 
Operatoroperator*= (const Expression &arg)
 
Expression operator+ (const double &arg) const
 
Expression operator+ (const DVector &arg) const
 
Expression operator+ (const DMatrix &arg) const
 
Expression operator+ (const Operator &arg) const
 
Expression operator+ (const Expression &arg) const
 
Operatoroperator+= (const double &arg)
 
Operatoroperator+= (const DVector &arg)
 
Operatoroperator+= (const DMatrix &arg)
 
Operatoroperator+= (const Expression &arg)
 
Expression operator- (const double &arg) const
 
Expression operator- (const DVector &arg) const
 
Expression operator- (const DMatrix &arg) const
 
Expression operator- (const Operator &arg) const
 
Expression operator- (const Expression &arg) const
 
Expression operator- () const
 
Operatoroperator-= (const double &arg)
 
Operatoroperator-= (const DVector &arg)
 
Operatoroperator-= (const DMatrix &arg)
 
Operatoroperator-= (const Expression &arg)
 
Expression operator/ (const double &arg) const
 
Expression operator/ (const Operator &arg) const
 
Expression operator/ (const Expression &arg) const
 
Operatoroperator/= (const double &arg)
 
Operatoroperator/= (const Expression &arg)
 
ConstraintComponent operator<= (const double &ub) const
 
ConstraintComponent operator<= (const DVector &ub) const
 
ConstraintComponent operator<= (const VariablesGrid &ub) const
 
virtual Operatoroperator= (const double &arg)
 
virtual Operatoroperator= (const DVector &arg)
 
virtual Operatoroperator= (const DMatrix &arg)
 
virtual Operatoroperator= (const Expression &arg)
 
virtual Operatoroperator= (const Operator &arg)
 
ConstraintComponent operator== (const double &b) const
 
ConstraintComponent operator== (const DVector &b) const
 
ConstraintComponent operator== (const VariablesGrid &b) const
 
ConstraintComponent operator>= (const double &lb) const
 
ConstraintComponent operator>= (const DVector &lb) const
 
ConstraintComponent operator>= (const VariablesGrid &lb) const
 
virtual OperatorpassArgument () const
 
 SmoothOperator ()
 
virtual ~SmoothOperator ()
 
- Public Member Functions inherited from Operator
virtual BooleanType isTrivial () const
 
virtual OperatormyAdd (Operator *a, Operator *b)
 
virtual OperatormyLogarithm (Operator *a)
 
virtual OperatormyPower (Operator *a, Operator *b)
 
virtual OperatormyPowerInt (Operator *a, int b)
 
virtual OperatormyProd (Operator *a, Operator *b)
 
virtual OperatormySubtract (Operator *a, Operator *b)
 
 Operator ()
 
Expression operator* (const double &arg) const
 
Expression operator* (const DVector &arg) const
 
Expression operator* (const DMatrix &arg) const
 
Expression operator* (const Operator &arg) const
 
Expression operator* (const Expression &arg) const
 
Operatoroperator*= (const double &arg)
 
Operatoroperator*= (const DVector &arg)
 
Operatoroperator*= (const DMatrix &arg)
 
Operatoroperator*= (const Expression &arg)
 
Expression operator+ (const double &arg) const
 
Expression operator+ (const DVector &arg) const
 
Expression operator+ (const DMatrix &arg) const
 
Expression operator+ (const Operator &arg) const
 
Expression operator+ (const Expression &arg) const
 
Operatoroperator+= (const double &arg)
 
Operatoroperator+= (const DVector &arg)
 
Operatoroperator+= (const DMatrix &arg)
 
Operatoroperator+= (const Expression &arg)
 
Expression operator- (const double &arg) const
 
Expression operator- (const DVector &arg) const
 
Expression operator- (const DMatrix &arg) const
 
Expression operator- (const Operator &arg) const
 
Expression operator- (const Expression &arg) const
 
Expression operator- () const
 
Operatoroperator-= (const double &arg)
 
Operatoroperator-= (const DVector &arg)
 
Operatoroperator-= (const DMatrix &arg)
 
Operatoroperator-= (const Expression &arg)
 
Expression operator/ (const double &arg) const
 
Expression operator/ (const Operator &arg) const
 
Expression operator/ (const Expression &arg) const
 
Operatoroperator/= (const double &arg)
 
Operatoroperator/= (const Expression &arg)
 
ConstraintComponent operator<= (const double &ub) const
 
ConstraintComponent operator<= (const DVector &ub) const
 
ConstraintComponent operator<= (const VariablesGrid &ub) const
 
ConstraintComponent operator== (const double &b) const
 
ConstraintComponent operator== (const DVector &b) const
 
ConstraintComponent operator== (const VariablesGrid &b) const
 
ConstraintComponent operator>= (const double &lb) const
 
ConstraintComponent operator>= (const DVector &lb) const
 
ConstraintComponent operator>= (const VariablesGrid &lb) const
 
virtual ~Operator ()
 

Protected Attributes

TreeProjectionderivative0
 
TreeProjectionderivative1
 
TreeProjectionderivative2
 
- Protected Attributes inherited from BinaryOperator
Operatorargument1
 
double * argument1_result
 
Operatorargument2
 
double * argument2_result
 
int bufferSize
 
CurvatureType curvature
 
Operatordargument1
 
double * dargument1_result
 
Operatordargument2
 
double * dargument2_result
 
MonotonicityType monotonicity
 
- Protected Attributes inherited from Operator
BooleanType initialized
 

Additional Inherited Members

- Public Attributes inherited from SmoothOperator
int nCount
 
- Public Attributes inherited from Operator
int nCount
 
- Protected Member Functions inherited from BinaryOperator
void copy (const BinaryOperator &arg)
 
void deleteAll ()
 
- Protected Member Functions inherited from Operator
returnValue ADsymCommon (Operator *a, TreeProjection &da, TreeProjection &dda, int dim, VariableType *varType, int *component, Operator *l, Operator **S, int dimS, Operator **dfS, Operator **ldf, Operator **H, int &nNewLIS, TreeProjection ***newLIS, int &nNewSIS, TreeProjection ***newSIS, int &nNewHIS, TreeProjection ***newHIS)
 
returnValue ADsymCommon2 (Operator *a, Operator *b, TreeProjection &dx, TreeProjection &dy, TreeProjection &dxx, TreeProjection &dxy, TreeProjection &dyy, int dim, VariableType *varType, int *component, Operator *l, Operator **S, int dimS, Operator **dfS, Operator **ldf, Operator **H, int &nNewLIS, TreeProjection ***newLIS, int &nNewSIS, TreeProjection ***newSIS, int &nNewHIS, TreeProjection ***newHIS)
 
virtual TreeProjectionconvert2TreeProjection (Operator *a) const
 

Detailed Description

Implements the scalar quotient operator within the symbolic operators family.

The class Quotient implements the scalar quotient operator within the symbolic operators family.

Author
Boris Houska, Hans Joachim Ferreau

Definition at line 55 of file quotient.hpp.

Constructor & Destructor Documentation

BEGIN_NAMESPACE_ACADO Quotient::Quotient ( )

Default constructor.

Definition at line 45 of file quotient.cpp.

Quotient::Quotient ( Operator _argument1,
Operator _argument2 
)

Default constructor.

Definition at line 51 of file quotient.cpp.

Quotient::Quotient ( const Quotient arg)

Copy constructor (deep copy).

Definition at line 60 of file quotient.cpp.

Quotient::~Quotient ( )

Default destructor.

Definition at line 73 of file quotient.cpp.

Member Function Documentation

returnValue Quotient::AD_backward ( int  dim,
VariableType varType,
int *  component,
Operator seed,
Operator **  df,
int &  nNewIS,
TreeProjection ***  newIS 
)
virtual

Automatic Differentiation in backward mode on the symbolic
level. This function generates an expression for a
backward derivative

Returns
SUCCESSFUL_RETURN
Parameters
dimnumber of directions
varTypethe variable types
componentand their components
seedthe backward seed
dfthe result
nNewISthe number of new IS
newISthe new IS-pointer

Implements BinaryOperator.

Definition at line 175 of file quotient.cpp.

returnValue Quotient::AD_backward ( int  number,
double  seed,
double *  df 
)
virtual

Automatic Differentiation in backward mode based on
buffered values

Returns
SUCCESFUL_RETURN
RET_NAN
Parameters
numberthe buffer position
seedthe seed
dfthe derivative of the expression

Implements BinaryOperator.

Definition at line 416 of file quotient.cpp.

returnValue Quotient::AD_backward2 ( int  number,
double  seed1,
double  seed2,
double *  df,
double *  ddf 
)
virtual

Automatic Differentiation in backward mode for 2nd order
derivatives based on buffered values.

Returns
SUCCESFUL_RETURN
RET_NAN
Parameters
numberthe buffer position
seed1the seed1
seed2the seed2
dfthe 1st derivative of the expression
ddfthe 2nd derivative of the expression

Implements BinaryOperator.

Definition at line 456 of file quotient.cpp.

Operator * Quotient::AD_forward ( int  dim,
VariableType varType,
int *  component,
Operator **  seed,
int &  nNewIS,
TreeProjection ***  newIS 
)
virtual

Automatic Differentiation in forward mode on the symbolic
level. This function generates an expression for a
forward derivative

Returns
SUCCESSFUL_RETURN
Parameters
dimdimension of the seed
varTypethe variable types
componentand their components
seedthe forward seed
nNewISthe number of new IS
newISthe new IS-pointer

Implements BinaryOperator.

Definition at line 146 of file quotient.cpp.

returnValue Quotient::AD_forward ( int  number,
double *  seed,
double *  df 
)
virtual

Automatic Differentiation in forward mode.
This function uses the intermediate
results from a buffer

Returns
SUCCESFUL_RETURN
RET_NAN
Parameters
numberstorage position
seedthe seed
dfthe derivative of the expression

Implements BinaryOperator.

Definition at line 403 of file quotient.cpp.

returnValue Quotient::AD_forward ( int  number,
double *  x,
double *  seed,
double *  f,
double *  df 
)
virtual

Automatic Differentiation in forward mode.
This function stores the intermediate
results in a buffer (needed for 2nd order automatic
differentiation in backward mode)

Returns
SUCCESFUL_RETURN
RET_NAN
Parameters
numberstorage position
xThe evaluation point x
seedthe seed
fthe value of the expression at x
dfthe derivative of the expression

Implements BinaryOperator.

Definition at line 377 of file quotient.cpp.

returnValue Quotient::AD_forward2 ( int  number,
double *  seed1,
double *  seed2,
double *  df,
double *  ddf 
)
virtual

Automatic Differentiation in forward mode for
2nd derivatives.
This function uses intermediate
results from a buffer.

Returns
SUCCESFUL_RETURN
RET_NAN
Parameters
numberthe buffer position
seed1the seed
seed2the seed for the first derivative
dfthe derivative of the expression
ddfthe 2nd derivative of the expression

Implements BinaryOperator.

Definition at line 426 of file quotient.cpp.

returnValue Quotient::AD_symmetric ( int  dim,
VariableType varType,
int *  component,
Operator l,
Operator **  S,
int  dimS,
Operator **  dfS,
Operator **  ldf,
Operator **  H,
int &  nNewLIS,
TreeProjection ***  newLIS,
int &  nNewSIS,
TreeProjection ***  newSIS,
int &  nNewHIS,
TreeProjection ***  newHIS 
)
virtual

Automatic Differentiation in symmetric mode on the symbolic
level. This function generates an expression for a
second order derivative.

Returns
SUCCESSFUL_RETURN
Parameters
dimnumber of directions
varTypethe variable types
componentand their components
lthe backward seed
Sforward seed matrix
dimSdimension of forward seed
dfSfirst order foward result
ldffirst order backward result
Hupper trianglular part of the Hessian
nNewLISthe number of newLIS
newLISthe new LIS-pointer
nNewSISthe number of newSIS
newSISthe new SIS-pointer
nNewHISthe number of newHIS
newHISthe new HIS-pointer

Implements BinaryOperator.

Definition at line 211 of file quotient.cpp.

Operator * Quotient::clone ( ) const
virtual

Provides a deep copy of the expression.

Returns
a clone of the expression.

Implements BinaryOperator.

Definition at line 483 of file quotient.cpp.

Operator * Quotient::differentiate ( int  index)
virtual

Returns the derivative of the expression with respect
to the variable var(index).

Returns
The expression for the derivative.
Parameters
indexdiff. index

Implements BinaryOperator.

Definition at line 126 of file quotient.cpp.

returnValue Quotient::evaluate ( int  number,
double *  x,
double *  result 
)
virtual

Evaluates the expression and stores the intermediate
results in a buffer (needed for automatic differentiation
in backward mode)

Returns
SUCCESFUL_RETURN
RET_NAN
Parameters
numberstorage position
xthe input variable x
resultthe result

Implements BinaryOperator.

Definition at line 100 of file quotient.cpp.

returnValue Quotient::evaluate ( EvaluationBase x)
virtual

Evaluates the expression (templated version)

Implements BinaryOperator.

Definition at line 119 of file quotient.cpp.

CurvatureType Quotient::getCurvature ( )
virtual

Returns the curvature of the expression

Returns
CT_CONSTANT
CT_AFFINE
CT_CONVEX
CT_CONCAVE

Implements BinaryOperator.

Definition at line 333 of file quotient.cpp.

MonotonicityType Quotient::getMonotonicity ( )
virtual

Returns the monotonicity of the expression.

Returns
MT_NONDECREASING
MT_NONINCREASING
MT_NONMONOTONIC

Implements BinaryOperator.

Definition at line 305 of file quotient.cpp.

OperatorName Quotient::getName ( )
virtual

Asks the expression for its name.

Returns
the name of the expression.

Implements BinaryOperator.

Definition at line 489 of file quotient.cpp.

double Quotient::getValue ( ) const
virtual

Return the value of the constant

Reimplemented from SmoothOperator.

Definition at line 362 of file quotient.cpp.

returnValue Quotient::initDerivative ( )
virtual

Reimplemented from BinaryOperator.

Definition at line 241 of file quotient.cpp.

BooleanType Quotient::isLinearIn ( int  dim,
VariableType varType,
int *  component,
BooleanType implicit_dep 
)
virtual

Checks whether the expression is linear in
(or not depending on) a variable

Returns
BT_FALSE if no linearity is
detected
BT_TRUE otherwise
Parameters
dimnumber of directions
varTypethe variable types
componentand their components
implicit_depimplicit dependencies

Implements BinaryOperator.

Definition at line 263 of file quotient.cpp.

BooleanType Quotient::isPolynomialIn ( int  dim,
VariableType varType,
int *  component,
BooleanType implicit_dep 
)
virtual

Checks whether the expression is polynomial in
the specified variables

Returns
BT_FALSE if the expression is not polynomial
BT_TRUE otherwise
Parameters
dimnumber of directions
varTypethe variable types
componentand their components
implicit_depimplicit dependencies

Implements BinaryOperator.

Definition at line 277 of file quotient.cpp.

BooleanType Quotient::isRationalIn ( int  dim,
VariableType varType,
int *  component,
BooleanType implicit_dep 
)
virtual

Checks whether the expression is rational in
the specified variables

Returns
BT_FALSE if the expression is not rational
BT_TRUE otherwise
Parameters
dimnumber of directions
varTypethe variable types
componentand their components
implicit_depimplicit dependencies

Implements BinaryOperator.

Definition at line 291 of file quotient.cpp.

Quotient & Quotient::operator= ( const Quotient arg)

Assignment Operator (deep copy).

Definition at line 89 of file quotient.cpp.

std::ostream & Quotient::print ( std::ostream &  stream) const
virtual

Prints the expression into a stream.

Returns
SUCCESFUL_RETURN

Implements BinaryOperator.

Definition at line 477 of file quotient.cpp.

Operator * Quotient::substitute ( int  index,
const Operator sub 
)
virtual

Substitutes var(index) with the expression sub.

Returns
The substituted expression.
Parameters
indexsubst. index
subthe substitution

Implements BinaryOperator.

Definition at line 255 of file quotient.cpp.

Member Data Documentation

TreeProjection* Quotient::derivative0
protected

An auxiliary variable to define the quotient.

Definition at line 341 of file quotient.hpp.

TreeProjection* Quotient::derivative1
protected

An auxiliary variable to define the first order derivative of the quotient.

Definition at line 342 of file quotient.hpp.

TreeProjection* Quotient::derivative2
protected

An auxiliary variable to define the second order derivative of the quotient.

Definition at line 343 of file quotient.hpp.


The documentation for this class was generated from the following files:


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:26