63 x = 0;
xa = 0;
p = 0;
u = 0;
w = 0;
65 init( _x,_xa,_p,_u,_w );
142 if(
x != 0 ){
delete x ;
x = 0; }
143 if(
xa != 0 ){
delete xa;
xa = 0; }
144 if(
p != 0 ){
delete p ;
p = 0; }
145 if(
u != 0 ){
delete u ;
u = 0; }
146 if(
w != 0 ){
delete w ;
w = 0; }
171 if(
x != 0 )
x ->
print(
"iter.x " );
173 if(
p != 0 )
p ->
print(
"iter.p " );
174 if(
u != 0 )
u ->
print(
"iter.u " );
175 if(
w != 0 )
w ->
print(
"iter.w " );
186 if(
x != 0 ){
x ->
getGrid(tmp); unionGrid = unionGrid & tmp; }
187 if(
xa != 0 ){
xa->
getGrid(tmp); unionGrid = unionGrid & tmp; }
188 if(
p != 0 ){
p ->
getGrid(tmp); unionGrid = unionGrid & tmp; }
189 if(
u != 0 ){
u ->
getGrid(tmp); unionGrid = unionGrid & tmp; }
190 if(
w != 0 ){
w ->
getGrid(tmp); unionGrid = unionGrid & tmp; }
199 double startTime = 0.0, endTime = 0.0;
338 for( run2 = 0; run2 <
getNX(); run2++ )
339 x->operator()(run1,run2) += alpha*tmp(run2,0);
346 for( run2 = 0; run2 <
getNXA(); run2++ )
347 xa->operator()(run1,run2) += alpha*tmp(run2,0);
354 for( run2 = 0; run2 <
getNP(); run2++ )
355 p->operator()(run1,run2) += alpha*tmp(run2,0);
363 for( run2 = 0; run2 <
getNU(); run2++ )
364 u->operator()(run1,run2) += alpha*tmp(run2,0);
371 for( run2 = 0; run2 <
getNW(); run2++ )
372 w->operator()(run1,run2) += alpha*tmp(run2,0);
returnValue print(std::ostream &stream=std::cout, const char *const name=DEFAULT_LABEL, const char *const startString=DEFAULT_START_STRING, const char *const endString=DEFAULT_END_STRING, uint width=DEFAULT_WIDTH, uint precision=DEFAULT_PRECISION, const char *const colSeparator=DEFAULT_COL_SEPARATOR, const char *const rowSeparator=DEFAULT_ROW_SEPARATOR) const
Data class for storing generic optimization variables.
Implements a very rudimentary block sparse matrix class.
returnValue disableAutoInit()
VariablesGrid & shiftBackwards(DVector lastValue=emptyVector)
BooleanType getAutoInit(uint pointIdx) const
int acadoMax(const int x, const int y)
double getFirstTime() const
BooleanType acadoIsEqual(double x, double y, double TOL)
BooleanType acadoIsNegative(double x, double TOL)
Provides a time grid consisting of vector-valued optimization variables at each grid point...
Allows to pass back messages to the calling function.
returnValue allocateAll()
DVector getUpperBounds(uint pointIdx) const
BooleanType hasLowerBounds() const
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
returnValue updateData(double t, DVector &x_=emptyVector, DVector &xa_=emptyVector, DVector &p_=emptyVector, DVector &u_=emptyVector, DVector &w_=emptyVector)
returnValue init(const VariablesGrid *const _x, const VariablesGrid *const _xa, const VariablesGrid *const _p, const VariablesGrid *const _u, const VariablesGrid *const _w)
Allows to conveniently handle (one-dimensional) grids consisting of time points.
BooleanType isEmpty() const
void copy(const OCPiterate &rhs)
#define CLOSE_NAMESPACE_ACADO
uint getNumPoints() const
uint getFloorIndex(double time) const
double getIntervalLength() const
returnValue getSubBlock(uint rowIdx, uint colIdx, DMatrix &value) const
returnValue enableSimulationMode()
returnValue setVector(uint pointIdx, const DVector &_values)
Grid getUnionGrid() const
returnValue getInitialData(DVector &x_=emptyVector, DVector &xa_=emptyVector, DVector &p_=emptyVector, DVector &u_=emptyVector, DVector &w_=emptyVector) const
returnValue getGrid(Grid &_grid) const
OCPiterate & operator=(const OCPiterate &rhs)
returnValue applyStep(const BlockMatrix &bm, double alpha)
void update(double t, VariablesGrid &z1, DVector &z2) const
void rhs(const real_t *x, real_t *f)
BooleanType inSimulationMode
virtual returnValue shift(double timeShift=-1.0, DVector lastX=emptyVector, DVector lastXA=emptyVector, DVector lastP=emptyVector, DVector lastU=emptyVector, DVector lastW=emptyVector)
uint getNumPoints() const
void setAll(const T &_value)
DVector getVector(uint pointIdx) const
BooleanType hasTime(double _time) const
returnValue enableAutoInit()
double getLastTime() const
DVector getLowerBounds(uint pointIdx) const
BooleanType areGridsConsistent()
static DVector emptyVector
BooleanType hasUpperBounds() const
#define BEGIN_NAMESPACE_ACADO
returnValue print() const
#define ACADOERROR(retval)