Public Member Functions | Protected Member Functions | Protected Attributes | Friends

Base class for all variables within the symbolic expressions family. More...

#include <expression.hpp>

Inheritance diagram for Expression:
Inheritance graph
[legend]

List of all members.

Public Member Functions

Expression ADbackward (const Expression &arg) const
Expression ADbackward (const Expression &arg, const Expression &seed) const
Expression ADforward (const Expression &arg) const
Expression ADforward (const VariableType &varType_, const int *arg, int nV) const
Expression ADforward (const Expression &arg, const Expression &seed) const
Expression ADforward (const VariableType &varType_, const int *arg, const Expression &seed) const
Expression ADforward (const VariableType *varType_, const int *arg, const Expression &seed) const
Expression ADsymmetric (const Expression &arg, const Expression &S, const Expression &l, Expression *dfS=0, Expression *ldf=0) const
Expression ADsymmetric (const Expression &arg, const Expression &l, Expression *dfS=0, Expression *ldf=0) const
ExpressionappendCols (const Expression &arg)
ExpressionappendRows (const Expression &arg)
virtual Expressionclone () const
 Expression ()
 Expression (const Operator &tree_)
 Expression (const std::string &name_)
 Expression (const std::string &name_, uint nRows_, uint nCols_, VariableType variableType_=VT_UNKNOWN, uint globalTypeID=0)
 Expression (int nRows_, int nCols_=1, VariableType variableType_=VT_UNKNOWN, int globalTypeID=0)
 Expression (uint nRows_, uint nCols_=1, VariableType variableType_=VT_UNKNOWN, uint globalTypeID=0)
 Expression (const double &rhs)
 Expression (const DVector &rhs)
 Expression (const DMatrix &rhs)
 Expression (const Expression &rhs)
Expression getAcos () const
Expression getAsin () const
Expression getAtan () const
Expression getCol (const uint &colIdx) const
Expression getCols (const uint &colIdx1, const uint &colIdx2) const
uint getComponent (const unsigned int idx) const
Expression getCos () const
DMatrix getDependencyPattern (const Expression &arg) const
uint getDim () const
Expression getDot () const
Expression getEntropy () const
Expression getEuclideanNorm () const
Expression getExp () const
Expression getInverse () const
Expression getLn () const
Expression getLogSumExp () const
Expression getNext () const
uint getNumCols () const
uint getNumRows () const
Expression getODEexpansion (const int &order, const int *arg) const
OperatorgetOperatorClone (uint idx) const
Expression getPow (const Expression &arg) const
Expression getPowInt (const int &arg) const
Expression getRow (const uint &rowIdx) const
Expression getRows (const uint &rowIdx1, const uint &rowIdx2) const
Expression getSin () const
DMatrix getSparsityPattern () const
Expression getSqrt () const
Expression getSubMatrix (const uint &rowIdx1, const uint &rowIdx2, const uint &colIdx1, const uint &colIdx2) const
Expression getSumSquare () const
Expression getTan () const
VariableType getVariableType () const
BooleanType isDependingOn (VariableType type) const
BooleanType isDependingOn (const Expression &e) const
BooleanType isVariable () const
Expression operator() (uint idx) const
Expression operator() (uint rowIdx, uint colIdx) const
Operatoroperator() (uint idx)
Operatoroperator() (uint rowIdx, uint colIdx)
Expressionoperator*= (const Expression &arg)
Expressionoperator+= (const Expression &arg)
Expression operator- () const
Expressionoperator-= (const Expression &arg)
Expressionoperator/= (const Expression &arg)
Expressionoperator<< (const Expression &arg)
Expressionoperator= (const Expression &arg)
std::ostream & print (std::ostream &stream) const
returnValue substitute (int idx, const Expression &arg) const
Expression transpose () const
virtual ~Expression ()

Protected Member Functions

Expression add (const Expression &arg) const
ExpressionassignmentSetup (const Expression &arg)
void construct (VariableType variableType_, uint globalTypeID_, uint nRows_, uint nCols_, const std::string &name_)
void copy (const Expression &rhs)
void deleteAll ()
Expression div (const Expression &arg) const
Expression mul (const Expression &arg) const
Operatorproduct (const Operator *a, const Operator *b) const
Expression sub (const Expression &arg) const

Protected Attributes

uint component
uint dim
Operator ** element
std::string name
uint nCols
uint nRows
VariableType variableType

Friends

