Implements the projection operator within the symbolic operators family. More...
#include <projection.hpp>
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 Operator * | AD_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 returnValue | clearBuffer () |
virtual Operator * | clone () const |
virtual Operator * | differentiate (int index) |
virtual returnValue | enumerateVariables (SymbolicIndexList *indexList) |
virtual returnValue | evaluate (int number, double *x, double *result) |
virtual returnValue | evaluate (EvaluationBase *x) |
virtual CurvatureType | getCurvature () |
virtual int | getGlobalIndex () const |
virtual MonotonicityType | getMonotonicity () |
virtual OperatorName | getName () |
virtual double | getScale () const |
VariableType | getType () const |
virtual int | getVariableIndex () const |
virtual BooleanType | isDependingOn (VariableType var) const |
virtual BooleanType | isDependingOn (int dim, VariableType *varType, int *component, BooleanType *implicit_dep) |
virtual BooleanType | isLinearIn (int dim, VariableType *varType, int *component, BooleanType *implicit_dep) |
virtual NeutralElement | isOneOrZero () const |
virtual BooleanType | isPolynomialIn (int dim, VariableType *varType, int *component, BooleanType *implicit_dep) |
virtual BooleanType | isRationalIn (int dim, VariableType *varType, int *component, BooleanType *implicit_dep) |
virtual BooleanType | isSymbolic () const |
virtual BooleanType | isTrivial () const |
virtual BooleanType | isVariable (VariableType &varType, int &component) const |
virtual returnValue | loadIndices (SymbolicIndexList *indexList) |
virtual std::ostream & | print (std::ostream &stream) const |
Projection () | |
Projection (const std::string &name_) | |
Projection (VariableType variableType_, int vIndex_, const std::string &name_) | |
Projection (const Projection &arg) | |
virtual returnValue | setCurvature (CurvatureType curvature_) |
virtual returnValue | setMonotonicity (MonotonicityType monotonicity_) |
virtual returnValue | setScale (const double &scale_) |
virtual returnValue | setVariableExportName (const VariableType &_type, const std::vector< std::string > &_name) |
virtual Operator * | substitute (int index, const Operator *sub) |
virtual | ~Projection () |
Public Member Functions inherited from SmoothOperator | |
virtual TreeProjection * | cloneTreeProjection () const |
virtual double | getValue () 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 |
Operator & | operator*= (const double &arg) |
Operator & | operator*= (const DVector &arg) |
Operator & | operator*= (const DMatrix &arg) |
Operator & | operator*= (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 |
Operator & | operator+= (const double &arg) |
Operator & | operator+= (const DVector &arg) |
Operator & | operator+= (const DMatrix &arg) |
Operator & | operator+= (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 |
Operator & | operator-= (const double &arg) |
Operator & | operator-= (const DVector &arg) |
Operator & | operator-= (const DMatrix &arg) |
Operator & | operator-= (const Expression &arg) |
Expression | operator/ (const double &arg) const |
Expression | operator/ (const Operator &arg) const |
Expression | operator/ (const Expression &arg) const |
Operator & | operator/= (const double &arg) |
Operator & | operator/= (const Expression &arg) |
ConstraintComponent | operator<= (const double &ub) const |
ConstraintComponent | operator<= (const DVector &ub) const |
ConstraintComponent | operator<= (const VariablesGrid &ub) const |
virtual Operator & | operator= (const double &arg) |
virtual Operator & | operator= (const DVector &arg) |
virtual Operator & | operator= (const DMatrix &arg) |
virtual Operator & | operator= (const Expression &arg) |
virtual Operator & | operator= (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 Operator * | passArgument () const |
SmoothOperator () | |
virtual | ~SmoothOperator () |
Public Member Functions inherited from Operator | |
virtual returnValue | initDerivative () |
virtual Operator * | myAdd (Operator *a, Operator *b) |
virtual Operator * | myLogarithm (Operator *a) |
virtual Operator * | myPower (Operator *a, Operator *b) |
virtual Operator * | myPowerInt (Operator *a, int b) |
virtual Operator * | myProd (Operator *a, Operator *b) |
virtual Operator * | mySubtract (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 |
Operator & | operator*= (const double &arg) |
Operator & | operator*= (const DVector &arg) |
Operator & | operator*= (const DMatrix &arg) |
Operator & | operator*= (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 |
Operator & | operator+= (const double &arg) |
Operator & | operator+= (const DVector &arg) |
Operator & | operator+= (const DMatrix &arg) |
Operator & | operator+= (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 |
Operator & | operator-= (const double &arg) |
Operator & | operator-= (const DVector &arg) |
Operator & | operator-= (const DMatrix &arg) |
Operator & | operator-= (const Expression &arg) |
Expression | operator/ (const double &arg) const |
Expression | operator/ (const Operator &arg) const |
Expression | operator/ (const Expression &arg) const |
Operator & | operator/= (const double &arg) |
Operator & | operator/= (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 Member Functions | |
virtual returnValue | ADbackwardProtected (int dim, VariableType *varType, int *component, Operator *seed, Operator **df, int &nNewIS, TreeProjection ***newIS) |
virtual Operator * | ADforwardProtected (int dim, VariableType *varType, int *component, Operator **seed, int &nNewIS, TreeProjection ***newIS) |
virtual returnValue | ADsymmetricProtected (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 void | copy (const Projection &arg) |
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 TreeProjection * | convert2TreeProjection (Operator *a) const |
Protected Attributes | |
CurvatureType | curvature |
MonotonicityType | monotonicity |
std::string | name |
OperatorName | operatorName |
double | scale |
int | variableIndex |
VariableType | variableType |
int | vIndex |
Protected Attributes inherited from Operator | |
BooleanType | initialized |
Friends | |
class | FunctionEvaluationTree |
Additional Inherited Members | |
Public Attributes inherited from SmoothOperator | |
int | nCount |
Public Attributes inherited from Operator | |
int | nCount |
Implements the projection operator within the symbolic operators family.
The class Projection implements the scalar-valued projection operator within the symbolic operators family.
Definition at line 55 of file projection.hpp.
BEGIN_NAMESPACE_ACADO Projection::Projection | ( | ) |
Default constructor
Definition at line 43 of file projection.cpp.
Projection::Projection | ( | const std::string & | name_ | ) |
Default constructor
Definition at line 55 of file projection.cpp.
Projection::Projection | ( | VariableType | variableType_, |
int | vIndex_, | ||
const std::string & | name_ | ||
) |
Default constructor
Definition at line 68 of file projection.cpp.
Projection::Projection | ( | const Projection & | arg | ) |
Default constructor
Definition at line 136 of file projection.cpp.
|
virtual |
Default destructor.
Definition at line 133 of file projection.cpp.
|
virtual |
Automatic Differentiation in backward mode on the symbolic
level. This function generates an expression for a
backward derivative
dim | number of directions |
varType | the variable types |
component | and their components |
seed | the backward seed |
df | the result |
nNewIS | the number of new IS |
newIS | the new IS-pointer |
Implements SmoothOperator.
Definition at line 203 of file projection.cpp.
|
virtual |
Automatic Differentiation in backward mode based on
buffered values
number | the buffer position |
seed | the seed |
df | the derivative of the expression |
Implements SmoothOperator.
Definition at line 353 of file projection.cpp.
|
virtual |
Automatic Differentiation in backward mode for 2nd order
derivatives based on buffered values.
number | the buffer position |
seed1 | the seed1 |
seed2 | the seed2 |
df | the 1st derivative of the expression |
ddf | the 2nd derivative of the expression |
Implements SmoothOperator.
Definition at line 368 of file projection.cpp.
|
virtual |
Automatic Differentiation in forward mode on the symbolic
level. This function generates an expression for a
forward derivative
dim | dimension of the seed |
varType | the variable types |
component | and their components |
seed | the forward seed |
nNewIS | the number of new IS |
newIS | the new IS-pointer |
Implements SmoothOperator.
Definition at line 191 of file projection.cpp.
|
virtual |
Automatic Differentiation in forward mode.
This function uses the intermediate
results from a buffer
number | storage position |
seed | the seed |
df | the derivative of the expression |
Implements SmoothOperator.
Definition at line 346 of file projection.cpp.
|
virtual |
Automatic Differentiation in forward mode.
This function stores the intermediate
results in a buffer (needed for 2nd order automatic
differentiation in backward mode)
number | storage position |
x | The evaluation point x |
seed | the seed |
f | the value of the expression at x |
df | the derivative of the expression |
Implements SmoothOperator.
Definition at line 336 of file projection.cpp.
|
virtual |
Automatic Differentiation in forward mode for
2nd derivatives.
This function uses intermediate
results from a buffer.
number | the buffer position |
seed1 | the seed |
seed2 | the seed for the first derivative |
df | the derivative of the expression |
ddf | the 2nd derivative of the expression |
Implements SmoothOperator.
Definition at line 360 of file projection.cpp.
|
virtual |
Automatic Differentiation in symmetric mode on the symbolic
level. This function generates an expression for a
second order derivative.
dim | number of directions |
varType | the variable types |
component | and their components |
l | the backward seed |
S | forward seed matrix |
dimS | dimension of forward seed |
dfS | first order foward result |
ldf | first order backward result |
H | upper trianglular part of the Hessian |
nNewLIS | the number of newLIS |
newLIS | the new LIS-pointer |
nNewSIS | the number of newSIS |
newSIS | the new SIS-pointer |
nNewHIS | the number of newHIS |
newHIS | the new HIS-pointer |
Implements SmoothOperator.
Definition at line 215 of file projection.cpp.
|
protectedvirtual |
Automatic Differentiation in backward mode on the symbolic
level. This function generates an expression for a
backward derivative
dim | number of directions |
varType | the variable types |
component | and their components |
seed | the backward seed |
df | the result |
nNewIS | the number of new IS |
newIS | the new IS-pointer |
Reimplemented in TreeProjection.
Definition at line 479 of file projection.cpp.
|
protectedvirtual |
Automatic Differentiation in forward mode on the symbolic
level. This function generates an expression for a
forward derivative
dim | dimension of the seed |
varType | the variable types |
component | and their components |
seed | the forward seed |
nNewIS | the number of new IS |
newIS | the new IS-pointer |
Reimplemented in TreeProjection.
Definition at line 457 of file projection.cpp.
|
protectedvirtual |
Automatic Differentiation in symmetric mode on the symbolic
level. This function generates an expression for a
second order derivative.
dim | number of directions |
varType | the variable types |
component | and their components |
l | the backward seed |
S | forward seed matrix |
dimS | dimension of forward seed |
dfS | first order foward result |
ldf | first order backward result |
H | upper trianglular part of the Hessian |
nNewLIS | the number of newLIS |
newLIS | the new LIS-pointer |
nNewSIS | the number of newSIS |
newSIS | the new SIS-pointer |
nNewHIS | the number of newHIS |
newHIS | the new HIS-pointer |
Reimplemented in TreeProjection.
Definition at line 518 of file projection.cpp.
|
virtual |
Clears the buffer and resets the buffer size
to 1.
Implements SmoothOperator.
Definition at line 385 of file projection.cpp.
|
virtual |
Provides a deep copy of the expression.
Implements SmoothOperator.
Reimplemented in TreeProjection.
Definition at line 142 of file projection.cpp.
|
protectedvirtual |
|
virtual |
Returns the derivative of the expression with respect
to the variable var(index).
index | diff. index |
Implements SmoothOperator.
Definition at line 180 of file projection.cpp.
|
virtual |
Enumerates all variables based on a common
IndexList.
Implements SmoothOperator.
Definition at line 418 of file projection.cpp.
|
virtual |
Evaluates the expression and stores the intermediate
results in a buffer (needed for automatic differentiation
in backward mode)
number | storage position |
x | the input variable x |
result | the result |
Implements SmoothOperator.
Definition at line 166 of file projection.cpp.
|
virtual |
Evaluates the expression (templated version)
Implements SmoothOperator.
Definition at line 173 of file projection.cpp.
|
virtual |
Returns the curvature of the expression
Implements SmoothOperator.
Definition at line 316 of file projection.cpp.
|
virtual |
Returns the global type ID of this variable
Reimplemented from SmoothOperator.
Definition at line 432 of file projection.cpp.
|
virtual |
Returns the monotonicity of the expression.
Implements SmoothOperator.
Definition at line 310 of file projection.cpp.
|
virtual |
Asks the expression for its name.
Implements SmoothOperator.
Definition at line 391 of file projection.cpp.
|
virtual |
Asks the expression for its scale.
Definition at line 397 of file projection.cpp.
VariableType Projection::getType | ( | ) | const |
Asks the variable for its type.
Definition at line 438 of file projection.cpp.
|
virtual |
Asks the variable for its relative index.
Definition at line 426 of file projection.cpp.
|
virtual |
Asks the expression whether it is depending on a certian type of
variable.
Implements SmoothOperator.
Definition at line 256 of file projection.cpp.
|
virtual |
Checks whether the expression is depending on a variable
dim | number of directions |
varType | the variable types |
component | and their components |
implicit_dep | implicit dependencies |
Implements SmoothOperator.
Reimplemented in TreeProjection.
Definition at line 265 of file projection.cpp.
|
virtual |
Checks whether the expression is linear in
(or not depending on) a variable
dim | number of directions |
varType | the variable types |
component | and their components |
implicit_dep | implicit dependencies |
Implements SmoothOperator.
Reimplemented in TreeProjection.
Definition at line 283 of file projection.cpp.
|
virtual |
Checks whether the expression is zero or one
Implements SmoothOperator.
Reimplemented in TreeProjection.
Definition at line 248 of file projection.cpp.
|
virtual |
Checks whether the expression is polynomial in
the specified variables
dim | number of directions |
varType | the variable types |
component | and their components |
implicit_dep | implicit dependencies |
Implements SmoothOperator.
Reimplemented in TreeProjection.
Definition at line 292 of file projection.cpp.
|
virtual |
Checks whether the expression is rational in
the specified variables
dim | number of directions |
varType | the variable types |
component | and their components |
implicit_dep | implicit dependencies |
Implements SmoothOperator.
Reimplemented in TreeProjection.
Definition at line 301 of file projection.cpp.
|
virtual |
Asks whether all elements are purely symbolic.
Implements SmoothOperator.
Definition at line 451 of file projection.cpp.
|
virtual |
Reimplemented from Operator.
Reimplemented in TreeProjection.
Definition at line 579 of file projection.cpp.
|
virtual |
Asks the expression whether it is a variable.
Implements SmoothOperator.
Definition at line 410 of file projection.cpp.
|
virtual |
The function loadIndices passes an IndexList through
the whole expression tree. Whenever a variable gets the
IndexList it tries to make an entry. However if a
variable recognices that it has already been added
before, it will not be allowed to make a second entry.
Note that all variables, in paticular the intermediate
states, will keep in mind whether they were allowed
to make an entry or not. This guarantees that
intermediate states are never evaluated twice if they
occur at several knots of the tree.
THIS FUNCTION IS FOR INTERNAL USE ONLY.
PLEASE CALL THIS FUNTION AT MOST ONCE FOR AN EXPRESSION
AS A KIND OF INIT ROUTINE.
indexList | The index list to be filled with entries |
Implements SmoothOperator.
Reimplemented in TreeProjection.
Definition at line 444 of file projection.cpp.
|
virtual |
Prints the expression into a stream.
Implements SmoothOperator.
Definition at line 379 of file projection.cpp.
|
virtual |
Overwrites the curvature of the expression.
(For the case that the curvature is explicitly known)
Implements SmoothOperator.
Definition at line 329 of file projection.cpp.
|
virtual |
Overwrites the monotonicity of the expression.
(For the case that the monotonicity is explicitly known)
Implements SmoothOperator.
Definition at line 322 of file projection.cpp.
|
virtual |
|
virtual |
Sets the name of the variable that is used for code export.
Reimplemented from Operator.
Reimplemented in TreeProjection.
Definition at line 569 of file projection.cpp.
Substitutes var(index) with the expression sub.
index | subst. index |
sub | the substitution |
Implements SmoothOperator.
Definition at line 236 of file projection.cpp.
|
friend |
Definition at line 58 of file projection.hpp.
|
protected |
Definition at line 555 of file projection.hpp.
|
protected |
Definition at line 556 of file projection.hpp.
|
protected |
Definition at line 551 of file projection.hpp.
|
protected |
Definition at line 553 of file projection.hpp.
|
protected |
Definition at line 550 of file projection.hpp.
|
protected |
Definition at line 548 of file projection.hpp.
|
protected |
Definition at line 547 of file projection.hpp.
|
protected |
Definition at line 549 of file projection.hpp.