63 result = (
double*) calloc( arg.
getDim(),
sizeof(double) );
64 for(
int i=0; i<
getDim(); ++i )
90 result = (
double*) calloc( arg.
getDim(),
sizeof(double) );
91 for(
int i=0; i<
getDim(); ++i )
150 if ( (
int)idx >=
getDim() )
188 switch(variableType_) {
197 case VT_TIME :
return 1;
break;
412 double *Jr=
new double[
N];
413 double *seed=
new double[n];
414 for (
int i=0;i<n;i++) seed[i]=0;
415 for (
int i=0;i<n;i++) {
416 if (i>0) seed[i-1]=0;
418 for (
int j=0;j<
N;j++) Jr[j]=0;
442 double *df,
double *ddf ){
449 double *df,
double *ddf ){
464 const char *fcnName ,
465 const char *realString
475 const char *fcnName ,
476 const char *realString
488 const char *realString,
501 _numX, _numXA, _numU, _numP, _numDX, _numOD, allocateMemory, staticMemory);
554 double *seed_ =
new double[
getDim()];
556 for( run1 = 0; run1 <
getDim(); run1++ )
557 seed_[run1] = seed(run1);
571 J =
new double[seed.
getDim()];
580 for( run1 = 0; run1 < seed.
getDim(); run1++ )
581 df.
z[run2] += J[run1]*seed(run1);
BooleanType isRationalIn(const Expression &variable)
std::string getGlobalExportVariableName() const
Allows to setup and evaluate a general function based on SymbolicExpressions.
virtual returnValue AD_backward2(int number, double *seed1, double *seed2, double *df, double *ddf)
Abstract base class for all scalar-valued symbolic operators.
virtual int getNumberOfVariables() const
virtual returnValue AD_forward(double *x, double *seed, double *f, double *df)
virtual int getNU() const
virtual returnValue AD_forward2(int number, double *seed1, double *seed2, double *df, double *ddf)
BooleanType isSymbolic() const
virtual returnValue clearBuffer()
Allows to pass back messages to the calling function.
DVector evaluate(const EvaluationPoint &x, const int &number=0)
returnValue exportForwardDeclarations(std::ostream &stream=std::cout, const char *fcnName="ACADOfcn", const char *realString="double") const
Allows to setup function evaluation points.
virtual int getNT() const
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
void setAll(const T &_value)
returnValue C_print(std::ostream &stream=std::cout, const char *fcnName="ACADOfcn", const char *realString="double") const
unsigned getGlobalExportVariableSize() const
returnValue AD_backward2(int number, double *seed1, double *seed2, double *df, double *ddf)
virtual returnValue AD_backward(double *seed, double *df)
#define CLOSE_NAMESPACE_ACADO
virtual int getNOD() const
returnValue substitute(VariableType variableType_, int index_, double sub_)
virtual int getNW() const
GenericMatrix< double > DMatrix
returnValue setGlobalExportVariableName(const std::string &var)
returnValue getExpression(Expression &expression) const
returnValue print(std::ostream &stream, const char *fcnName="ACADOfcn", const char *realString="double") const
BooleanType isNonincreasing()
virtual int index(VariableType variableType_, int index_) const
Base class for all variables within the symbolic expressions family.
virtual MonotonicityType getMonotonicity()
returnValue jacobian(DMatrix &x)
calculate the jacobian of an evaluated function
virtual Operator * getExpression(uint componentIdx) const
double * getEvaluationPointer() const
virtual returnValue evaluate(double *x, double *result)
virtual NeutralElement isOneOrZero()
virtual BooleanType isRationalIn(const Expression &variable)
BooleanType isLinearIn(const Expression &variable)
unsigned getGlobalExportVariableSize() const
returnValue setScale(double *scale_)
virtual BooleanType isDependingOn(const Expression &variable)
returnValue exportCode(std::ostream &stream=std::cout, const char *fcnName="ACADOfcn", const char *realString="double", uint _numX=0, uint _numXA=0, uint _numU=0, uint _numP=0, uint _numDX=0, uint _numOD=0, bool allocateMemory=true, bool staticMemory=false) const
virtual int getNPI() const
virtual int getNDX() const
returnValue exportCode(std::ostream &stream, const char *fcnName="ACADOfcn", const char *realString="double", uint _numX=0, uint _numXA=0, uint _numU=0, uint _numP=0, uint _numDX=0, uint _numOD=0, bool allocateMemory=true, bool staticMemory=false) const
double scale(VariableType variableType_, int index_) const
FunctionEvaluationTree evaluationTree
Function & operator=(const Function &rhs)
virtual int getNP() const
BooleanType isDependingOn(const Expression &variable)
returnValue clearBuffer()
int index(VariableType variableType_, int index_) const
std::string getGlobalExportVariableName() const
BooleanType ADisSupported() const
virtual double scale(VariableType variableType_, int index_) const
returnValue AD_backward(const DVector &seed, EvaluationPoint &df, const int &number=0)
virtual int getNUI() const
Organizes the evaluation of the function tree.
DVector AD_forward(const EvaluationPoint &x, const int &number=0)
returnValue exportForwardDeclarations(std::ostream &stream, const char *fcnName="ACADOfcn", const char *realString="double") const
virtual FunctionEvaluationTree substitute(VariableType variableType_, int index_, double sub_)
#define BEGIN_NAMESPACE_ACADO
returnValue AD_forward2(int number, double *seed1, double *seed2, double *df, double *ddf)
Function & operator<<(const Expression &arg)
NeutralElement isOneOrZero()
returnValue setGlobalExportVariableName(const std::string &_name)
BooleanType isNondecreasing()
Function operator()(uint idx) const
virtual returnValue setScale(double *scale_)
virtual CurvatureType getCurvature()
virtual BooleanType isLinearIn(const Expression &variable)
int getNumberOfVariables() const
virtual int getNX() const
virtual int getNXA() const
#define ACADOERROR(retval)
virtual BooleanType isPolynomialIn(const Expression &variable)
BooleanType isPolynomialIn(const Expression &variable)