class CFunction
class COperator
class FunctionEvaluationTree
Expression operator* (const Expression &arg1, const Expression &arg2)
Expression operator+ (const Expression &arg1, const Expression &arg2)
Expression operator- (const Expression &arg1, const Expression &arg2)
Expression operator/ (const Expression &arg1, const Expression &arg2)
std::ostream & operator<< (std::ostream &stream, const Expression &arg)

Detailed Description

Base class for all variables within the symbolic expressions family.

The class Expression serves as a base class for all symbolic variables within the symbolic expressions family. Moreover, the Expression class defines all kind of matrix and vector operations on a symbolic level.

Author:
Boris Houska, Hans Joachim Ferreau, Milan Vukov

Definition at line 56 of file expression.hpp.


Constructor & Destructor Documentation

Default constructor.

Definition at line 47 of file expression.cpp.

Expression::Expression ( const Operator tree_)

Casting constructor.

Definition at line 72 of file expression.cpp.

Expression::Expression ( const std::string &  name_) [explicit]

Casting constructor.

Definition at line 57 of file expression.cpp.

Expression::Expression ( const std::string &  name_,
uint  nRows_,
uint  nCols_,
VariableType  variableType_ = VT_UNKNOWN,
uint  globalTypeID = 0 
) [explicit]

Constructor which takes the arguments.

Parameters:
name_the name
nRows_number of rows
nCols_number of columns
variableType_the variable type
globalTypeIDthe global type ID

Definition at line 52 of file expression.cpp.

Expression::Expression ( int  nRows_,
int  nCols_ = 1,
VariableType  variableType_ = VT_UNKNOWN,
int  globalTypeID = 0 
) [explicit]

Constructor which takes the arguments.

Parameters:
nRows_number of rows
nCols_number of columns
variableType_the variable type
globalTypeIDthe global type ID

Definition at line 67 of file expression.cpp.

Expression::Expression ( uint  nRows_,
uint  nCols_ = 1,
VariableType  variableType_ = VT_UNKNOWN,
uint  globalTypeID = 0 
) [explicit]

Constructor which takes the arguments.

Parameters:
nRows_number of rows
nCols_number of columns
variableType_the variable type
globalTypeIDthe global type ID

Definition at line 62 of file expression.cpp.

Expression::Expression ( const double &  rhs)

Copy constructor (deep copy).

Definition at line 90 of file expression.cpp.

Expression::Expression ( const DVector rhs)

Definition at line 97 of file expression.cpp.

Expression::Expression ( const DMatrix rhs)

Definition at line 107 of file expression.cpp.

Definition at line 121 of file expression.cpp.

Expression::~Expression ( ) [virtual]

Destructor.

Definition at line 126 of file expression.cpp.


Member Function Documentation

Definition at line 1032 of file expression.cpp.

Expression Expression::ADbackward ( const Expression arg,
const Expression seed 
) const

Definition at line 1206 of file expression.cpp.

Expression Expression::add ( const Expression arg) const [protected]

Definition at line 319 of file expression.cpp.

Definition at line 971 of file expression.cpp.

Expression Expression::ADforward ( const VariableType varType_,
const int *  arg,
int  nV 
) const

Definition at line 1002 of file expression.cpp.

Expression Expression::ADforward ( const Expression arg,
const Expression seed 
) const

Definition at line 1063 of file expression.cpp.

Expression Expression::ADforward ( const VariableType varType_,
const int *  arg,
const Expression seed 
) const

Definition at line 1086 of file expression.cpp.

Expression Expression::ADforward ( const VariableType varType_,
const int *  arg,
const Expression seed 
) const

Definition at line 1098 of file expression.cpp.

Expression Expression::ADsymmetric ( const Expression arg,
const Expression S,
const Expression l,
Expression dfS = 0,
Expression ldf = 0 
) const

Second order symmetric AD routine returning
S^T*(l^T*f'')*S with f'' being the second
order derivative of the current expression.
The matrix S and the vector l can be
interpreted as forward/backward seeds,
respectively. Optionally, this routine also
returns expressions for the first order
order terms f'*S and l^T*f' computed by
first order forward and first order backward
automatic differentiation, respectively.
Caution: this routine is tailored for
full Hessian computation exploiting symmetry.
If only single elements of the Hessian are
needed, forward-over-adjoint or ajoint-over-
forward differentiation may be more
efficient.

