119 if ( (
int)idx >=
getDim() )
151 for( run1 = 0; run1 < constant.
getDim(); run1++ )
152 tmp << constant(run1);
154 return add( tStart, tEnd, tmp );
169 for( run1 = 0; run1 < sampledData.
getNumPoints()-1; run1++ ){
171 for( run2 = 0; run2 < sampledData.
getNumRows(); run2++ )
172 tmp->operator<<( sampledData(run1,run2) );
173 returnvalue =
add( sampledData.
getTime(run1), sampledData.
getTime(run1+1), *tmp );
182 for( run1 = 0; run1 < sampledData.
getNumPoints()-1; run1++ ){
184 for( run2 = 0; run2 < sampledData.
getNumRows(); run2++ ){
186 m = (sampledData(run1+1,run2) - sampledData(run1,run2) )/
189 b = sampledData(run1,run2) - m*sampledData.
getTime(run1);
191 tmp->operator<<( m*t + b );
193 returnvalue =
add( sampledData.
getTime(run1), sampledData.
getTime(run1+1), *tmp );
227 if( parameterization_.
getDim() == 0 )
253 times[nIntervals+1] = tEnd;
256 grid =
new Grid( nIntervals+2, times );
277 if( parameterization_.
getNX () != 0 ||
278 parameterization_.
getNXA() != 0 ||
279 parameterization_.
getNP () != 0 ||
280 parameterization_.
getNPI() != 0 ||
281 parameterization_.
getNU () != 0 ||
282 parameterization_.
getNUI() != 0 ||
283 parameterization_.
getNW() != 0 ){
346 double tt[1] = { t };
362 double *tmp =
new double[
dim];
370 for( run1 = 0; run1 <
dim; run1++ )
371 result(run1) = tmp[run1];
382 Grid intervalsSubGrid;
398 result.
init(
dim, discretizationGrid );
400 for( run1 = 0; run1 < discretizationGrid.
getNumPoints(); run1++ ){
Allows to setup and evaluate a general function based on SymbolicExpressions.
double getTime(uint pointIdx) const
double getFirstTime() const
BooleanType acadoIsEqual(double x, double y, double TOL)
returnValue evaluate(double t, double *result) const
BEGIN_NAMESPACE_ACADO const double EPS
returnValue add(double tStart, double tEnd, const DVector constant)
void init(unsigned _dim=0)
Provides a time grid consisting of vector-valued optimization variables at each grid point...
Allows to pass back messages to the calling function.
DVector evaluate(const EvaluationPoint &x, const int &number=0)
BooleanType isInTimeDomain(double t) const
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Allows to conveniently handle (one-dimensional) grids consisting of time points.
BooleanType acadoIsGreater(double x, double y, double TOL)
#define CLOSE_NAMESPACE_ACADO
returnValue getSubGrid(double tStart, double tEnd, Grid &_subGrid) const
uint getFloorIndex(double time) const
Function ** parameterization
Curve & operator=(const Curve &arg)
returnValue setVector(uint pointIdx, const DVector &_values)
BooleanType acadoIsSmaller(double x, double y, double TOL)
Allows to work with piecewise-continous function defined over a scalar time interval.
returnValue getTimeDomain(double tStart, double tEnd) const
Curve operator()(uint idx) const
uint getNumIntervals() const
uint getNumPoints() const
double getLastTime() const
#define BEGIN_NAMESPACE_ACADO
returnValue discretize(const Grid &discretizationGrid, VariablesGrid &result) const
BooleanType acadoIsStrictlyGreater(double x, double y, double TOL)
BooleanType isEmpty() const
#define ACADOERROR(retval)