Abstract base class for all scalar-valued symbolic operators. More...
#include <smooth_operator.hpp>
Public Attributes | |
int | nCount |
Public Attributes inherited from Operator | |
int | nCount |
Additional Inherited Members | |
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 inherited from Operator | |
BooleanType | initialized |
Abstract base class for all scalar-valued symbolic operators.
The class Operator serves as an abstract base class for all scalar-valued symbolic operators.
Definition at line 56 of file smooth_operator.hpp.
BEGIN_NAMESPACE_ACADO SmoothOperator::SmoothOperator | ( | ) |
Default constructor.
Definition at line 44 of file smooth_operator.cpp.
|
virtual |
Definition at line 48 of file smooth_operator.cpp.
|
pure 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 Operator.
Implemented in COperator, Projection, Power, Power_Int, BinaryOperator, DoubleConstant, Product, Quotient, Subtraction, Addition, and UnaryOperator.
|
pure virtual |
Automatic Differentiation in backward mode based on
buffered values
number | the buffer position |
seed | the seed |
df | the derivative of the expression |
Implements Operator.
Implemented in Projection, COperator, BinaryOperator, DoubleConstant, Power_Int, UnaryOperator, Addition, Product, Subtraction, Power, and Quotient.
|
pure 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 Operator.
Implemented in Projection, COperator, BinaryOperator, DoubleConstant, Power_Int, UnaryOperator, Addition, Product, Subtraction, Power, and Quotient.
|
pure 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 Operator.
Implemented in COperator, Projection, Power, Power_Int, BinaryOperator, DoubleConstant, Product, Quotient, Subtraction, UnaryOperator, and Addition.
|
pure 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 Operator.
Implemented in COperator, Projection, DoubleConstant, Power_Int, BinaryOperator, UnaryOperator, Addition, Product, Subtraction, Power, and Quotient.
|
pure 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 Operator.
Implemented in BinaryOperator, COperator, Projection, DoubleConstant, Power_Int, UnaryOperator, Addition, Product, Subtraction, Power, and Quotient.
|
pure 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 Operator.
Implemented in Projection, COperator, BinaryOperator, DoubleConstant, Power_Int, UnaryOperator, Addition, Product, Subtraction, Power, and Quotient.
|
pure 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 Operator.
Implemented in Projection, COperator, Power, Power_Int, BinaryOperator, DoubleConstant, Product, Subtraction, Addition, Quotient, and UnaryOperator.
|
pure virtual |
Clears the buffer and resets the buffer size
to 1.
Implements Operator.
Implemented in Projection, COperator, DoubleConstant, Power_Int, BinaryOperator, and UnaryOperator.
|
pure virtual |
Provides a deep copy of the expression.
Implements Operator.
Implemented in Projection, COperator, DoubleConstant, Power_Int, BinaryOperator, UnaryOperator, Addition, Product, Subtraction, Quotient, Power, Cos, Exp, Logarithm, Sin, Tan, Acos, Asin, Atan, and TreeProjection.
|
virtual |
Provides a deep copy of a tree projection.
Reimplemented from Operator.
Reimplemented in TreeProjection.
Definition at line 89 of file smooth_operator.cpp.
|
pure virtual |
Returns the derivative of the expression with respect
to the variable var(index).
index | diff. index |
Implements Operator.
Implemented in COperator, Projection, Power, Power_Int, BinaryOperator, DoubleConstant, Product, UnaryOperator, Quotient, Subtraction, and Addition.
|
pure virtual |
Enumerates all variables based on a common
IndexList.
Implements Operator.
Implemented in Projection, COperator, BinaryOperator, DoubleConstant, Power_Int, and UnaryOperator.
|
pure 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 Operator.
Implemented in Projection, COperator, Power, BinaryOperator, DoubleConstant, Power_Int, Product, UnaryOperator, Quotient, Subtraction, and Addition.
|
pure virtual |
Evaluates the expression (templated version)
Implements Operator.
Implemented in Projection, COperator, Power, BinaryOperator, DoubleConstant, Power_Int, Product, UnaryOperator, Quotient, Subtraction, Addition, Acos, Atan, Cos, Exp, Logarithm, Sin, Tan, and Asin.
|
pure virtual |
Returns the curvature of the expression
Implements Operator.
Implemented in COperator, Projection, DoubleConstant, BinaryOperator, Power_Int, UnaryOperator, Power, Addition, Product, Subtraction, Quotient, Exp, and Logarithm.
|
virtual |
Asks the variable for its relative index. the variable for its global index.
Reimplemented from Operator.
Reimplemented in Projection.
Definition at line 181 of file smooth_operator.cpp.
|
pure virtual |
Returns the monotonicity of the expression.
Implements Operator.
Implemented in COperator, Projection, DoubleConstant, BinaryOperator, Power_Int, UnaryOperator, Power, Addition, Product, Subtraction, and Quotient.
|
pure virtual |
Asks the expression for its name.
Implements Operator.
Implemented in COperator, Projection, BinaryOperator, DoubleConstant, Power_Int, UnaryOperator, Addition, Product, Subtraction, Quotient, and Power.
|
virtual |
Return the value of the constant
Reimplemented from Operator.
Reimplemented in DoubleConstant, Addition, Product, Subtraction, and Quotient.
Definition at line 179 of file smooth_operator.cpp.
|
pure virtual |
Asks the expression whether it is depending on a certian type of
variable.
Implements Operator.
Implemented in Projection, COperator, Power_Int, BinaryOperator, DoubleConstant, and UnaryOperator.
|
pure 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 Operator.
Implemented in Projection, COperator, BinaryOperator, DoubleConstant, Power_Int, UnaryOperator, and TreeProjection.
|
pure 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 Operator.
Implemented in Projection, COperator, BinaryOperator, DoubleConstant, Power_Int, UnaryOperator, Power, Product, Subtraction, Addition, Quotient, and TreeProjection.
|
pure virtual |
Checks whether the expression is zero or one
Implements Operator.
Implemented in TreeProjection, Projection, COperator, Power_Int, BinaryOperator, DoubleConstant, and UnaryOperator.
|
pure 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 Operator.
Implemented in Projection, COperator, BinaryOperator, DoubleConstant, Power_Int, UnaryOperator, Power, Product, Subtraction, Addition, Quotient, and TreeProjection.
|
pure 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 Operator.
Implemented in Projection, COperator, BinaryOperator, DoubleConstant, Power_Int, UnaryOperator, Power, Product, Subtraction, Addition, Quotient, and TreeProjection.
|
virtual |
Checks whether the expression is smooth in time
Implements Operator.
Definition at line 173 of file smooth_operator.cpp.
|
pure virtual |
Asks whether all elements are purely symbolic.
Implements Operator.
Implemented in Projection, DoubleConstant, COperator, Power_Int, BinaryOperator, and UnaryOperator.
|
pure virtual |
Asks the expression whether it is a variable.
Implements Operator.
Implemented in Projection, COperator, Power_Int, DoubleConstant, BinaryOperator, and UnaryOperator.
|
pure 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 ONES FOR AN EXPRESSION
AS A KIND OF INIT ROUTINE.
indexList | The index list to be filled with entries |
Implements Operator.
Implemented in Projection, COperator, Power_Int, DoubleConstant, BinaryOperator, UnaryOperator, and TreeProjection.
Expression SmoothOperator::operator* | ( | const double & | arg | ) | const |
Definition at line 137 of file smooth_operator.cpp.
Expression SmoothOperator::operator* | ( | const DVector & | arg | ) | const |
Definition at line 138 of file smooth_operator.cpp.
Expression SmoothOperator::operator* | ( | const DMatrix & | arg | ) | const |
Definition at line 139 of file smooth_operator.cpp.
Expression SmoothOperator::operator* | ( | const Operator & | arg | ) | const |
Definition at line 142 of file smooth_operator.cpp.
Expression SmoothOperator::operator* | ( | const Expression & | arg | ) | const |
Definition at line 154 of file smooth_operator.cpp.
Operator & SmoothOperator::operator*= | ( | const double & | arg | ) |
Definition at line 112 of file smooth_operator.cpp.
Definition at line 113 of file smooth_operator.cpp.
Definition at line 114 of file smooth_operator.cpp.
Operator & SmoothOperator::operator*= | ( | const Expression & | arg | ) |
Definition at line 115 of file smooth_operator.cpp.
Expression SmoothOperator::operator+ | ( | const double & | arg | ) | const |
Definition at line 123 of file smooth_operator.cpp.
Expression SmoothOperator::operator+ | ( | const DVector & | arg | ) | const |
Definition at line 124 of file smooth_operator.cpp.
Expression SmoothOperator::operator+ | ( | const DMatrix & | arg | ) | const |
Definition at line 125 of file smooth_operator.cpp.
Expression SmoothOperator::operator+ | ( | const Operator & | arg | ) | const |
Definition at line 126 of file smooth_operator.cpp.
Expression SmoothOperator::operator+ | ( | const Expression & | arg | ) | const |
Definition at line 127 of file smooth_operator.cpp.
Operator & SmoothOperator::operator+= | ( | const double & | arg | ) |
Definition at line 102 of file smooth_operator.cpp.
Definition at line 103 of file smooth_operator.cpp.
Definition at line 104 of file smooth_operator.cpp.
Operator & SmoothOperator::operator+= | ( | const Expression & | arg | ) |
Definition at line 105 of file smooth_operator.cpp.
Expression SmoothOperator::operator- | ( | const double & | arg | ) | const |
Definition at line 129 of file smooth_operator.cpp.
Expression SmoothOperator::operator- | ( | const DVector & | arg | ) | const |
Definition at line 130 of file smooth_operator.cpp.
Expression SmoothOperator::operator- | ( | const DMatrix & | arg | ) | const |
Definition at line 131 of file smooth_operator.cpp.
Expression SmoothOperator::operator- | ( | const Operator & | arg | ) | const |
Definition at line 132 of file smooth_operator.cpp.
Expression SmoothOperator::operator- | ( | const Expression & | arg | ) | const |
Definition at line 133 of file smooth_operator.cpp.
Expression SmoothOperator::operator- | ( | ) | const |
Definition at line 135 of file smooth_operator.cpp.
Operator & SmoothOperator::operator-= | ( | const double & | arg | ) |
Definition at line 107 of file smooth_operator.cpp.
Definition at line 108 of file smooth_operator.cpp.
Definition at line 109 of file smooth_operator.cpp.
Operator & SmoothOperator::operator-= | ( | const Expression & | arg | ) |
Definition at line 110 of file smooth_operator.cpp.
Expression SmoothOperator::operator/ | ( | const double & | arg | ) | const |
Definition at line 156 of file smooth_operator.cpp.
Expression SmoothOperator::operator/ | ( | const Operator & | arg | ) | const |
Definition at line 157 of file smooth_operator.cpp.
Expression SmoothOperator::operator/ | ( | const Expression & | arg | ) | const |
Definition at line 158 of file smooth_operator.cpp.
Operator & SmoothOperator::operator/= | ( | const double & | arg | ) |
Definition at line 117 of file smooth_operator.cpp.
Operator & SmoothOperator::operator/= | ( | const Expression & | arg | ) |
Definition at line 118 of file smooth_operator.cpp.
ConstraintComponent SmoothOperator::operator<= | ( | const double & | ub | ) | const |
Definition at line 160 of file smooth_operator.cpp.
ConstraintComponent SmoothOperator::operator<= | ( | const DVector & | ub | ) | const |
Definition at line 164 of file smooth_operator.cpp.
ConstraintComponent SmoothOperator::operator<= | ( | const VariablesGrid & | ub | ) | const |
Definition at line 168 of file smooth_operator.cpp.
|
virtual |
Sets the argument (note that arg should have dimension 1).
Reimplemented from Operator.
Reimplemented in TreeProjection.
Definition at line 53 of file smooth_operator.cpp.
Reimplemented from Operator.
Definition at line 60 of file smooth_operator.cpp.
Reimplemented from Operator.
Definition at line 67 of file smooth_operator.cpp.
|
virtual |
Reimplemented from Operator.
Reimplemented in TreeProjection.
Definition at line 74 of file smooth_operator.cpp.
Reimplemented from Operator.
Reimplemented in TreeProjection.
Definition at line 81 of file smooth_operator.cpp.
ConstraintComponent SmoothOperator::operator== | ( | const double & | b | ) | const |
Definition at line 162 of file smooth_operator.cpp.
ConstraintComponent SmoothOperator::operator== | ( | const DVector & | b | ) | const |
Definition at line 166 of file smooth_operator.cpp.
ConstraintComponent SmoothOperator::operator== | ( | const VariablesGrid & | b | ) | const |
Definition at line 170 of file smooth_operator.cpp.
ConstraintComponent SmoothOperator::operator>= | ( | const double & | lb | ) | const |
Definition at line 161 of file smooth_operator.cpp.
ConstraintComponent SmoothOperator::operator>= | ( | const DVector & | lb | ) | const |
Definition at line 165 of file smooth_operator.cpp.
ConstraintComponent SmoothOperator::operator>= | ( | const VariablesGrid & | lb | ) | const |
Definition at line 169 of file smooth_operator.cpp.
|
virtual |
Returns the argument or NULL if no intermediate argument available
Reimplemented from Operator.
Reimplemented in TreeProjection.
Definition at line 188 of file smooth_operator.cpp.
|
pure virtual |
Prints the expression into a stream.
Implements Operator.
Implemented in BinaryOperator, Projection, COperator, DoubleConstant, Power_Int, UnaryOperator, Addition, Product, Subtraction, Power, and Quotient.
|
pure virtual |
Overwrites the curvature of the expression.
(For the case that the curvature is explicitly known)
Implements Operator.
Implemented in COperator, Projection, DoubleConstant, BinaryOperator, Power_Int, and UnaryOperator.
|
pure virtual |
Overwrites the monotonicity of the expression.
(For the case that the monotonicity is explicitly known)
Implements Operator.
Implemented in COperator, Projection, DoubleConstant, BinaryOperator, Power_Int, and UnaryOperator.
Substitutes var(index) with the expression sub.
index | subst. index |
sub | the substitution |
Implements Operator.
Implemented in Projection, COperator, Power, Power_Int, BinaryOperator, DoubleConstant, Product, Subtraction, Addition, Quotient, UnaryOperator, Cos, Exp, Logarithm, Sin, Tan, Acos, Asin, and Atan.
int SmoothOperator::nCount |
Definition at line 516 of file smooth_operator.hpp.