Parameters:
Sargument
lforward seed
dfSbackward seed
ldffirst order forward result first order backward result

Definition at line 1260 of file expression.cpp.

Expression Expression::ADsymmetric ( const Expression arg,
const Expression l,
Expression dfS = 0,
Expression ldf = 0 
) const

Second order symmetric AD routine returning
l^T*f'' with f'' being the second
order derivative of the current expression.
The he vector l can be
interpreted as backward seed,
respectively. Optionally, this routine also
returns expressions for the first order
order terms f'*S and l^T*f' computed by
first order forward and first order backward
automatic differentiation, respectively.
Caution: this routine is tailored for
full Hessian computation exploiting symmetry.
If only single elements of the Hessian are
needed, forward-over-adjoint or ajoint-over-
forward differentiation may be more
efficient.

Parameters:
largument
dfSbackward seed
ldffirst order forward result first order backward result

Definition at line 1303 of file expression.cpp.

Appends an Expression matrix (n x m) with an argument matrix (n x s) in the column direction, such that the result is ( n x (m + s) ).

As a special case, when applied on an empty Expression, the Expression will be assigned the argument.

Definition at line 162 of file expression.cpp.

Appends an Expression matrix (n x m) with an argument matrix (s x m) in the row direction, such that the result is ( (n + s) x m).

As a special case, when applied on an empty Expression, the Expression will be assigned the argument.

Definition at line 141 of file expression.cpp.

Expression & Expression::assignmentSetup ( const Expression arg) [protected]

Generic copy routine (protected, only for internal use).

Definition at line 1518 of file expression.cpp.

virtual Expression* Expression::clone ( ) const [inline, virtual]
void Expression::construct ( VariableType  variableType_,
uint  globalTypeID_,
uint  nRows_,
uint  nCols_,
const std::string &  name_ 
) [protected]

Generic constructor (protected, only for internal use).

Parameters:
variableType_The variable type.
globalTypeID_the global type ID
nRows_The number of rows.
nCols_The number of columns.
name_The name

Definition at line 1471 of file expression.cpp.

void Expression::copy ( const Expression rhs) [protected]

Generic copy routine (protected, only for internal use).

Definition at line 1496 of file expression.cpp.

void Expression::deleteAll ( ) [protected]

Generic destructor (protected, only for internal use).

Definition at line 1555 of file expression.cpp.

Expression Expression::div ( const Expression arg) const [protected]

Definition at line 474 of file expression.cpp.

Definition at line 721 of file expression.cpp.

Definition at line 709 of file expression.cpp.

Definition at line 733 of file expression.cpp.

Expression Expression::getCol ( const uint colIdx) const

Definition at line 567 of file expression.cpp.

Expression Expression::getCols ( const uint colIdx1,
const uint colIdx2 
) const

Definition at line 582 of file expression.cpp.

uint Expression::getComponent ( const unsigned int  idx) const [inline]

Returns the global type idea of the idx-component.

Returns:
The global type ID.

Definition at line 685 of file expression.cpp.

When operated on an n x 1 Expression, returns an m x n DMatrix. The element (i,j) of this matrix is zero when this(i) does not depend on arg(j)

Parameters:
argm x 1 Expression

Definition at line 623 of file expression.cpp.

uint Expression::getDim ( ) const [inline]

Returns dimension of vector space.

Returns:
Dimension of vector space.

Definition at line 952 of file expression.cpp.

Definition at line 945 of file expression.cpp.

Definition at line 912 of file expression.cpp.

Definition at line 745 of file expression.cpp.

Returns the symbolic inverse of a matrix (only for square matrices)

Definition at line 490 of file expression.cpp.

Definition at line 769 of file expression.cpp.

Definition at line 860 of file expression.cpp.

Definition at line 965 of file expression.cpp.

uint Expression::getNumCols ( ) const [inline]

Returns the number of columns.

Returns:
The number of columns.
uint Expression::getNumRows ( ) const [inline]

Returns the number of rows.

Returns:
The number of rows.
Expression Expression::getODEexpansion ( const int &  order,
const int *  arg 
) const

Definition at line 1149 of file expression.cpp.

Returns a clone of the operator with index idx.

Returns:
A clone of the requested operator.

Definition at line 1590 of file expression.cpp.

Expression Expression::getPow ( const Expression arg) const

Definition at line 782 of file expression.cpp.

Expression Expression::getPowInt ( const int &  arg) const

Definition at line 797 of file expression.cpp.

Expression Expression::getRow ( const uint rowIdx) const

Definition at line 533 of file expression.cpp.

Expression Expression::getRows ( const uint rowIdx1,
const uint rowIdx2 
) const

Definition at line 548 of file expression.cpp.

Definition at line 673 of file expression.cpp.

Definition at line 656 of file expression.cpp.

Definition at line 757 of file expression.cpp.

Expression Expression::getSubMatrix ( const uint rowIdx1,
const uint rowIdx2,
const uint colIdx1,
const uint colIdx2 
) const

Definition at line 601 of file expression.cpp.

Definition at line 828 of file expression.cpp.

Definition at line 697 of file expression.cpp.

Returns the variable type

Returns:
The the variable type.

Definition at line 1569 of file expression.cpp.

Definition at line 1582 of file expression.cpp.

BooleanType Expression::isVariable ( ) const [inline]

Returns the number of columns.

Returns:
The number of columns.
Expression Expression::mul ( const Expression arg) const [protected]

Definition at line 412 of file expression.cpp.

Expression Expression::operator() ( uint  idx) const

Definition at line 218 of file expression.cpp.

Expression Expression::operator() ( uint  rowIdx,
uint  colIdx 
) const

Definition at line 233 of file expression.cpp.

Operator & Expression::operator() ( uint  idx)

Definition at line 250 of file expression.cpp.

Operator & Expression::operator() ( uint  rowIdx,
uint  colIdx 
)

Definition at line 273 of file expression.cpp.

Expression & Expression::operator*= ( const Expression arg)

Definition at line 313 of file expression.cpp.

Expression & Expression::operator+= ( const Expression arg)

Definition at line 307 of file expression.cpp.

Expression Expression::operator- ( ) const

Definition at line 1448 of file expression.cpp.

Expression & Expression::operator-= ( const Expression arg)

Definition at line 310 of file expression.cpp.

Expression & Expression::operator/= ( const Expression arg)

Definition at line 316 of file expression.cpp.

Expression & Expression::operator<< ( const Expression arg)

An operator for adding elements.

Definition at line 175 of file expression.cpp.

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

Assignment Operator.

Definition at line 131 of file expression.cpp.

std::ostream & Expression::print ( std::ostream &  stream) const

Definition at line 198 of file expression.cpp.

Operator * Expression::product ( const Operator a,
const Operator b 
) const [protected]

Internal product routine (protected, only for internal use).

Definition at line 382 of file expression.cpp.

Expression Expression::sub ( const Expression arg) const [protected]

Definition at line 350 of file expression.cpp.

returnValue Expression::substitute ( int  idx,
const Expression arg 
) const

Substitutes a given variable with an expression.

Definition at line 1436 of file expression.cpp.

Returns the transpose of this expression.

Returns:
The transposed expression.

Definition at line 811 of file expression.cpp.


Friends And Related Function Documentation

friend class CFunction [friend]

Definition at line 59 of file expression.hpp.

friend class COperator [friend]

Definition at line 58 of file expression.hpp.

friend class FunctionEvaluationTree [friend]

Definition at line 60 of file expression.hpp.

Expression operator* ( const Expression arg1,
const Expression arg2 
) [friend]

Definition at line 302 of file expression.cpp.

Expression operator+ ( const Expression arg1,
const Expression arg2 
) [friend]

Definition at line 298 of file expression.cpp.

Expression operator- ( const Expression arg1,
const Expression arg2 
) [friend]

Definition at line 300 of file expression.cpp.

Expression operator/ ( const Expression arg1,
const Expression arg2 
) [friend]

Definition at line 304 of file expression.cpp.

std::ostream& operator<< ( std::ostream &  stream,
const Expression arg 
) [friend]

Definition at line 213 of file expression.cpp.


Member Data Documentation

The expression component

Definition at line 315 of file expression.hpp.

uint Expression::dim [protected]

DVector space dimension.

Definition at line 312 of file expression.hpp.

Element of vector space.

Definition at line 311 of file expression.hpp.

std::string Expression::name [protected]

The name of the expression

Definition at line 316 of file expression.hpp.

uint Expression::nCols [protected]

DMatrix dimension.

Definition at line 313 of file expression.hpp.

uint Expression::nRows [protected]

Definition at line 313 of file expression.hpp.

Variable type.

Definition at line 314 of file expression.hpp.


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


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:40:24