ACADO Toolkit  1.2.0beta
Toolkit for Automatic Control and Dynamic Optimization
Public Member Functions | Protected Member Functions | Protected Attributes | Friends

Provides a time grid consisting of vector-valued optimization variables at each grid point. More...

#include <variables_grid.hpp>

Inheritance diagram for VariablesGrid:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 VariablesGrid ()
 Default constructor.
 VariablesGrid (uint _dim, const Grid &_grid, VariableType _type=VT_UNKNOWN, const char **const _names=0, const char **const _units=0, const VectorspaceElement *const _scaling=0, const VectorspaceElement *const _lb=0, const VectorspaceElement *const _ub=0, const BooleanType *const _autoInit=0)
 Constructor that takes the dimension of each vector-valued MatrixVariable as well as the grid on which they are defined.
 VariablesGrid (uint _dim, uint _nPoints, VariableType _type=VT_UNKNOWN, const char **const _names=0, const char **const _units=0, const VectorspaceElement *const _scaling=0, const VectorspaceElement *const _lb=0, const VectorspaceElement *const _ub=0, const BooleanType *const _autoInit=0)
 Constructor that takes the dimension of each vector-valued MatrixVariable as well as the number of grid points on which they are defined.
 VariablesGrid (uint _dim, double _firstTime, double _lastTime, uint _nPoints, VariableType _type=VT_UNKNOWN, const char **const _names=0, const char **const _units=0, const VectorspaceElement *const _scaling=0, const VectorspaceElement *const _lb=0, const VectorspaceElement *const _ub=0, const BooleanType *const _autoInit=0)
 Constructor that takes the dimensions of each vector-valued MatrixVariable as well as the number of grid points on which they are defined.
 VariablesGrid (const Vector &arg, const Grid &_grid=trivialGrid, VariableType _type=VT_UNKNOWN)
 Constructor that creates a VariablesGrid on a given grid with given type.
 VariablesGrid (const Matrix &arg, VariableType _type=VT_UNKNOWN)
 Constructor which reads data from a matrix.
 VariablesGrid (FILE *file)
 Constructor which reads data from a file.
 VariablesGrid (const VariablesGrid &rhs)
 Copy constructor (deep copy).
 VariablesGrid (const MatrixVariablesGrid &rhs)
 Copy constructor (deep copy).
 ~VariablesGrid ()
 Destructor.
VariablesGridoperator= (const VariablesGrid &rhs)
 Assignment operator (deep copy).
VariablesGridoperator= (const MatrixVariablesGrid &rhs)
 Assignment operator (deep copy).
VariablesGridoperator= (FILE *rhs)
 Assignment operator which reads data from a file.
VariablesGridoperator= (const Matrix &rhs)
 Assignment operator which reads data from a matrix.
BooleanType operator== (const VariablesGrid &arg) const
 Tests for equality,.
double & operator() (uint pointIdx, uint rowIdx)
 Returns the value of a certain component at a certain grid point.
double operator() (uint pointIdx, uint rowIdx) const
 Returns the value of a certain component at a certain grid point.
VariablesGrid operator() (const uint rowIdx) const
 Returns a VariablesGrid consisting only of the given row.
VariablesGrid operator[] (const uint pointIdx) const
 Returns a VariablesGrid consisting only of the values at given grid point.
VariablesGrid operator+ (const VariablesGrid &arg) const
 Adds (element-wise) two VariablesGrid into a temporary object.
VariablesGridoperator+= (const VariablesGrid &arg)
 Adds (element-wise) a VariablesGrid to object.
VariablesGrid operator- (const VariablesGrid &arg) const
 Subtracts (element-wise) a VariablesGrid from the object and stores result into a temporary object.
VariablesGridoperator-= (const VariablesGrid &arg)
 Subtracts (element-wise) a VariablesGrid from the object.
returnValue init ()
 Initializes an empty VariablesGrid.
returnValue init (uint _dim, const Grid &_grid, VariableType _type=VT_UNKNOWN, const char **const _names=0, const char **const _units=0, const VectorspaceElement *const _scaling=0, const VectorspaceElement *const _lb=0, const VectorspaceElement *const _ub=0, const BooleanType *const _autoInit=0)
 Initializes the VariablesGrid on a given grid with given dimension of each vector-valued MatrixVariable.
returnValue init (uint _dim, uint _nPoints, VariableType _type=VT_UNKNOWN, const char **const _names=0, const char **const _units=0, const VectorspaceElement *const _scaling=0, const VectorspaceElement *const _lb=0, const VectorspaceElement *const _ub=0, const BooleanType *const _autoInit=0)
 Initializes the VariablesGrid taking the dimension of each vector-valued MatrixVariable as well as the number of grid points on which they are defined.
returnValue init (uint _dim, double _firstTime, double _lastTime, uint _nPoints, VariableType _type=VT_UNKNOWN, const char **const _names=0, const char **const _units=0, const VectorspaceElement *const _scaling=0, const VectorspaceElement *const _lb=0, const VectorspaceElement *const _ub=0, const BooleanType *const _autoInit=0)
 Initializes the MatrixVariablesGrid taking the dimension of each vector-valued MatrixVariable as well as the number of grid points on which they are defined.
returnValue init (const Vector &arg, const Grid &_grid=trivialGrid, VariableType _type=VT_UNKNOWN)
 Initializes the VariablesGrid on a given grid with given type.
returnValue addVector (const Vector &newVector, double newTime=-INFTY)
 Adds a new grid point with given vector and time to grid.
returnValue setVector (uint pointIdx, const Vector &_values)
 Assigns new vector to grid point with given index.
returnValue setAllVectors (const Vector &_values)
 Assigns new vector to all grid points.
Vector getVector (uint pointIdx) const
 Returns vector at grid point with given index.
Vector getFirstVector () const
 Returns vector at first grid point.
Vector getLastVector () const
 Returns vector at first grid point.
returnValue appendTimes (const VariablesGrid &arg, MergeMethod _mergeMethod=MM_DUPLICATE)
 Appends grid point of given grid to object.
returnValue appendTimes (const Matrix &arg, MergeMethod _mergeMethod=MM_DUPLICATE)
 Appends grid point of given grid to object.
returnValue appendValues (const VariablesGrid &arg)
 Appends values at all grid points of given grid to object.
returnValue merge (const VariablesGrid &arg, MergeMethod _mergeMethod=MM_DUPLICATE, BooleanType keepOverlap=BT_TRUE)
 Constructs the set union in time of current and given grid.
VariablesGrid getTimeSubGrid (uint startIdx, uint endIdx) const
 Returns the sub grid in time starting and ending at given indices.
VariablesGrid getTimeSubGrid (double startTime, double endTime) const
 Returns the sub grid in time starting and ending at given times.
VariablesGrid getValuesSubGrid (uint startIdx, uint endIdx) const
 Returns the sub grid of values.
VariablesGridshiftTimes (double timeShift)
 Shifts times at all grid points by a given offset.
VariablesGridshiftBackwards (Vector lastValue=emptyVector)
 Shifts all grid points backwards by one grid point, deleting the first one and doubling the value at last grid point.
returnValue getSum (Vector &sum) const
 Returns the component-wise sum over all vectors at all grid points.
returnValue getIntegral (InterpolationMode mode, Vector &value) const
 Returns a component-wise approximation of the integral over all vectors at all grid points.
double & operator() (uint pointIdx, uint rowIdx, uint colIdx)
 Returns the value of a certain component at a certain grid point.
double operator() (uint pointIdx, uint rowIdx, uint colIdx) const
 Returns the value of a certain component at a certain grid point (const variant).
MatrixVariablesGrid operator+ (const MatrixVariablesGrid &arg) const
 Adds (element-wise) two MatrixVariablesGrid into a temporary object.
MatrixVariablesGridoperator+= (const MatrixVariablesGrid &arg)
 Adds (element-wise) a MatrixVariablesGrid to object.
MatrixVariablesGrid operator- (const MatrixVariablesGrid &arg) const
 Subtracts (element-wise) a MatrixVariablesGrid from the object and stores result into a temporary object.
MatrixVariablesGridoperator-= (const MatrixVariablesGrid &arg)
 Subtracts (element-wise) a MatrixVariablesGrid from the object.
returnValue init (uint _nRows, uint _nCols, const Grid &_grid, VariableType _type=VT_UNKNOWN, const char **const _names=0, const char **const _units=0, const VectorspaceElement *const _scaling=0, const VectorspaceElement *const _lb=0, const VectorspaceElement *const _ub=0, const BooleanType *const _autoInit=0)
 Initializes the MatrixVariablesGrid on a given grid with given dimensions of each MatrixVariable.
returnValue init (uint _nRows, uint _nCols, uint _nPoints, VariableType _type=VT_UNKNOWN, const char **const _names=0, const char **const _units=0, const VectorspaceElement *const _scaling=0, const VectorspaceElement *const _lb=0, const VectorspaceElement *const _ub=0, const BooleanType *const _autoInit=0)
 Initializes the MatrixVariablesGrid taking the dimensions of each MatrixVariable as well as the number of grid points on which they are defined.
returnValue init (uint _nRows, uint _nCols, double _firstTime, double _lastTime, uint _nPoints, VariableType _type=VT_UNKNOWN, const char **const _names=0, const char **const _units=0, const VectorspaceElement *const _scaling=0, const VectorspaceElement *const _lb=0, const VectorspaceElement *const _ub=0, const BooleanType *const _autoInit=0)
 Initializes the MatrixVariablesGrid taking the dimensions of each MatrixVariable as well as the number of grid points on which they are defined.
returnValue init (const Matrix &arg, const Grid &_grid=trivialGrid, VariableType _type=VT_UNKNOWN)
 Initializes the MatrixVariablesGrid on a given grid with given type.
returnValue init (uint _nPoints=0, const double *const _times=0)
 Initializes grid with given number of grid points and given times.
returnValue init (const Vector &times_)
 Initializes grid with given number of grid points and given times in form of a vector.
returnValue init (double _firstTime, double _lastTime, uint _nPoints=2)
 Initializes grid with given number of grid points and an equidistant grid of time points between given time of the first and last grid point.
returnValue init (const Grid &rhs)
 Initializes grid with given grid.
returnValue addMatrix (const Matrix &newMatrix, double newTime=-INFTY)
 Adds a new grid point with given matrix and time to grid.
returnValue setMatrix (uint pointIdx, const Matrix &_value) const
 Assigns new matrix to grid point with given index.
returnValue setAllMatrices (const Matrix &_values)
 Assigns new matrix to all grid points.
Matrix getMatrix (uint pointIdx) const
 Returns matrix at grid point with given index.
Matrix getFirstMatrix () const
 Returns matrix at first grid point.
Matrix getLastMatrix () const
 Returns matrix at last grid point.
uint getDim () const
 Returns total dimension of MatrixVariablesGrid, i.e.
uint getNumRows () const
 Returns number of rows of matrix at first grid point.
uint getNumRows (uint pointIdx) const
 Returns number of rows of matrix at grid point with given index.
uint getNumCols () const
 Returns number of columns of matrix at first grid point.
uint getNumCols (uint pointIdx) const
 Returns number of columns of matrix at grid point with given index.
uint getNumValues () const
 Returns number of values of matrix at first grid point.
uint getNumValues (uint pointIdx) const
 Returns number of values of matrix at grid point with given index.
VariableType getType () const
 Returns variable type of MatrixVariable at first grid point.
VariableType getType (uint pointIdx) const
 Returns variable type of MatrixVariable at grid point with given index.
returnValue setType (VariableType _type)
 Assigns new variable type at all grid points.
returnValue setType (uint pointIdx, VariableType _type)
 Assigns new variable type to MatrixVariable at grid point with given index.
returnValue getName (uint pointIdx, uint idx, char *const _name) const
 Returns name label of given component of MatrixVariable at grid point with given index.
returnValue setName (uint pointIdx, uint idx, const char *const _name)
 Assigns new name label to given component of MatrixVariable at grid point with given index.
returnValue getUnit (uint pointIdx, uint idx, char *const _unit) const
 Returns current unit label of given component of MatrixVariable at grid point with given index.
returnValue setUnit (uint pointIdx, uint idx, const char *const _unit)
 Assigns new name label to given component of MatrixVariable at grid point with given index.
VectorspaceElement getScaling (uint pointIdx) const
 Returns scaling of MatrixVariable at grid point with given index.
double getScaling (uint pointIdx, uint valueIdx) const
 Returns scaling of given component of MatrixVariable at grid point with given index.
returnValue setScaling (uint pointIdx, const VectorspaceElement &_scaling)
 Assigns new scaling to MatrixVariable at grid point with given index.
returnValue setScaling (uint pointIdx, uint valueIdx, double _scaling)
 Assigns new scaling to given component of MatrixVariable at grid point with given index.
VectorspaceElement getLowerBounds (uint pointIdx) const
 Returns lower bounds of MatrixVariable at grid point with given index.
returnValue setLowerBounds (uint pointIdx, const VectorspaceElement &_lb)
 Assigns new lower bounds to MatrixVariable at grid point with given index.
double getLowerBound (uint pointIdx, uint valueIdx) const
 Returns lower bound of given component of MatrixVariable at grid point with given index.
returnValue setLowerBound (uint pointIdx, uint valueIdx, double _lb)
 Assigns new lower bound to given component of MatrixVariable at grid point with given index.
VectorspaceElement getUpperBounds (uint pointIdx) const
 Returns upper bounds of MatrixVariable at grid point with given index.
returnValue setUpperBounds (uint pointIdx, const VectorspaceElement &_ub)
 Assigns new upper bounds to MatrixVariable at grid point with given index.
double getUpperBound (uint pointIdx, uint valueIdx) const
 Returns upper bound of given component of MatrixVariable at grid point with given index.
returnValue setUpperBound (uint pointIdx, uint valueIdx, double _ub)
 Assigns new upper bound to given component of MatrixVariable at grid point with given index.
BooleanType getAutoInit (uint pointIdx) const
 Returns whether MatrixVariable at grid point with given index will be automatically initialized.
returnValue setAutoInit (uint pointIdx, BooleanType _autoInit)
 Assigns new auto initialization flag to MatrixVariable at grid point with given index.
returnValue disableAutoInit ()
 Enables auto initialization at all grid points.
returnValue enableAutoInit ()
 Disables auto initialization at all grid points.
BooleanType hasNames () const
 Returns whether MatrixVariablesGrid comprises (non-empty) name labels (at at least one of its grid points).
BooleanType hasUnits () const
 Returns whether MatrixVariablesGrid comprises (non-empty) unit labels (at at least one of its grid points).
BooleanType hasScaling () const
 Returns whether scaling is set (at at least one grid point).
BooleanType hasLowerBounds () const
 Returns whether MatrixVariablesGrid comprises lower bounds (at at least one of its grid points).
BooleanType hasUpperBounds () const
 Returns whether MatrixVariablesGrid comprises upper bounds (at at least one of its grid points).
double getMax () const
 Returns maximum value over all matrices at all grid points.
double getMin () const
 Returns minimum value over all matrices at all grid points.
double getMean () const
 Returns mean value over all matrices at all grid points.
returnValue setZero ()
 Assigns zero to all components of all matrices at all grid points.
returnValue setAll (double _value)
 Assigns given value to all components of all matrices at all grid points.
returnValue appendTimes (const MatrixVariablesGrid &arg, MergeMethod _mergeMethod=MM_DUPLICATE)
 Appends grid point of given grid to object.
returnValue appendValues (const MatrixVariablesGrid &arg)
 Appends values at all grid points of given grid to object.
returnValue merge (const MatrixVariablesGrid &arg, MergeMethod _mergeMethod=MM_DUPLICATE, BooleanType keepOverlap=BT_TRUE)
 Constructs the set union in time of current and given grid.
returnValue merge (const Grid &arg, MergeMethod _mergeMethod=MM_DUPLICATE, BooleanType keepOverlap=BT_TRUE)
 Constructs the set union in time of current and given grid.
returnValue getGrid (Grid &_grid) const
 Returns the time grid of MatrixVariablesGrid.
Grid getTimePoints () const
 Returns (deep-copy of) time grid of MatrixVariablesGrid.
returnValue refineGrid (const Grid &arg, InterpolationMode mode=IM_CONSTANT)
 Refines the grid by adding all grid points of given grid that are not not yet included.
returnValue refineGrid (uint factor)
 Refines grid by a given factor by adding equally spaced additional time points in between existing ones.
returnValue coarsenGrid (const Grid &arg)
 Coarsens the grid by removing all grid points of current grid that are not included in given grid.
returnValue coarsenGrid (uint factor)
 Coarsens grid by a given factor by equally leaving out time points from the existing ones.
MatrixVariablesGrid getRefinedGrid (const Grid &arg, InterpolationMode mode=IM_CONSTANT) const
 Returns a refined grid by adding all grid points of given grid that are not yet included.
MatrixVariablesGrid getCoarsenedGrid (const Grid &arg) const
 Returns a coarsened grid by removing all grid points of current grid that are not included in given grid.
MatrixVariablesGridshiftBackwards (Matrix lastValue=emptyMatrix)
 Shifts all grid points backwards by one grid point, deleting the first one and doubling the value at last grid point.
Vector linearInterpolation (double time) const
 Returns a vector with interpolated values of the MatrixVariablesGrid at given time.
returnValue print (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
 Prints object to standard ouput stream.
returnValue print (const char *const name, PrintScheme printScheme) const
 Prints object to standard ouput stream.
returnValue print () const
 Prints times of all grid points to screen.
returnValue printToFile (const char *const filename, 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
 Prints object to file with given name.
returnValue printToFile (FILE *file, 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
 Prints object to given file.
returnValue printToFile (const char *const filename, const char *const name, PrintScheme printScheme) const
 Prints object to file with given name.
returnValue printToFile (FILE *file, const char *const name, PrintScheme printScheme) const
 Prints object to given file.
virtual returnValue printToString (char **string, 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
 Prints object to given string.
virtual returnValue printToString (char **string, const char *const name, PrintScheme printScheme) const
 Prints object to given string.
virtual uint determineStringLength (const char *const name, const char *const startString, const char *const endString, uint width, uint precision, const char *const colSeparator, const char *const rowSeparator) const
 Determines length of string required for printing object with given settings defining its output format.
int sprintf (char *buffer)
 Prints MatrixVariablesGrid into a char*.
BooleanType operator== (const Grid &arg) const
 Tests for equality, i.e.
BooleanType operator!= (const Grid &arg) const
 Tests for non-equality.
BooleanType operator< (const Grid &arg) const
 Tests if left-hand side grid is a strict subset of the right-hand side one, i.e.
BooleanType operator<= (const Grid &arg) const
 Tests if left-hand side grid is a subset of the right-hand side one, i.e.
BooleanType operator> (const Grid &arg) const
 Tests if right-hand side grid is a strict subset of the left-hand side one, i.e.
BooleanType operator>= (const Grid &arg) const
 Tests if right-hand side grid is a subset of the left-hand side one, i.e.
Gridoperator& (const Grid &arg)
 Constructs the set union of two grids.
returnValue equalizeGrids (Grid &arg)
 Constructs the set union of two grids and replaces both grids by this union grid.
returnValue setTime (double _time)
 Assigns next unintialized time point.
returnValue setTime (uint pointIdx, double _time)
 Assigns new time to grid point with given index.
returnValue addTime (double _time)
 Adds a new grid point with given time to grid.
BooleanType isEmpty () const
 Returns whether the grid is empty (i.e.
uint getNumPoints () const
 Returns number of grid points.
uint getNumIntervals () const
 Returns number of grid intervals.
double getFirstTime () const
 Returns time of first grid point.
double getLastTime () const
 Returns time of last grid point.
double getTime (uint pointIdx) const
 Returns time of grid point with given index.
BooleanType isEquidistant () const
 Returns whether the grid has equally spaced grid points or not.
double getIntervalLength () const
 Returns total interval length of grid.
double getIntervalLength (uint pointIdx) const
 Returns interval length between given grid point and next one.
returnValue scaleTimes (double scaling)
 Scales times at all grid points by a given positive factor.
BooleanType hasTime (double _time) const
 Returns whether the grid contains a given time point.
int findTime (double _time, uint startIdx=0) const
 Returns index of an grid point at given time, starting at startIdx.
int findFirstTime (double _time, uint startIdx=0) const
 Returns index of first grid point at given time, starting at startIdx.
int findLastTime (double _time, uint startIdx=0) const
 Returns index of last grid point at given time, starting at startIdx.
uint getFloorIndex (double time) const
 Returns index of grid point with greatest time smaller or equal to given time.
uint getCeilIndex (double time) const
 Returns index of grid point with smallest time greater or equal to given time.
uint getLastIndex () const
 Returns largest index of grid (note the difference to getNumPoints()).
BooleanType isLast (uint pointIdx) const
 Returns whether given index is the last one of the grid.
BooleanType isInInterval (double _time) const
 Returns whether given time lies within the total interval of the grid.
BooleanType isInInterval (uint pointIdx, double _time) const
 Returns whether given time lies within the interval between given grid point and next one.
BooleanType isInUpperHalfOpenInterval (uint pointIdx, double _time) const
 Returns whether given time lies within the half-open interval between given grid point and next one (next one not included).
BooleanType isInLowerHalfOpenInterval (uint pointIdx, double _time) const
 Returns whether given time lies within the half-open interval between given grid point (given grid point not included) and next one.
returnValue getSubGrid (double tStart, double tEnd, Grid &_subGrid) const
 Returns a sub-grid of current grid starting a given start time end ending at given end time.

Protected Member Functions

returnValue initializeFromBounds ()
 Initializes the grid vector by taking average between upper and lower bound.
returnValue addMatrix (const MatrixVariable &newMatrix, double newTime=-INFTY)
 Adds a new grid point with given MatrixVariable and time to grid.
returnValue clearValues ()
 Clears all MatrixVariables on the grid.
returnValue initMatrixVariables (uint _nRows, uint _nCols, VariableType _type=VT_UNKNOWN, const char **const _names=0, const char **const _units=0, const VectorspaceElement *const _scaling=0, const VectorspaceElement *const _lb=0, const VectorspaceElement *const _ub=0, const BooleanType *const _autoInit=0)
 Initializes array of MatrixVariables with given information.
returnValue setupEquidistant (double _firstTime, double _lastTime)
 Sets-up all times in an equidistant manner, starting at given start time and ending at given end time.
int findNextIndex () const
 Returns index of next unintialized grid point.

Protected Attributes

MatrixVariable ** values
 Matrix-valued optimization variable at all grid points.
uint nPoints
 Number of grid points.
double * times
 Time values at grid points.

Friends

class OptimizationAlgorithmBase
class OptimizationAlgorithm
class RealTimeAlgorithm
returnValue operator<< (FILE *file, VariablesGrid &arg)
 Prints the MatrixVariablesGrid into a file.
returnValue operator<< (FILE *file, MatrixVariablesGrid &arg)
 Prints the MatrixVariablesGrid into a file.

Detailed Description

The class VariablesGrid provides a time grid consisting of vector-valued optimization variables at each grid point, as they usually occur when discretizing optimal control problems.

The class specalizes the MatrixVariablesGrid class to vectors represented internally as matrices with exactly one column.

Author:
Hans Joachim Ferreau, Boris Houska

Constructor & Destructor Documentation

Referenced by operator()(), and operator[]().

VariablesGrid::VariablesGrid ( uint  _dim,
const Grid _grid,
VariableType  _type = VT_UNKNOWN,
const char **const  _names = 0,
const char **const  _units = 0,
const VectorspaceElement *const  _scaling = 0,
const VectorspaceElement *const  _lb = 0,
const VectorspaceElement *const  _ub = 0,
const BooleanType *const  _autoInit = 0 
)

Further information can optionally be specified.

Parameters:
[in]_dimDimension of each vector.
[in]_gridGrid on which the vector-valued MatrixVariable(s) are defined.
[in]_typeType of the variable(s).
[in]_namesArray containing names (labels) for each component of the variable(s).
[in]_unitsArray containing units for each component of the variable(s).
[in]_scalingArray containing the scaling for each component of the variable(s).
[in]_lbArray containing lower bounds for each component of the variable(s).
[in]_ubArray containing upper bounds for each component of the variable(s).
[in]_autoInitArray defining if each component of the variable(s) is to be automatically initialized.
VariablesGrid::VariablesGrid ( uint  _dim,
uint  _nPoints,
VariableType  _type = VT_UNKNOWN,
const char **const  _names = 0,
const char **const  _units = 0,
const VectorspaceElement *const  _scaling = 0,
const VectorspaceElement *const  _lb = 0,
const VectorspaceElement *const  _ub = 0,
const BooleanType *const  _autoInit = 0 
)

Further information can optionally be specified.

Parameters:
[in]_dimDimension of each vector.
[in]_nPointsNumber of grid points on which the vector-valued MatrixVariable(s) are defined.
[in]_typeType of the variable(s).
[in]_namesArray containing names (labels) for each component of the variable(s).
[in]_unitsArray containing units for each component of the variable(s).
[in]_scalingArray containing the scaling for each component of the variable(s).
[in]_lbArray containing lower bounds for each component of the variable(s).
[in]_ubArray containing upper bounds for each component of the variable(s).
[in]_autoInitArray defining if each component of the variable(s) is to be automatically initialized.
VariablesGrid::VariablesGrid ( uint  _dim,
double  _firstTime,
double  _lastTime,
uint  _nPoints,
VariableType  _type = VT_UNKNOWN,
const char **const  _names = 0,
const char **const  _units = 0,
const VectorspaceElement *const  _scaling = 0,
const VectorspaceElement *const  _lb = 0,
const VectorspaceElement *const  _ub = 0,
const BooleanType *const  _autoInit = 0 
)

Moreover, it takes the time of the first and the last grid point; all intermediate grid points are setup to form a equidistant grid of time points. Further information can optionally be specified.

Parameters:
[in]_dimDimension of each vector.
[in]_firstTimeTime of first grid point.
[in]_lastTimeTime of last grid point.
[in]_nPointsNumber of grid points on which the vector-valued MatrixVariable(s) are defined.
[in]_typeType of the variable(s).
[in]_namesArray containing names (labels) for each component of the variable(s).
[in]_unitsArray containing units for each component of the variable(s).
[in]_scalingArray containing the scaling for each component of the variable(s).
[in]_lbArray containing lower bounds for each component of the variable(s).
[in]_ubArray containing upper bounds for each component of the variable(s).
[in]_autoInitArray defining if each component of the variable(s) is to be automatically initialized.
VariablesGrid::VariablesGrid ( const Vector arg,
const Grid _grid = trivialGrid,
VariableType  _type = VT_UNKNOWN 
)

At each grid point, the vector-valued MatrixVariable is constructed from the vector passed.

Parameters:
[in]argVector to be assign at each point of the grid.
[in]_gridGrid on which the vector-valued MatrixVariable(s) are defined.
[in]_typeType of the variable(s).

The data is expected to be in matrix format and is interpreted as follows: the first entry of each row is taken as time of the grid point to be added, all remaining entries of each row are taken as numerical values of a vector-valued MatrixVariable with exactly one column. In effect, a MatrixVariablesGrid consisting of <number of columns - 1>-by-1 MatrixVariables defined on <number of="" rows>=""> grid points is setup. Note that all rows are expected to have equal number of columns.

Parameters:
[in]fileFile to be read.
Note:
The file is closed at the end of routine.

References Matrix::getNumCols(), Matrix::getNumRows(), Grid::setTime(), and uint.

VariablesGrid::VariablesGrid ( FILE *  file)

The data is interpreted as follows: the first entry of each row is taken as time of the grid point to be added, all remaining entries of each row are taken as numerical values of a vector-valued MatrixVariable with exactly one column. In effect, a MatrixVariablesGrid consisting of <number of columns - 1>-by-1 MatrixVariables defined on <number of="" rows>=""> grid points is setup. Note that all rows are expected to have equal number of columns.

Parameters:
[in]fileFile to be read.
Note:
The file is closed at the end of routine.
Parameters:
[in]rhsRight-hand side object.
Parameters:
[in]rhsRight-hand side object.

References ASSERT, and MatrixVariablesGrid::getNumCols().


Member Function Documentation

returnValue MatrixVariablesGrid::addMatrix ( const Matrix newMatrix,
double  newTime = -INFTY 
) [inherited]
returnValue MatrixVariablesGrid::addMatrix ( const MatrixVariable newMatrix,
double  newTime = -INFTY 
) [protected, inherited]
Parameters:
[in]newMatrixMatrixVariable of grid point to be added.
[in]newTimeTime of grid point to be added.
Returns:
SUCCESSFUL_RETURN,
RET_INVALID_ARGUMENTS

References Grid::addTime(), BT_TRUE, Grid::getLastTime(), Grid::getNumPoints(), isInfty(), Grid::nPoints, RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, and MatrixVariablesGrid::values.

returnValue Grid::addTime ( double  _time) [inherited]
returnValue VariablesGrid::addVector ( const Vector newVector,
double  newTime = -INFTY 
)
Parameters:
[in]newVectorVector of grid point to be added.
[in]newTimeTime of grid point to be added.
Returns:
SUCCESSFUL_RETURN,
RET_INVALID_ARGUMENTS

References MatrixVariablesGrid::addMatrix().

Referenced by PlotWindow::getDataGrids().

returnValue VariablesGrid::appendTimes ( const Matrix arg,
MergeMethod  _mergeMethod = MM_DUPLICATE 
)

A merge method defines the way duplicate entries are handled.

Parameters:
[in]argGrid to append in matrix form.
[in]_mergeMethodMerge method, see documentation of MergeMethod for details.
Returns:
SUCCESSFUL_RETURN,
RET_INVALID_ARGUMENTS

References appendTimes().

A merge method defines the way duplicate entries are handled.

Parameters:
[in]argGrid to append.
[in]_mergeMethodMerge method, see documentation of MergeMethod for details.
Returns:
SUCCESSFUL_RETURN,
RET_INVALID_ARGUMENTS

References ACADOERROR, acadoIsEqual(), acadoIsGreater(), MatrixVariablesGrid::addMatrix(), BT_FALSE, BT_TRUE, MatrixVariablesGrid::getFirstMatrix(), Grid::getFirstTime(), Grid::getLastIndex(), Grid::getLastTime(), Grid::getNumPoints(), Grid::getTime(), MM_DUPLICATE, MM_KEEP, MM_REPLACE, RET_INVALID_ARGUMENTS, MatrixVariablesGrid::setMatrix(), SUCCESSFUL_RETURN, uint, and MatrixVariablesGrid::values.

Referenced by MatrixVariablesGrid::merge().

Both grids need to be defined over identical grid points.

Parameters:
[in]argGrid whose values are to appended.
Returns:
SUCCESSFUL_RETURN,
RET_INVALID_ARGUMENTS

References ACADOERROR, Matrix::appendRows(), VariableSettings::appendSettings(), Grid::getNumPoints(), RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, uint, and MatrixVariablesGrid::values.

Referenced by Actuator::delayActuatorInput(), Actuator::getDelayedInputGrids(), Sensor::getDelayedOutputGrid(), and GnuplotWindow::sendDataToGnuplot().

Both grids need to be defined over identical grid points.

Parameters:
[in]argGrid whose values are to appended.
Returns:
SUCCESSFUL_RETURN,
RET_INVALID_ARGUMENTS

References ACADOERROR, Matrix::appendRows(), VariableSettings::appendSettings(), Grid::getNumPoints(), RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, uint, and MatrixVariablesGrid::values.

returnValue MatrixVariablesGrid::clearValues ( ) [protected, inherited]

Note that the grid itself is not cleared.

Returns:
SUCCESSFUL_RETURN

References Grid::nPoints, SUCCESSFUL_RETURN, uint, and MatrixVariablesGrid::values.

Referenced by MatrixVariablesGrid::init(), MatrixVariablesGrid::operator=(), and MatrixVariablesGrid::~MatrixVariablesGrid().

returnValue Grid::coarsenGrid ( uint  factor) [inherited]
Parameters:
[in]factorCoarsening factor.
Returns:
RET_NOT_YET_IMPLEMENTED,
RET_INVALID_ARGUMENTS

References ACADOERROR, Grid::getNumIntervals(), RET_INVALID_ARGUMENTS, RET_NOT_YET_IMPLEMENTED, and SUCCESSFUL_RETURN.

returnValue MatrixVariablesGrid::coarsenGrid ( const Grid arg) [inherited]

For doing so, the given grid has to be a subset of the current grid.

Parameters:
[in]argGrid to be used for coarsening.
Returns:
SUCCESSFUL_RETURN,
RET_INVALID_ARGUMENTS

References ACADOERROR, BT_TRUE, MatrixVariablesGrid::getCoarsenedGrid(), Grid::isEmpty(), RET_INVALID_ARGUMENTS, and SUCCESSFUL_RETURN.

uint MatrixVariablesGrid::determineStringLength ( const char *const  name,
const char *const  startString,
const char *const  endString,
uint  width,
uint  precision,
const char *const  colSeparator,
const char *const  rowSeparator 
) const [virtual, inherited]
Parameters:
[in]nameName label to be printed before the numerical values.
[in]startStringPrefix before printing the numerical values.
[in]endStringSuffix after printing the numerical values.
[in]widthTotal number of digits per single numerical value.
[in]precisionNumber of decimals per single numerical value.
[in]colSeparatorSeparator between the columns of the numerical values.
[in]rowSeparatorSeparator between the rows of the numerical values.
Returns:
Length of string required for printing object

References Grid::getNumPoints(), getStringLength(), uint, and MatrixVariablesGrid::values.

Referenced by MatrixVariablesGrid::printToString().

returnValue Grid::equalizeGrids ( Grid arg) [inherited]

Note that both the original as well as the argument grid is changed!

Parameters:
[in]argRight-hand side object.
Returns:
SUCCESSFUL_RETURN

References SUCCESSFUL_RETURN.

int Grid::findFirstTime ( double  _time,
uint  startIdx = 0 
) const [inherited]
Parameters:
[in]_timeTime to be found.
[in]startIdxStart index for searching for time point.
Returns:
>= 0: index of first grid point with given time,
-1: time point does not exist

References acadoIsEqual(), BT_TRUE, Grid::getNumPoints(), Grid::times, and uint.

Referenced by Grid::findTime().

int Grid::findLastTime ( double  _time,
uint  startIdx = 0 
) const [inherited]
Parameters:
[in]_timeTime to be found.
[in]startIdxStart index for searching for time point.
Returns:
>= 0: index of last grid point with given time,
-1: time point does not exist

References acadoIsEqual(), BT_TRUE, Grid::getNumPoints(), Grid::times, and uint.

Referenced by MatrixVariablesGrid::getCoarsenedGrid().

int Grid::findNextIndex ( ) const [protected, inherited]
Returns:
>= 0: index of next unintialized grid point,
-1: time point does not exist

References Grid::getNumPoints(), INFTY, Grid::times, and uint.

Referenced by Grid::setTime().

int Grid::findTime ( double  _time,
uint  startIdx = 0 
) const [inherited]
Parameters:
[in]_timeTime to be found.
[in]startIdxStart index for searching for time point.
Returns:
>= 0: index of grid point with given time,
-1: time point does not exist

References Grid::findFirstTime().

Referenced by Grid::hasTime(), Grid::operator<(), and Grid::operator>().

BooleanType MatrixVariablesGrid::getAutoInit ( uint  pointIdx) const [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
Returns:
BT_TRUE iff MatrixVariable at given grid point will be automatically initialized,
BT_FALSE otherwise

References ACADOERROR, defaultAutoInit, VariableSettings::getAutoInit(), Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, and MatrixVariablesGrid::values.

Referenced by OptimizationAlgorithmBase::initializeOCPiterate(), and OCPiterate::update().

uint Grid::getCeilIndex ( double  time) const [inherited]
Parameters:
[in]_timeTime smaller or equal than that of the time point to be found.
Returns:
>= 0: index of grid point with smallest time greater or equal to given time,
-1: time point does not exist

References acadoIsGreater(), acadoIsSmaller(), BT_TRUE, Grid::getLastIndex(), Grid::getTime(), Grid::isInLowerHalfOpenInterval(), and uint.

Referenced by getTimeSubGrid(), and MatrixVariablesGrid::linearInterpolation().

For doing so, the given grid has to be a subset of the current grid.

Parameters:
[in]argGrid to be used for coarsening.
Returns:
Coarsened grid

References MatrixVariablesGrid::addMatrix(), BT_FALSE, BT_TRUE, Grid::findLastTime(), Grid::getNumPoints(), Grid::getTime(), MatrixVariablesGrid::init(), Grid::isEmpty(), uint, and MatrixVariablesGrid::values.

Referenced by MatrixVariablesGrid::coarsenGrid(), and Process::simulate().

uint MatrixVariablesGrid::getDim ( ) const [inline, inherited]
double Grid::getFirstTime ( ) const [inline, inherited]
Returns:
Time of first grid point

References ASSERT, and Grid::times.

Referenced by Actuator::addActuatorNoise(), Sensor::addSensorNoise(), appendTimes(), MatrixVariablesGrid::appendTimes(), OCPiterate::areGridsConsistent(), Actuator::checkInputConsistency(), Process::checkInputConsistency(), Actuator::delayActuatorInput(), Sensor::delaySensorOutput(), IntegratorBDF::evaluate(), IntegratorRK::evaluate(), IntegratorLYAPUNOV::evaluate(), ImplicitRungeKuttaExport::evaluateDerivedPolynomial(), ImplicitRungeKuttaExport::evaluatePolynomial(), IntegratorLYAPUNOV::evaluateSensitivities(), IntegratorBDF::evaluateSensitivities(), IntegratorRK::evaluateSensitivities(), DiagonallyImplicitRKExport::formMatrix(), ImplicitRungeKuttaExport::formMatrix(), ImplicitRungeKuttaExport::generateOutput(), AdjointIRKExport::getCode(), ForwardIRKExport::getCode(), ExplicitRungeKuttaExport::getCode(), DiscreteTimeExport::getCode(), ImplicitRungeKuttaExport::getCode(), IntegratorExport::getIntegrationInterval(), PeriodicReferenceTrajectory::getReference(), StaticReferenceTrajectory::getReference(), OCP::getStartTime(), Curve::getTimeDomain(), Curve::isInTimeDomain(), ShootingMethod::logTrajectory(), merge(), MatrixVariablesGrid::merge(), DiagonallyImplicitRKExport::prepareInputSystem(), ImplicitRungeKuttaExport::prepareOutputEvaluation(), DiagonallyImplicitRKExport::prepareOutputSystem(), IntegratorBDF::relaxAlgebraic(), Process::run(), AdjointIRKExport::sensitivitiesOutputs(), ForwardIRKExport::sensitivitiesOutputs(), LogRecordItem::setAllValues(), ModelData::setIntegrationGrid(), LSQTerm::setReference(), ExplicitRungeKuttaExport::setup(), Sensor::step(), Process::step(), and Actuator::step().

Returns:
Vector at first grid point

References emptyVector, Grid::getNumPoints(), and getVector().

Referenced by appendTimes(), Controller::getCurrentReference(), and Process::run().

uint Grid::getFloorIndex ( double  time) const [inherited]
returnValue MatrixVariablesGrid::getGrid ( Grid _grid) const [inline, inherited]
Parameters:
[in]modeSpecifies how the vector-values are interpolated for approximating the integral, see documentation of InterpolationMode for details.
[out]valueComponent-wise approximation of the integral over all vectors at all grid points.
Returns:
SUCCESSFUL_RETURN

References ACADOERROR, Grid::getIntervalLength(), Grid::getNumIntervals(), MatrixVariablesGrid::getNumValues(), IM_CONSTANT, IM_LINEAR, operator()(), RET_NOT_YET_IMPLEMENTED, VectorspaceElement::setZero(), SUCCESSFUL_RETURN, and uint.

Referenced by LSQTerm::evaluate().

double Grid::getIntervalLength ( ) const [inline, inherited]
double Grid::getIntervalLength ( uint  pointIdx) const [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point at beginning of interval.
Returns:
Interval length between given grid point and next one

References ACADOERROR, Grid::getLastIndex(), Grid::getNumPoints(), INFTY, RET_INDEX_OUT_OF_BOUNDS, and Grid::times.

uint Grid::getLastIndex ( ) const [inline, inherited]
Returns:
Matrix at last grid point

References emptyMatrix, MatrixVariablesGrid::getMatrix(), and Grid::getNumPoints().

Referenced by LogRecordItem::setAllValues().

double Grid::getLastTime ( ) const [inline, inherited]
Returns:
Time of last grid point

References ASSERT, Grid::nPoints, and Grid::times.

Referenced by Curve::add(), Actuator::addActuatorNoise(), MatrixVariablesGrid::addMatrix(), Sensor::addSensorNoise(), Grid::addTime(), appendTimes(), MatrixVariablesGrid::appendTimes(), OCPiterate::areGridsConsistent(), Actuator::checkInputConsistency(), Process::checkInputConsistency(), Actuator::delayActuatorInput(), Sensor::delaySensorOutput(), Curve::evaluate(), IntegratorBDF::evaluate(), IntegratorRK::evaluate(), IntegratorLYAPUNOV::evaluate(), ImplicitRungeKuttaExport::evaluateDerivedPolynomial(), ImplicitRungeKuttaExport::evaluatePolynomial(), IntegratorBDF::evaluateSensitivities(), DiagonallyImplicitRKExport::formMatrix(), ImplicitRungeKuttaExport::formMatrix(), ImplicitRungeKuttaExport::generateOutput(), ForwardIRKExport::getCode(), AdjointIRKExport::getCode(), ExplicitRungeKuttaExport::getCode(), DiscreteTimeExport::getCode(), ImplicitRungeKuttaExport::getCode(), PlotWindow::getDataGrids(), Actuator::getDelayedInputGrids(), Sensor::getDelayedOutputGrid(), OCP::getEndTime(), IntegratorExport::getIntegrationInterval(), PeriodicReferenceTrajectory::getReference(), StaticReferenceTrajectory::getReference(), Grid::getTime(), Curve::getTimeDomain(), Integrator::integrate(), Curve::isInTimeDomain(), ShootingMethod::logTrajectory(), Grid::merge(), merge(), MatrixVariablesGrid::merge(), DiagonallyImplicitRKExport::prepareInputSystem(), ImplicitRungeKuttaExport::prepareOutputEvaluation(), DiagonallyImplicitRKExport::prepareOutputSystem(), Grid::refineGrid(), IntegratorBDF::rk_start(), Process::run(), AdjointIRKExport::sensitivitiesOutputs(), ForwardIRKExport::sensitivitiesOutputs(), ModelData::setIntegrationGrid(), ExplicitRungeKuttaExport::setup(), IntegratorDiscretizedODE::step(), IntegratorBDF::step(), IntegratorLYAPUNOV::step(), IntegratorRK::step(), Sensor::step(), Process::step(), and Actuator::step().

double MatrixVariablesGrid::getLowerBound ( uint  pointIdx,
uint  valueIdx 
) const [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]valueIdxIndex of component.
Returns:
< INFTY: Lower bound of given component of MatrixVariable at given grid point,
INFTY: Index out of bounds

References VariableSettings::getLowerBound(), Grid::getNumPoints(), INFTY, and MatrixVariablesGrid::values.

Referenced by initializeFromBounds(), ExportGaussNewtonCN2::setupConstraintsEvaluation(), and ExportGaussNewtonCondensed::setupConstraintsEvaluation().

VectorspaceElement MatrixVariablesGrid::getLowerBounds ( uint  pointIdx) const [inline, inherited]
Matrix MatrixVariablesGrid::getMatrix ( uint  pointIdx) const [inherited]
double MatrixVariablesGrid::getMax ( ) const [inline, inherited]
Returns:
Maximum value over all matrices at all grid points

References Grid::getNumPoints(), INFTY, uint, and MatrixVariablesGrid::values.

Referenced by PlotWindow::getAutoScaleYLimits().

double MatrixVariablesGrid::getMean ( ) const [inline, inherited]
Returns:
Mean value over all matrices at all grid points

References Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.

Referenced by PlotWindow::getAutoScaleYLimits().

double MatrixVariablesGrid::getMin ( ) const [inline, inherited]
Returns:
Minimum value over all matrices at all grid points

References Grid::getNumPoints(), INFTY, uint, and MatrixVariablesGrid::values.

Referenced by PlotWindow::getAutoScaleYLimits().

returnValue MatrixVariablesGrid::getName ( uint  pointIdx,
uint  idx,
char *const  _name 
) const [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]idxIndex of component.
[out]_nameName label of given component at given grid point.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS,
RET_MEMBER_NOT_INITIALISED

References ACADOERROR, VariableSettings::getName(), Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, and MatrixVariablesGrid::values.

uint MatrixVariablesGrid::getNumCols ( ) const [inline, inherited]
Returns:
Number of columns of matrix at first grid point

References MatrixVariablesGrid::values.

Referenced by operator=(), MatrixVariablesGrid::sprintf(), and VariablesGrid().

uint MatrixVariablesGrid::getNumCols ( uint  pointIdx) const [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
Returns:
Number of columns of matrix at grid point with given index

References ASSERT, Matrix::getNumCols(), Grid::getNumPoints(), and MatrixVariablesGrid::values.

uint Grid::getNumIntervals ( ) const [inline, inherited]
Returns:
Number of grid intervals

References Grid::getLastIndex(), and Grid::nPoints.

Referenced by ModelData::addOutput(), ShootingMethod::addStage(), Grid::coarsenGrid(), ShootingMethod::deleteAllSeeds(), ImplicitRungeKuttaExport::divideMeasurements(), ShootingMethod::evaluate(), DiagonallyImplicitRKExport::formMatrix(), ImplicitRungeKuttaExport::formMatrix(), ImplicitRungeKuttaExport::generateOutput(), AdjointIRKExport::getCode(), ForwardIRKExport::getCode(), ExplicitRungeKuttaExport::getCode(), DiscreteTimeExport::getCode(), ImplicitRungeKuttaExport::getCode(), ForwardIRKExport::getDataDeclarations(), AdjointIRKExport::getDataDeclarations(), getIntegral(), IntegratorExport::getIntegrationInterval(), DynamicDiscretization::getNumEvaluationPoints(), Curve::getTimeDomain(), Grid::isEquidistant(), OCP::OCP(), DiagonallyImplicitRKExport::prepareInputSystem(), ImplicitRungeKuttaExport::prepareOutputEvaluation(), DiagonallyImplicitRKExport::prepareOutputSystem(), Grid::refineGrid(), AdjointIRKExport::sensitivitiesInputSystem(), ForwardIRKExport::sensitivitiesInputSystem(), AdjointIRKExport::sensitivitiesOutputs(), ForwardIRKExport::sensitivitiesOutputs(), DiagonallyImplicitRKExport::sensitivitiesOutputSystem(), AdjointIRKExport::sensitivitiesOutputSystem(), ForwardIRKExport::sensitivitiesOutputSystem(), ModelData::setIntegrationGrid(), NARXExport::setup(), ExplicitRungeKuttaExport::setup(), DiscreteTimeExport::setup(), ForwardIRKExport::setup(), AdjointIRKExport::setup(), OCP::setupGrid(), MatrixVariablesGrid::shiftBackwards(), and ShootingMethod::unfreeze().

uint Grid::getNumPoints ( ) const [inline, inherited]
Returns:
Number of grid points

References Grid::nPoints.

Referenced by acadoPlot(), CoupledPathConstraint::add(), PathConstraint::add(), Curve::add(), Constraint::add(), MatrixVariablesGrid::addMatrix(), Grid::addTime(), appendTimes(), MatrixVariablesGrid::appendTimes(), appendValues(), MatrixVariablesGrid::appendValues(), BoxConstraint::BoxConstraint(), Actuator::checkInputConsistency(), Process::checkInputConsistency(), ClippingFunctionality::clipSignals(), Constraint::Constraint(), Constraint::deleteAll(), MatrixVariablesGrid::determineStringLength(), MatrixVariablesGrid::disableAutoInit(), Curve::discretize(), MatrixVariablesGrid::enableAutoInit(), ShootingMethod::evaluate(), LSQTerm::evaluate(), Constraint::evaluate(), BoxConstraint::evaluateBounds(), PointConstraint::evaluateSensitivities(), BoundaryConstraint::evaluateSensitivities(), CoupledPathConstraint::evaluateSensitivities(), PathConstraint::evaluateSensitivities(), MayerTerm::evaluateSensitivities(), LSQTerm::evaluateSensitivities(), AlgebraicConsistencyConstraint::evaluateSensitivities(), Constraint::evaluateSensitivities(), LSQTerm::evaluateSensitivitiesGN(), LSQEndTerm::evaluateSensitivitiesGN(), Grid::findFirstTime(), Grid::findLastTime(), Grid::findNextIndex(), TransferDevice::generateNoise(), MatrixVariablesGrid::getAutoInit(), Constraint::getBackwardSensitivities(), Constraint::getBlockDim(), Constraint::getBoundResiduum(), BoxConstraint::getBounds(), Constraint::getBounds(), MatrixVariablesGrid::getCoarsenedGrid(), Constraint::getConstraintResiduum(), PlotWindow::getDataGrids(), PathConstraint::getDim(), MatrixVariablesGrid::getDim(), MatrixVariablesGrid::getFirstMatrix(), getFirstVector(), Constraint::getForwardSensitivities(), MatrixVariablesGrid::getGrid(), Grid::getIntervalLength(), Grid::getLastIndex(), MatrixVariablesGrid::getLastMatrix(), getLastVector(), MatrixVariablesGrid::getLowerBound(), MatrixVariablesGrid::getLowerBounds(), MatrixVariablesGrid::getMatrix(), MatrixVariablesGrid::getMax(), MatrixVariablesGrid::getMean(), MatrixVariablesGrid::getMin(), MatrixVariablesGrid::getName(), PathConstraint::getNC(), Constraint::getNC(), Constraint::getNP(), Constraint::getNU(), Constraint::getNumberOfBlocks(), MatrixVariablesGrid::getNumCols(), OCPiterate::getNumPoints(), LogRecordItem::getNumPoints(), MatrixVariablesGrid::getNumRows(), MatrixVariablesGrid::getNumValues(), Constraint::getNW(), Constraint::getNX(), Constraint::getNXA(), SimulationEnvironment::getProcessAlgebraicStates(), SimulationEnvironment::getProcessDifferentialStates(), SimulationEnvironment::getProcessIntermediateStates(), MatrixVariablesGrid::getRefinedGrid(), SimulationEnvironment::getSampledProcessOutput(), MatrixVariablesGrid::getScaling(), Grid::getSubGrid(), getSum(), Grid::getTime(), getTimeSubGrid(), MatrixVariablesGrid::getTimeSubGrid(), MatrixVariablesGrid::getType(), MatrixVariablesGrid::getUnit(), MatrixVariablesGrid::getUpperBound(), MatrixVariablesGrid::getUpperBounds(), getValuesSubGrid(), MatrixVariablesGrid::getValuesSubGrid(), getVector(), Integrator::getX(), Integrator::getXA(), MatrixVariablesGrid::hasLowerBounds(), MatrixVariablesGrid::hasNames(), MatrixVariablesGrid::hasScaling(), MatrixVariablesGrid::hasUnits(), MatrixVariablesGrid::hasUpperBounds(), BoxConstraint::init(), Constraint::init(), PIDcontroller::init(), initializeFromBounds(), OptimizationAlgorithmBase::initializeOCPiterate(), Constraint::isAffine(), Constraint::isBoxConstraint(), Grid::isInInterval(), Grid::isInLowerHalfOpenInterval(), Grid::isInUpperHalfOpenInterval(), MatrixVariablesGrid::linearInterpolation(), ShootingMethod::logTrajectory(), LSQTerm::LSQTerm(), Matrix::Matrix(), Grid::merge(), merge(), MatrixVariablesGrid::merge(), OCP::OCP(), MatrixVariablesGrid::operator()(), operator()(), MatrixVariablesGrid::operator+(), MatrixVariablesGrid::operator+=(), MatrixVariablesGrid::operator-(), MatrixVariablesGrid::operator-=(), Grid::operator<(), BoxConstraint::operator=(), LSQTerm::operator=(), Constraint::operator=(), Grid::operator==(), operator==(), Grid::operator>(), MatrixVariablesGrid::operator[](), operator[](), Grid::print(), MatrixVariablesGrid::printToString(), Process::projectToComponents(), Process::run(), GnuplotWindow::sendDataToGnuplot(), MatrixVariablesGrid::setAll(), MatrixVariablesGrid::setAllMatrices(), LogRecordItem::setAllValues(), setAllVectors(), MatrixVariablesGrid::setAutoInit(), ExportNLPSolver::setConstraints(), Constraint::setForwardSeed(), LSQTerm::setGrid(), MatrixVariablesGrid::setLowerBound(), MatrixVariablesGrid::setMatrix(), MatrixVariablesGrid::setName(), LSQTerm::setReference(), MatrixVariablesGrid::setScaling(), Grid::setTime(), MatrixVariablesGrid::setType(), MatrixVariablesGrid::setUnit(), Constraint::setUnitBackwardSeed(), Constraint::setUnitForwardSeed(), ExportGaussNewtonForces::setupConstraintsEvaluation(), OptimizationAlgorithmBase::setupDifferentialEquation(), Grid::setupEquidistant(), MatrixVariablesGrid::setUpperBound(), MatrixVariablesGrid::setUpperBounds(), setVector(), MatrixVariablesGrid::setZero(), MatrixVariablesGrid::shiftBackwards(), Process::simulate(), MatrixVariablesGrid::sprintf(), LinearStateFeedback::step(), PIDcontroller::step(), Sensor::step(), UniformNoise::step(), GaussianNoise::step(), Process::step(), LogCollection::updateLogRecord(), and LSQTerm::~LSQTerm().

uint MatrixVariablesGrid::getNumRows ( ) const [inline, inherited]
uint MatrixVariablesGrid::getNumRows ( uint  pointIdx) const [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
Returns:
Number of rows of matrix at grid point with given index

References ASSERT, Grid::getNumPoints(), Matrix::getNumRows(), and MatrixVariablesGrid::values.

uint MatrixVariablesGrid::getNumValues ( ) const [inline, inherited]
uint MatrixVariablesGrid::getNumValues ( uint  pointIdx) const [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
Returns:
Number of values of matrix at grid point with given index

References ASSERT, VectorspaceElement::getDim(), Grid::getNumPoints(), and MatrixVariablesGrid::values.

For doing so, the given grid has to be a superset of the current grid. Values at newly added grid points are obtained by the (optionally) specified interpolation mode.

Parameters:
[in]argGrid to be used for refinement.
[in]modeInterpolation mode, see documentation of InterpolationMode.
Returns:
Refined grid

References acadoMin(), MatrixVariablesGrid::addMatrix(), BT_TRUE, Grid::getNumPoints(), Grid::getTime(), Grid::hasTime(), IM_CONSTANT, Grid::isEmpty(), uint, and MatrixVariablesGrid::values.

Referenced by Process::calculateOutput(), and MatrixVariablesGrid::refineGrid().

VectorspaceElement MatrixVariablesGrid::getScaling ( uint  pointIdx) const [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
Returns:
Scaling of MatrixVariable at given grid point

References emptyVectorspaceElement, Grid::getNumPoints(), VariableSettings::getScaling(), and MatrixVariablesGrid::values.

double MatrixVariablesGrid::getScaling ( uint  pointIdx,
uint  valueIdx 
) const [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]valueIdxIndex of component.
Returns:
> 0.0: Scaling of given component of MatrixVariable at given grid point,
-1.0: Index out of bounds

References Grid::getNumPoints(), VariableSettings::getScaling(), and MatrixVariablesGrid::values.

returnValue Grid::getSubGrid ( double  tStart,
double  tEnd,
Grid _subGrid 
) const [inherited]
Parameters:
[in]tStartStart time of sub-grid.
[in]tEndEnd time of sub-grid.
[out]_subGridDesired sub-grid.
Returns:
SUCCESSFUL_RETURN,
RET_INVALID_ARGUMENTS

References ACADOERROR, acadoIsGreater(), acadoIsSmaller(), BT_FALSE, BT_TRUE, Grid::getNumPoints(), Grid::getTime(), Grid::hasTime(), Grid::init(), Grid::isInInterval(), RET_INVALID_ARGUMENTS, Grid::setTime(), SUCCESSFUL_RETURN, and uint.

Referenced by ShootingMethod::evaluate(), and Curve::evaluate().

Parameters:
[out]sumComponent-wise sum over all vectors at all grid points.
Returns:
SUCCESSFUL_RETURN

References Grid::getNumPoints(), getVector(), VectorspaceElement::setZero(), SUCCESSFUL_RETURN, and uint.

double Grid::getTime ( uint  pointIdx) const [inline, inherited]
Grid MatrixVariablesGrid::getTimePoints ( ) const [inline, inherited]
Note:
This routine is only introduced for user-convenience and should not be used by developers aiming for maximum efficiency. Use routine getGrid() instead if efficiency is crucial.
Returns:
SUCCESSFUL_RETURN

References MatrixVariablesGrid::getGrid().

Referenced by Actuator::getDelayedInputGrids(), Sensor::getDelayedOutputGrid(), OCPiterate::getGrid(), Integrator::getX(), Integrator::getXA(), and Process::simulate().

VariablesGrid VariablesGrid::getTimeSubGrid ( uint  startIdx,
uint  endIdx 
) const
Parameters:
[in]startIdxIndex of first grid point to be included in sub grid.
[in]endIdxIndex of last grid point to be included in sub grid.
Returns:
Sub grid in time

Reimplemented from MatrixVariablesGrid.

References MatrixVariablesGrid::addMatrix(), Grid::getNumPoints(), Grid::getTime(), uint, and MatrixVariablesGrid::values.

Referenced by Actuator::delayActuatorInput(), Sensor::delaySensorOutput(), PeriodicReferenceTrajectory::getReference(), StaticReferenceTrajectory::getReference(), and GnuplotWindow::sendDataToGnuplot().

VariablesGrid VariablesGrid::getTimeSubGrid ( double  startTime,
double  endTime 
) const
Parameters:
[in]startTimeTime of first grid point to be included in sub grid.
[in]endTimeTime of last grid point to be included in sub grid.
Returns:
Sub grid in time

References MatrixVariablesGrid::addMatrix(), BT_FALSE, Grid::getCeilIndex(), Grid::getFloorIndex(), Grid::getNumPoints(), Grid::getTime(), Grid::hasTime(), Grid::isInInterval(), uint, and MatrixVariablesGrid::values.

VariableType MatrixVariablesGrid::getType ( ) const [inline, inherited]
VariableType MatrixVariablesGrid::getType ( uint  pointIdx) const [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
Returns:
Variable type of MatrixVariable at grid point with given index

References Grid::getNumPoints(), VariableSettings::getType(), MatrixVariablesGrid::values, and VT_UNKNOWN.

returnValue MatrixVariablesGrid::getUnit ( uint  pointIdx,
uint  idx,
char *const  _unit 
) const [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]idxIndex of component.
[out]_unitUnit label of given component at given grid point.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS,
RET_MEMBER_NOT_INITIALISED

References ACADOERROR, Grid::getNumPoints(), VariableSettings::getUnit(), RET_INDEX_OUT_OF_BOUNDS, and MatrixVariablesGrid::values.

double MatrixVariablesGrid::getUpperBound ( uint  pointIdx,
uint  valueIdx 
) const [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]valueIdxIndex of component.
Returns:
> -INFTY: Upper bound of given component of MatrixVariable at given grid point,
-INFTY: Index out of bounds

References Grid::getNumPoints(), VariableSettings::getUpperBound(), INFTY, and MatrixVariablesGrid::values.

Referenced by initializeFromBounds(), ExportGaussNewtonCN2::setupConstraintsEvaluation(), and ExportGaussNewtonCondensed::setupConstraintsEvaluation().

VectorspaceElement MatrixVariablesGrid::getUpperBounds ( uint  pointIdx) const [inline, inherited]
VariablesGrid VariablesGrid::getValuesSubGrid ( uint  startIdx,
uint  endIdx 
) const

It comprises all grid points of the object, but comprises at each grid point only the compenents starting and ending at given indices.

Parameters:
[in]startIdxIndex of first compenent to be included in sub grid.
[in]endIdxIndex of last compenent to be included in sub grid.
Note:
This function implicitly assumes that vectors at all grid points have same number of components (or at least more than 'endIdx').
Returns:
Sub grid of values

Reimplemented from MatrixVariablesGrid.

References MatrixVariablesGrid::addMatrix(), Grid::getNumPoints(), MatrixVariablesGrid::getNumValues(), MatrixVariable::getRows(), Grid::getTime(), uint, and MatrixVariablesGrid::values.

Referenced by Actuator::addActuatorNoise(), and Sensor::addSensorNoise().

Vector VariablesGrid::getVector ( uint  pointIdx) const
BooleanType MatrixVariablesGrid::hasLowerBounds ( ) const [inline, inherited]
Returns:
BT_TRUE iff MatrixVariablesGrid comprises lower bounds,
BT_FALSE otherwise

References BT_FALSE, BT_TRUE, Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.

Referenced by OCPiterate::update().

BooleanType MatrixVariablesGrid::hasNames ( ) const [inline, inherited]
Returns:
BT_TRUE iff MatrixVariablesGrid comprises name labels,
BT_FALSE otherwise

References BT_FALSE, BT_TRUE, Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.

BooleanType MatrixVariablesGrid::hasScaling ( ) const [inline, inherited]
Returns:
BT_TRUE iff scaling is set,
BT_FALSE otherwise

References BT_FALSE, BT_TRUE, Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.

BooleanType Grid::hasTime ( double  _time) const [inherited]
Parameters:
[in]_timeTime point to be checked for existence.
Returns:
BT_TRUE iff grid contains given time point,
BT_FALSE otherwise

References BT_FALSE, BT_TRUE, and Grid::findTime().

Referenced by MatrixVariablesGrid::getRefinedGrid(), Grid::getSubGrid(), getTimeSubGrid(), and OCPiterate::update().

BooleanType MatrixVariablesGrid::hasUnits ( ) const [inline, inherited]
Returns:
BT_TRUE iff MatrixVariablesGrid comprises unit labels,
BT_FALSE otherwise

References BT_FALSE, BT_TRUE, Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.

BooleanType MatrixVariablesGrid::hasUpperBounds ( ) const [inline, inherited]
Returns:
BT_TRUE iff MatrixVariablesGrid comprises upper bounds,
BT_FALSE otherwise

References BT_FALSE, BT_TRUE, Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.

Referenced by OCPiterate::update().

returnValue Grid::init ( uint  _nPoints = 0,
const double *const  _times = 0 
) [inherited]
returnValue Grid::init ( const Vector times_) [inherited]
Parameters:
[in]timesInitialization of times.
Returns:
SUCCESSFUL_RETURN

References VectorspaceElement::getDim(), Grid::nPoints, SUCCESSFUL_RETURN, Grid::times, and uint.

returnValue Grid::init ( double  _firstTime,
double  _lastTime,
uint  _nPoints = 2 
) [inherited]
Parameters:
[in]_firstTimeTime of first grid point.
[in]_lastTimeTime of last grid point.
[in]_nPointsNumber of grid points.
Returns:
SUCCESSFUL_RETURN

References Grid::nPoints, Grid::setupEquidistant(), and Grid::times.

returnValue Grid::init ( const Grid rhs) [inherited]
Parameters:
[in]rhsGrid to be taken for initialization.
Note:
This routine is introduced only for convenience and is equivalent to the assignment operator.
Returns:
SUCCESSFUL_RETURN

References Grid::operator=(), and SUCCESSFUL_RETURN.

returnValue MatrixVariablesGrid::init ( uint  _nRows,
uint  _nCols,
const Grid _grid,
VariableType  _type = VT_UNKNOWN,
const char **const  _names = 0,
const char **const  _units = 0,
const VectorspaceElement *const  _scaling = 0,
const VectorspaceElement *const  _lb = 0,
const VectorspaceElement *const  _ub = 0,
const BooleanType *const  _autoInit = 0 
) [inherited]

Further information can optionally be specified.

Parameters:
[in]_nRowsNumber of rows of each matrix.
[in]_nColsNumber of columns of each matrix.
[in]_gridGrid on which the MatrixVariable(s) are defined.
[in]_typeType of the variable(s).
[in]_namesArray containing name labels for each component of the variable(s).
[in]_unitsArray containing unit labels for each component of the variable(s).
[in]_scalingArray containing the scaling for each component of the variable(s).
[in]_lbArray containing lower bounds for each component of the variable(s).
[in]_ubArray containing upper bounds for each component of the variable(s).
[in]_autoInitArray defining if each component of the variable(s) is to be automatically initialized.
Returns:
SUCCESSFUL_RETURN

References MatrixVariablesGrid::clearValues(), MatrixVariablesGrid::init(), MatrixVariablesGrid::initMatrixVariables(), Grid::nPoints, and MatrixVariablesGrid::values.

returnValue VariablesGrid::init ( uint  _dim,
const Grid _grid,
VariableType  _type = VT_UNKNOWN,
const char **const  _names = 0,
const char **const  _units = 0,
const VectorspaceElement *const  _scaling = 0,
const VectorspaceElement *const  _lb = 0,
const VectorspaceElement *const  _ub = 0,
const BooleanType *const  _autoInit = 0 
)

Further information can optionally be specified.

Parameters:
[in]_dimDimension of each vector.
[in]_gridGrid on which the vector-valued MatrixVariable(s) are defined.
[in]_typeType of the variable(s).
[in]_namesArray containing names (labels) for each component of the variable(s).
[in]_unitsArray containing units for each component of the variable(s).
[in]_scalingArray containing the scaling for each component of the variable(s).
[in]_lbArray containing lower bounds for each component of the variable(s).
[in]_ubArray containing upper bounds for each component of the variable(s).
[in]_autoInitArray defining if each component of the variable(s) is to be automatically initialized.
Returns:
SUCCESSFUL_RETURN

References init().

returnValue MatrixVariablesGrid::init ( uint  _nRows,
uint  _nCols,
uint  _nPoints,
VariableType  _type = VT_UNKNOWN,
const char **const  _names = 0,
const char **const  _units = 0,
const VectorspaceElement *const  _scaling = 0,
const VectorspaceElement *const  _lb = 0,
const VectorspaceElement *const  _ub = 0,
const BooleanType *const  _autoInit = 0 
) [inherited]

Further information can optionally be specified.

Parameters:
[in]_nRowsNumber of rows of each matrix.
[in]_nColsNumber of columns of each matrix.
[in]_nPointsNumber of grid points on which the MatrixVariable(s) are defined.
[in]_typeType of the variable(s).
[in]_namesArray containing name labels for each component of the variable(s).
[in]_unitsArray containing unit labels for each component of the variable(s).
[in]_scalingArray containing the scaling for each component of the variable(s).
[in]_lbArray containing lower bounds for each component of the variable(s).
[in]_ubArray containing upper bounds for each component of the variable(s).
[in]_autoInitArray defining if each component of the variable(s) is to be automatically initialized.
Returns:
SUCCESSFUL_RETURN

References MatrixVariablesGrid::clearValues(), MatrixVariablesGrid::init(), MatrixVariablesGrid::initMatrixVariables(), Grid::nPoints, and MatrixVariablesGrid::values.

returnValue VariablesGrid::init ( uint  _dim,
uint  _nPoints,
VariableType  _type = VT_UNKNOWN,
const char **const  _names = 0,
const char **const  _units = 0,
const VectorspaceElement *const  _scaling = 0,
const VectorspaceElement *const  _lb = 0,
const VectorspaceElement *const  _ub = 0,
const BooleanType *const  _autoInit = 0 
)

Further information can optionally be specified.

Parameters:
[in]_dimDimension of each vector.
[in]_nPointsNumber of grid points on which the vector-valued MatrixVariable(s) are defined.
[in]_typeType of the variable(s).
[in]_namesArray containing names (labels) for each component of the variable(s).
[in]_unitsArray containing units for each component of the variable(s).
[in]_scalingArray containing the scaling for each component of the variable(s).
[in]_lbArray containing lower bounds for each component of the variable(s).
[in]_ubArray containing upper bounds for each component of the variable(s).
[in]_autoInitArray defining if each component of the variable(s) is to be automatically initialized.
Returns:
SUCCESSFUL_RETURN

References init().

returnValue MatrixVariablesGrid::init ( uint  _nRows,
uint  _nCols,
double  _firstTime,
double  _lastTime,
uint  _nPoints,
VariableType  _type = VT_UNKNOWN,
const char **const  _names = 0,
const char **const  _units = 0,
const VectorspaceElement *const  _scaling = 0,
const VectorspaceElement *const  _lb = 0,
const VectorspaceElement *const  _ub = 0,
const BooleanType *const  _autoInit = 0 
) [inherited]

Moreover, it takes the time of the first and the last grid point; all intermediate grid points are setup to form a equidistant grid of time points. Further information can optionally be specified.

Parameters:
[in]_nRowsNumber of rows of each matrix.
[in]_nColsNumber of columns of each matrix.
[in]_firstTimeTime of first grid point.
[in]_lastTimeTime of last grid point.
[in]_nPointsNumber of grid points on which the MatrixVariable(s) are defined.
[in]_typeType of the variable(s).
[in]_namesArray containing name labels for each component of the variable(s).
[in]_unitsArray containing unit labels for each component of the variable(s).
[in]_scalingArray containing the scaling for each component of the variable(s).
[in]_lbArray containing lower bounds for each component of the variable(s).
[in]_ubArray containing upper bounds for each component of the variable(s).
[in]_autoInitArray defining if each component of the variable(s) is to be automatically initialized.
Returns:
SUCCESSFUL_RETURN

References MatrixVariablesGrid::clearValues(), MatrixVariablesGrid::init(), MatrixVariablesGrid::initMatrixVariables(), Grid::nPoints, and MatrixVariablesGrid::values.

returnValue VariablesGrid::init ( uint  _dim,
double  _firstTime,
double  _lastTime,
uint  _nPoints,
VariableType  _type = VT_UNKNOWN,
const char **const  _names = 0,
const char **const  _units = 0,
const VectorspaceElement *const  _scaling = 0,
const VectorspaceElement *const  _lb = 0,
const VectorspaceElement *const  _ub = 0,
const BooleanType *const  _autoInit = 0 
)

Moreover, it takes the time of the first and the last grid point; all intermediate grid points are setup to form a equidistant grid of time points. Further information can optionally be specified.

Parameters:
[in]_dimDimension of each vector.
[in]_firstTimeTime of first grid point.
[in]_lastTimeTime of last grid point.
[in]_nPointsNumber of grid points on which the vector-valued MatrixVariable(s) are defined.
[in]_typeType of the variable(s).
[in]_namesArray containing names (labels) for each component of the variable(s).
[in]_unitsArray containing units for each component of the variable(s).
[in]_scalingArray containing the scaling for each component of the variable(s).
[in]_lbArray containing lower bounds for each component of the variable(s).
[in]_ubArray containing upper bounds for each component of the variable(s).
[in]_autoInitArray defining if each component of the variable(s) is to be automatically initialized.
Returns:
SUCCESSFUL_RETURN

References init().

returnValue MatrixVariablesGrid::init ( const Matrix arg,
const Grid _grid = trivialGrid,
VariableType  _type = VT_UNKNOWN 
) [inherited]

At each grid point, the MatrixVariable is constructed from the matrix passed.

Parameters:
[in]argMatrix to be assign at each point of the grid.
[in]_gridGrid on which the MatrixVariable(s) are defined.
[in]_typeType of the variable(s).
Returns:
SUCCESSFUL_RETURN

References MatrixVariablesGrid::clearValues(), Grid::nPoints, MatrixVariablesGrid::operator=(), SUCCESSFUL_RETURN, uint, and MatrixVariablesGrid::values.

returnValue VariablesGrid::init ( const Vector arg,
const Grid _grid = trivialGrid,
VariableType  _type = VT_UNKNOWN 
)

At each grid point, the vector-valued MatrixVariable is constructed from the matrix passed.

Parameters:
[in]argVector to be assign at each point of the grid.
[in]_gridGrid on which the vector-valued MatrixVariable(s) are defined.
[in]_typeType of the variable(s).
Returns:
SUCCESSFUL_RETURN

References init().

If one of these bounds is infinity it is initialized with the bound. If both bounds are infinity it is initialized with 0. This routine is only for internal use by the OptimizationAlgorithm, that is a friend of this class.

Returns:
SUCCESSFUL_RETURN

References fabs(), MatrixVariablesGrid::getLowerBound(), Grid::getNumPoints(), MatrixVariablesGrid::getNumValues(), MatrixVariablesGrid::getUpperBound(), INFTY, operator()(), SUCCESSFUL_RETURN, and uint.

Referenced by OptimizationAlgorithmBase::initializeOCPiterate().

returnValue MatrixVariablesGrid::initMatrixVariables ( uint  _nRows,
uint  _nCols,
VariableType  _type = VT_UNKNOWN,
const char **const  _names = 0,
const char **const  _units = 0,
const VectorspaceElement *const  _scaling = 0,
const VectorspaceElement *const  _lb = 0,
const VectorspaceElement *const  _ub = 0,
const BooleanType *const  _autoInit = 0 
) [protected, inherited]

Note that this function assumes that the grid has already been setup.

Parameters:
[in]_nRowsNumber of rows of each matrix.
[in]_nColsNumber of columns of each matrix.
[in]_typeType of the variable(s).
[in]_namesArray containing names (labels) for each component of the variable(s).
[in]_unitsArray containing units for each component of the variable(s).
[in]_scalingArray containing the scaling for each component of the variable(s).
[in]_lbArray containing lower bounds for each component of the variable(s).
[in]_ubArray containing upper bounds for each component of the variable(s).
[in]_autoInitArray defining if each component of the variable(s) is to be automatically initialized.
Returns:
SUCCESSFUL_RETURN

References VectorspaceElement::init(), Grid::nPoints, SUCCESSFUL_RETURN, uint, and MatrixVariablesGrid::values.

Referenced by MatrixVariablesGrid::init().

BooleanType Grid::isEmpty ( ) const [inline, inherited]
BooleanType Grid::isEquidistant ( ) const [inline, inherited]
Returns:
BT_TRUE iff grid is equidistant,
BT_FALSE otherwise

References acadoIsEqual(), BT_FALSE, BT_TRUE, Grid::getIntervalLength(), Grid::getNumIntervals(), and uint.

Referenced by ModelData::setIntegrationGrid().

BooleanType Grid::isInInterval ( double  _time) const [inline, inherited]
Parameters:
[in]_timeTime point to be checked.
Returns:
BT_TRUE iff time within total interval,
BT_FALSE otherwise

References acadoIsGreater(), acadoIsSmaller(), BT_FALSE, BT_TRUE, Grid::getLastIndex(), Grid::getTime(), and Grid::times.

Referenced by Grid::getSubGrid(), getTimeSubGrid(), Grid::merge(), merge(), and MatrixVariablesGrid::merge().

BooleanType Grid::isInInterval ( uint  pointIdx,
double  _time 
) const [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point at beginning of interval.
[in]_timeTime point to be checked.
Returns:
BT_TRUE iff time within interval,
BT_FALSE otherwise

References ACADOERROR, acadoIsGreater(), acadoIsSmaller(), BT_FALSE, BT_TRUE, Grid::getLastIndex(), Grid::getNumPoints(), Grid::getTime(), RET_INDEX_OUT_OF_BOUNDS, Grid::times, and uint.

BooleanType Grid::isInLowerHalfOpenInterval ( uint  pointIdx,
double  _time 
) const [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point at beginning of interval.
[in]_timeTime point to be checked.
Returns:
BT_TRUE iff time within interval,
BT_FALSE otherwise

References ACADOERROR, acadoIsGreater(), acadoIsStrictlySmaller(), BT_FALSE, BT_TRUE, Grid::getNumPoints(), Grid::getTime(), RET_INDEX_OUT_OF_BOUNDS, Grid::times, and uint.

Referenced by Grid::getCeilIndex().

BooleanType Grid::isInUpperHalfOpenInterval ( uint  pointIdx,
double  _time 
) const [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point at beginning of interval.
[in]_timeTime point to be checked.
Returns:
BT_TRUE iff time within interval,
BT_FALSE otherwise

References ACADOERROR, acadoIsSmaller(), acadoIsStrictlyGreater(), BT_FALSE, BT_TRUE, Grid::getLastIndex(), Grid::getNumPoints(), Grid::getTime(), RET_INDEX_OUT_OF_BOUNDS, Grid::times, and uint.

Referenced by Grid::getFloorIndex().

BooleanType Grid::isLast ( uint  pointIdx) const [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
Returns:
BT_TRUE iff given index is the last one,
BT_FALSE otherwise

References BT_FALSE, BT_TRUE, and Grid::getLastIndex().

Vector MatrixVariablesGrid::linearInterpolation ( double  time) const [inherited]

If given time lies in between two grid points, the value of the vector will be determined by linear interpolation between these grid points. If given time is smaller than the smallest time of the grid, the value of the first grid point will be returned. Analoguosly, if given time is larger than the largest time of the grid, the vector at the last grid point will be returned.

Parameters:
[in]timeTime for evaluation.
Returns:
Vector with interpolated values at given time

References ASSERT, fabs(), Grid::getCeilIndex(), Grid::getFloorIndex(), Grid::getNumPoints(), Grid::getTime(), SQRT_EPS, uint, and MatrixVariablesGrid::values.

Referenced by Constraint::add(), and OptimizationAlgorithmBase::initializeOCPiterate().

returnValue Grid::merge ( const Grid arg,
MergeMethod  _mergeMethod = MM_DUPLICATE,
BooleanType  keepOverlap = BT_TRUE 
) [inherited]

A merge method defines the way duplicate entries are handled. Moreover, it can be specified whether an overlap in time of both grids shall be kept or if only the entries of one of them shall be kept according to the merge method.

Parameters:
[in]argGrid to append.
[in]_mergeMethodMerge method, see documentation of MergeMethod for details.
[in]keepOverlapFlag indicating whether overlap shall be kept.
Returns:
SUCCESSFUL_RETURN,
RET_INVALID_ARGUMENTS

References ACADOERROR, acadoIsEqual(), acadoIsStrictlyGreater(), acadoIsStrictlySmaller(), Grid::addTime(), BT_FALSE, BT_TRUE, Grid::getLastTime(), Grid::getNumPoints(), Grid::getTime(), Grid::isInInterval(), MM_DUPLICATE, MM_KEEP, MM_REPLACE, RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, and uint.

Referenced by Sensor::addSensorNoise(), Sensor::getDelayedOutputGrid(), and Grid::operator&().

returnValue VariablesGrid::merge ( const VariablesGrid arg,
MergeMethod  _mergeMethod = MM_DUPLICATE,
BooleanType  keepOverlap = BT_TRUE 
)

A merge method defines the way duplicate entries are handled. Moreover, it can be specified whether an overlap in time of both grids shall be kept or if only the entries of one of them shall be kept according to the merge method.

Parameters:
[in]argGrid to append.
[in]_mergeMethodMerge method, see documentation of MergeMethod for details.
[in]keepOverlapFlag indicating whether overlap shall be kept.
Returns:
SUCCESSFUL_RETURN,
RET_INVALID_ARGUMENTS

References ACADOERROR, acadoIsEqual(), acadoIsSmaller(), acadoIsStrictlyGreater(), acadoIsStrictlySmaller(), MatrixVariablesGrid::addMatrix(), appendTimes(), BT_FALSE, BT_TRUE, Grid::getFirstTime(), Grid::getLastTime(), Grid::getNumPoints(), Grid::getTime(), Grid::isInInterval(), MM_DUPLICATE, MM_KEEP, MM_REPLACE, RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, uint, and MatrixVariablesGrid::values.

Referenced by Actuator::getDelayedInputGrids(), and Sensor::getDelayedOutputGrid().

returnValue MatrixVariablesGrid::merge ( const MatrixVariablesGrid arg,
MergeMethod  _mergeMethod = MM_DUPLICATE,
BooleanType  keepOverlap = BT_TRUE 
) [inherited]

A merge method defines the way duplicate entries are handled. Moreover, it can be specified whether an overlap in time of both grids shall be kept or if only the entries of one of them shall be kept according to the merge method.

Parameters:
[in]argGrid to append.
[in]_mergeMethodMerge method, see documentation of MergeMethod for details.
[in]keepOverlapFlag indicating whether overlap shall be kept.
Returns:
SUCCESSFUL_RETURN,
RET_INVALID_ARGUMENTS

References ACADOERROR, acadoIsEqual(), acadoIsSmaller(), acadoIsStrictlyGreater(), acadoIsStrictlySmaller(), MatrixVariablesGrid::addMatrix(), MatrixVariablesGrid::appendTimes(), BT_FALSE, BT_TRUE, Grid::getFirstTime(), Grid::getLastTime(), Grid::getNumPoints(), Grid::getTime(), Grid::isInInterval(), MM_DUPLICATE, MM_KEEP, MM_REPLACE, RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, uint, and MatrixVariablesGrid::values.

BooleanType Grid::operator!= ( const Grid arg) const [inline, inherited]
Parameters:
[in]rhsObject of comparison.
Returns:
BT_TRUE iff both objects are not equal (in the above-mentioned sense),
BT_FALSE otherwise

References BT_FALSE, and BT_TRUE.

Grid & Grid::operator& ( const Grid arg) [inherited]
Parameters:
[in]argRight-hand side object.
Returns:
Set union of two grids

References BT_TRUE, Grid::merge(), and MM_KEEP.

BEGIN_NAMESPACE_ACADO double & MatrixVariablesGrid::operator() ( uint  pointIdx,
uint  rowIdx,
uint  colIdx 
) [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]rowIdxRow index of the component to be returned.
[in]colIdxColumn index of the component to be returned.
Returns:
Value of component 'valueIdx' at grid point 'pointIdx'

References ASSERT, Grid::getNumPoints(), and MatrixVariablesGrid::values.

Referenced by MatrixVariablesGrid::sprintf().

BEGIN_NAMESPACE_ACADO double & VariablesGrid::operator() ( uint  pointIdx,
uint  rowIdx 
) [inline]
Parameters:
[in]pointIdxIndex of grid point.
[in]rowIdxRow index of the component to be returned.
Returns:
Value of component 'rowIdx' at grid point 'pointIdx'

Referenced by getIntegral(), initializeFromBounds(), and operator()().

double MatrixVariablesGrid::operator() ( uint  pointIdx,
uint  rowIdx,
uint  colIdx 
) const [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]rowIdxRow index of the component to be returned.
[in]colIdxColumn index of the component to be returned.
Returns:
Value of component 'valueIdx' at grid point 'pointIdx'

References ASSERT, Grid::getNumPoints(), and MatrixVariablesGrid::values.

double VariablesGrid::operator() ( uint  pointIdx,
uint  rowIdx 
) const [inline]
Parameters:
[in]pointIdxIndex of grid point.
[in]rowIdxRow index of the component to be returned.
Returns:
Value of component 'rowIdx' at grid point 'pointIdx'

References operator()().

VariablesGrid VariablesGrid::operator() ( const uint  rowIdx) const
Parameters:
[in]rowIdxRow index of the component to be returned.
Returns:
VariablesGrid consisting only of the given row

Reimplemented from MatrixVariablesGrid.

References ACADOERROR, ASSERT, MatrixVariablesGrid::getGrid(), Grid::getNumPoints(), MatrixVariablesGrid::getNumRows(), MatrixVariablesGrid::getType(), RET_INDEX_OUT_OF_BOUNDS, uint, MatrixVariablesGrid::values, and VariablesGrid().

MatrixVariablesGrid MatrixVariablesGrid::operator+ ( const MatrixVariablesGrid arg) const [inline, inherited]
Parameters:
[in]argSecond summand.
Returns:
Temporary object containing sum of MatrixVariablesGrids.

References ASSERT, Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.

VariablesGrid VariablesGrid::operator+ ( const VariablesGrid arg) const [inline]
Parameters:
[in]argSecond summand.
Returns:
Temporary object containing sum of VariablesGrids.
MatrixVariablesGrid & MatrixVariablesGrid::operator+= ( const MatrixVariablesGrid arg) [inline, inherited]
Parameters:
[in]argSecond summand.
Returns:
Reference to object after addition

References ASSERT, Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.

VariablesGrid & VariablesGrid::operator+= ( const VariablesGrid arg) [inline]
Parameters:
[in]argSecond summand.
Returns:
Reference to object after addition
MatrixVariablesGrid MatrixVariablesGrid::operator- ( const MatrixVariablesGrid arg) const [inline, inherited]
Parameters:
[in]argSubtrahend.
Returns:
Temporary object containing the difference of the MatrixVariablesGrids

References ASSERT, Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.

VariablesGrid VariablesGrid::operator- ( const VariablesGrid arg) const [inline]
Parameters:
[in]argSubtrahend.
Returns:
Temporary object containing the difference of the VariablesGrids
MatrixVariablesGrid & MatrixVariablesGrid::operator-= ( const MatrixVariablesGrid arg) [inline, inherited]
Parameters:
[in]argSubtrahend.
Returns:
Reference to object after subtraction

References ASSERT, Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.

VariablesGrid & VariablesGrid::operator-= ( const VariablesGrid arg) [inline]
Parameters:
[in]argSubtrahend.
Returns:
Reference to object after subtraction
BooleanType Grid::operator< ( const Grid arg) const [inline, inherited]

if each the rhs grid contains all time points of the lhs (but is not equal).

Parameters:
[in]rhsObject of comparison.
Returns:
BT_TRUE iff left object is a strict subset of the right one,
BT_FALSE otherwise

References BT_FALSE, BT_TRUE, Grid::findTime(), Grid::getNumPoints(), Grid::times, and uint.

BooleanType Grid::operator<= ( const Grid arg) const [inline, inherited]

if each the rhs grid contains all time points of the lhs.

Parameters:
[in]rhsObject of comparison.
Returns:
BT_TRUE iff left object is a subset of the right one,
BT_FALSE otherwise

References BT_FALSE, and BT_TRUE.

VariablesGrid & VariablesGrid::operator= ( const VariablesGrid rhs)
Parameters:
[in]rhsRight-hand side object.

Referenced by operator=().

VariablesGrid & VariablesGrid::operator= ( const MatrixVariablesGrid rhs)
Parameters:
[in]rhsRight-hand side object.

Reimplemented from MatrixVariablesGrid.

References ASSERT, MatrixVariablesGrid::getNumCols(), and operator=().

VariablesGrid & VariablesGrid::operator= ( FILE *  rhs)

The data is expected to be in matrix format and is interpreted as follows: the first entry of each row is taken as time of the grid point to be added, all remaining entries of each row are taken as numerical values of a vector-valued MatrixVariable with exactly one column. In effect, a MatrixVariablesGrid consisting of <number of columns - 1>-by-1 MatrixVariables defined on <number of="" rows>=""> grid points is setup. Note that all rows are expected to have equal number of columns.

Parameters:
[in]rhsFile to be read.
Note:
The file is closed at the end of routine.

Reimplemented from MatrixVariablesGrid.

References operator=().

VariablesGrid & VariablesGrid::operator= ( const Matrix rhs)

The data is interpreted as follows: the first entry of each row is taken as time of the grid point to be added, all remaining entries of each row are taken as numerical values of a vector-valued MatrixVariable with exactly one column. In effect, a MatrixVariablesGrid consisting of <number of columns - 1>-by-1 MatrixVariables defined on <number of="" rows>=""> grid points is setup.

Parameters:
[in]rhsMatrix to be read.
Note:
The file is closed at the end of routine.

Reimplemented from MatrixVariablesGrid.

References operator=().

BEGIN_NAMESPACE_ACADO BooleanType Grid::operator== ( const Grid arg) const [inline, inherited]

if number of grid points AND time values at all grid points are equal.

Parameters:
[in]rhsObject of comparison.
Returns:
BT_TRUE iff both objects are equal,
BT_FALSE otherwise

References acadoIsEqual(), BT_FALSE, BT_TRUE, Grid::getNumPoints(), Grid::getTime(), and uint.

BooleanType VariablesGrid::operator== ( const VariablesGrid arg) const [inline]
Parameters:
[in]rhsObject of comparison.
Returns:
BT_TRUE iff both objects are equal,
BT_FALSE otherwise

References BT_FALSE, BT_TRUE, MatrixVariablesGrid::getMatrix(), Grid::getNumPoints(), and uint.

BooleanType Grid::operator> ( const Grid arg) const [inline, inherited]

if each the lhs grid contains all time points of the rhs (but is not equal).

Parameters:
[in]rhsObject of comparison.
Returns:
BT_TRUE iff right object is a strict subset of the left one,
BT_FALSE otherwise

References BT_FALSE, BT_TRUE, Grid::findTime(), Grid::getNumPoints(), Grid::times, and uint.

BooleanType Grid::operator>= ( const Grid arg) const [inline, inherited]

if each the lhs grid contains all time points of the rhs.

Parameters:
[in]rhsObject of comparison.
Returns:
BT_TRUE iff right object is a subset of the left one,
BT_FALSE otherwise

References BT_FALSE, and BT_TRUE.

VariablesGrid VariablesGrid::operator[] ( const uint  pointIdx) const
Parameters:
[in]pointIdxIndex of grid point.
Returns:
VariablesGrid consisting only of the values at given grid point

Reimplemented from MatrixVariablesGrid.

References ACADOERROR, MatrixVariablesGrid::addMatrix(), ASSERT, Grid::getNumPoints(), Grid::getTime(), RET_INVALID_ARGUMENTS, MatrixVariablesGrid::values, and VariablesGrid().

returnValue Grid::print ( ) const [inherited]
Returns:
SUCCESSFUL_RETURN

References acadoPrintf(), Grid::getNumPoints(), Grid::getTime(), SUCCESSFUL_RETURN, and uint.

returnValue MatrixVariablesGrid::print ( 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 [inherited]

Various settings can be specified defining its output format.

Parameters:
[in]nameName label to be printed before the numerical values.
[in]startStringPrefix before printing the numerical values.
[in]endStringSuffix after printing the numerical values.
[in]widthTotal number of digits per single numerical value.
[in]precisionNumber of decimals per single numerical value.
[in]colSeparatorSeparator between the columns of the numerical values.
[in]rowSeparatorSeparator between the rows of the numerical values.
Returns:
SUCCESSFUL_RETURN,
RET_UNKNOWN_BUG

References acadoPrintf(), MatrixVariablesGrid::printToString(), and SUCCESSFUL_RETURN.

Referenced by Controller::feedbackStep(), Controller::init(), Controller::preparationStep(), and OCPiterate::print().

returnValue MatrixVariablesGrid::print ( const char *const  name,
PrintScheme  printScheme 
) const [inherited]

Various settings can be specified defining its output format.

Parameters:
[in]nameName label to be printed before the numerical values.
[in]printSchemePrint scheme defining the output format of the information.
Returns:
SUCCESSFUL_RETURN,
RET_UNKNOWN_BUG

References acadoPrintf(), MatrixVariablesGrid::printToString(), and SUCCESSFUL_RETURN.

returnValue MatrixVariablesGrid::printToFile ( const char *const  filename,
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 [inherited]

Various settings can be specified defining its output format.

Parameters:
[in]filenameFilename for printing.
[in]nameName label to be printed before the numerical values.
[in]startStringPrefix before printing the numerical values.
[in]endStringSuffix after printing the numerical values.
[in]widthTotal number of digits per single numerical value.
[in]precisionNumber of decimals per single numerical value.
[in]colSeparatorSeparator between the columns of the numerical values.
[in]rowSeparatorSeparator between the rows of the numerical values.
Returns:
SUCCESSFUL_RETURN,
RET_UNKNOWN_BUG

References ACADOERROR, RET_FILE_CAN_NOT_BE_OPENED, and SUCCESSFUL_RETURN.

Referenced by operator<<(), and MatrixVariablesGrid::printToFile().

returnValue MatrixVariablesGrid::printToFile ( FILE *  file,
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 [inherited]

Various settings can be specified defining its output format.

Parameters:
[in]fileFile for printing.
[in]nameName label to be printed before the numerical values.
[in]startStringPrefix before printing the numerical values.
[in]endStringSuffix after printing the numerical values.
[in]widthTotal number of digits per single numerical value.
[in]precisionNumber of decimals per single numerical value.
[in]colSeparatorSeparator between the columns of the numerical values.
[in]rowSeparatorSeparator between the rows of the numerical values.
Returns:
SUCCESSFUL_RETURN,
RET_FILE_CAN_NOT_BE_OPENED,
RET_UNKNOWN_BUG

References acadoFPrintf(), MatrixVariablesGrid::printToString(), and SUCCESSFUL_RETURN.

returnValue MatrixVariablesGrid::printToFile ( const char *const  filename,
const char *const  name,
PrintScheme  printScheme 
) const [inherited]

Various settings can be specified defining its output format.

Parameters:
[in]filenameFilename for printing.
[in]nameName label to be printed before the numerical values.
[in]printSchemePrint scheme defining the output format of the information.
Returns:
SUCCESSFUL_RETURN,
RET_FILE_CAN_NOT_BE_OPENED,
RET_UNKNOWN_BUG

References ACADOERROR, MatFile::close(), MatFile::open(), MatrixVariablesGrid::printToFile(), PS_MATLAB_BINARY, RET_FILE_CAN_NOT_BE_OPENED, SUCCESSFUL_RETURN, and MatFile::write().

returnValue MatrixVariablesGrid::printToFile ( FILE *  file,
const char *const  name,
PrintScheme  printScheme 
) const [inherited]

Various settings can be specified defining its output format.

Parameters:
[in]filenFile for printing.
[in]nameName label to be printed before the numerical values.
[in]printSchemePrint scheme defining the output format of the information.
Returns:
SUCCESSFUL_RETURN,
RET_FILE_CAN_NOT_BE_OPENED,
RET_UNKNOWN_BUG

References acadoFPrintf(), MatrixVariablesGrid::printToString(), and SUCCESSFUL_RETURN.

returnValue MatrixVariablesGrid::printToString ( char **  string,
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 [virtual, inherited]

Various settings can be specified defining its output format.

Parameters:
[in,out]stringFile for printing.
[in]nameName label to be printed before the numerical values.
[in]startStringPrefix before printing the numerical values.
[in]endStringSuffix after printing the numerical values.
[in]widthTotal number of digits per single numerical value.
[in]precisionNumber of decimals per single numerical value.
[in]colSeparatorSeparator between the columns of the numerical values.
[in]rowSeparatorSeparator between the rows of the numerical values.
Note:
It is assumed that no memory is allocated to the 'string' pointer when calling.
Returns:
SUCCESSFUL_RETURN,
RET_FILE_CAN_NOT_BE_OPENED,
RET_INVALID_ARGUMENTS,
RET_UNKNOWN_BUG

References ACADOERROR, MatrixVariablesGrid::determineStringLength(), Grid::getNumPoints(), getStringLength(), Grid::getTime(), Matrix::printToString(), RET_INVALID_ARGUMENTS, RET_UNKNOWN_BUG, MatrixVariablesGrid::sprintf(), SUCCESSFUL_RETURN, uint, and MatrixVariablesGrid::values.

Referenced by MatrixVariablesGrid::print(), MatrixVariablesGrid::printToFile(), and MatrixVariablesGrid::printToString().

returnValue MatrixVariablesGrid::printToString ( char **  string,
const char *const  name,
PrintScheme  printScheme 
) const [virtual, inherited]

Various settings can be specified defining its output format.

Parameters:
[in,out]stringFile for printing.
[in]nameName label to be printed before the numerical values.
[in]printSchemePrint scheme defining the output format of the information.
Note:
It is assumed that no memory is allocated to the 'string' pointer when calling.
Returns:
SUCCESSFUL_RETURN,
RET_FILE_CAN_NOT_BE_OPENED,
RET_INVALID_ARGUMENTS,
RET_UNKNOWN_BUG
Parameters:
stringOutput: String

References getGlobalStringDefinitions(), MatrixVariablesGrid::printToString(), SUCCESSFUL_RETURN, and uint.

returnValue Grid::refineGrid ( uint  factor) [inherited]
Parameters:
[in]factorRefinement factor.
Returns:
SUCCESSFUL_RETURN,
RET_INVALID_ARGUMENTS

References ACADOERROR, Grid::getIntervalLength(), Grid::getLastTime(), Grid::getNumIntervals(), Grid::getTime(), Grid::nPoints, RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, Grid::times, and uint.

For doing so, the given grid has to be a superset of the current grid. Values at newly added grid points are obtained by the (optionally) specified interpolation mode.

Parameters:
[in]argGrid to be used for refinement.
[in]modeInterpolation mode, see documentation of InterpolationMode.
Returns:
SUCCESSFUL_RETURN,
RET_INVALID_ARGUMENTS

References ACADOERROR, BT_TRUE, MatrixVariablesGrid::getRefinedGrid(), Grid::isEmpty(), RET_INVALID_ARGUMENTS, and SUCCESSFUL_RETURN.

Referenced by Actuator::addActuatorNoise(), Sensor::addSensorNoise(), Actuator::getDelayedInputGrids(), Sensor::getDelayedOutputGrid(), PlotWindow::getExpressionDataGrids(), and Process::step().

returnValue Grid::scaleTimes ( double  scaling) [inherited]
Parameters:
[in]scalingPositive scaling factor.
Returns:
SUCCESSFUL_RETURN,
RET_INVALID_ARGUMENTS

References acadoIsStrictlyGreater(), ACADOWARNING, BT_FALSE, Grid::nPoints, RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, Grid::times, and uint.

Referenced by ShootingMethod::rescale().

returnValue MatrixVariablesGrid::setAll ( double  _value) [inline, inherited]
Parameters:
[in]_valueNew value.
Returns:
SUCCESSFUL_RETURN

References Grid::getNumPoints(), SUCCESSFUL_RETURN, uint, and MatrixVariablesGrid::values.

Referenced by ShootingMethod::evaluate(), Expression::operator<=(), and Expression::operator>=().

returnValue MatrixVariablesGrid::setAllMatrices ( const Matrix _values) [inherited]
Parameters:
[in]_valueNew matrix.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS

References ACADO_TRY, Grid::getNumPoints(), MatrixVariablesGrid::setMatrix(), SUCCESSFUL_RETURN, and uint.

Parameters:
[in]_valueNew vector.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS,
RET_VECTOR_DIMENSION_MISMATCH

References ACADO_TRY, Grid::getNumPoints(), setVector(), SUCCESSFUL_RETURN, and uint.

Referenced by RealTimeAlgorithm::initializeNlpSolver(), OptimizationAlgorithmBase::initializeOCPiterate(), and ShootingMethod::logTrajectory().

returnValue MatrixVariablesGrid::setAutoInit ( uint  pointIdx,
BooleanType  _autoInit 
) [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]_autoInitNew auto initialization flag.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS

References ACADOERROR, Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, VariableSettings::setAutoInit(), and MatrixVariablesGrid::values.

Referenced by MatrixVariablesGrid::disableAutoInit(), MatrixVariablesGrid::enableAutoInit(), and OptimizationAlgorithmBase::initializeOCPiterate().

returnValue MatrixVariablesGrid::setLowerBound ( uint  pointIdx,
uint  valueIdx,
double  _lb 
) [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]valueIdxIndex of component.
[in]_lbNew lower bound.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS

References ACADOERROR, MatrixVariablesGrid::getDim(), Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, VariableSettings::setLowerBound(), SUCCESSFUL_RETURN, and MatrixVariablesGrid::values.

Referenced by BoxConstraint::getBounds(), and PointConstraint::getBounds().

returnValue MatrixVariablesGrid::setLowerBounds ( uint  pointIdx,
const VectorspaceElement _lb 
) [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]_lbNew lower bounds.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS

References ACADOERROR, Grid::nPoints, RET_INDEX_OUT_OF_BOUNDS, VariableSettings::setLowerBounds(), and MatrixVariablesGrid::values.

returnValue MatrixVariablesGrid::setMatrix ( uint  pointIdx,
const Matrix _value 
) const [inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]_valueNew matrix.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS

References ACADOERROR, ASSERT, Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, SUCCESSFUL_RETURN, and MatrixVariablesGrid::values.

Referenced by MatrixVariablesGrid::appendTimes(), and MatrixVariablesGrid::setAllMatrices().

returnValue MatrixVariablesGrid::setName ( uint  pointIdx,
uint  idx,
const char *const  _name 
) [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]idxIndex of component.
[in]_nameNew name label of given component at given grid point.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS,
RET_MEMBER_NOT_INITIALISED

References ACADOERROR, Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, VariableSettings::setName(), and MatrixVariablesGrid::values.

returnValue MatrixVariablesGrid::setScaling ( uint  pointIdx,
const VectorspaceElement _scaling 
) [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]_scalingNew scaling.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS,
RET_INVALID_ARGUMENTS

References ACADOERROR, Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, VariableSettings::setScaling(), and MatrixVariablesGrid::values.

returnValue MatrixVariablesGrid::setScaling ( uint  pointIdx,
uint  valueIdx,
double  _scaling 
) [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]valueIdxIndex of component.
[in]_scalingNew scaling.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS,
RET_INVALID_ARGUMENTS

References ACADOERROR, MatrixVariablesGrid::getDim(), Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, VariableSettings::setScaling(), SUCCESSFUL_RETURN, and MatrixVariablesGrid::values.

returnValue Grid::setTime ( double  _time) [inherited]
returnValue Grid::setTime ( uint  pointIdx,
double  _time 
) [inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]_timeNew time.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS

References ACADOERROR, Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, SUCCESSFUL_RETURN, and Grid::times.

returnValue MatrixVariablesGrid::setType ( VariableType  _type) [inline, inherited]
returnValue MatrixVariablesGrid::setType ( uint  pointIdx,
VariableType  _type 
) [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]_typeNew type of the variable(s).
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS

References ACADOERROR, Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, VariableSettings::setType(), and MatrixVariablesGrid::values.

returnValue MatrixVariablesGrid::setUnit ( uint  pointIdx,
uint  idx,
const char *const  _unit 
) [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]idxIndex of component.
[in]_unitNew unit label of given component at given grid point.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS,
RET_MEMBER_NOT_INITIALISED

References ACADOERROR, Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, VariableSettings::setUnit(), and MatrixVariablesGrid::values.

returnValue Grid::setupEquidistant ( double  _firstTime,
double  _lastTime 
) [protected, inherited]
Parameters:
[in]_firstTimeTime of first grid point.
[in]_lastTimeTime of last grid point.

References ACADOERROR, Grid::getNumPoints(), Grid::nPoints, RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, Grid::times, and uint.

Referenced by Grid::init().

returnValue MatrixVariablesGrid::setUpperBound ( uint  pointIdx,
uint  valueIdx,
double  _ub 
) [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]valueIdxIndex of component.
[in]_ubNew upper bound.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS

References ACADOERROR, MatrixVariablesGrid::getDim(), Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, VariableSettings::setUpperBound(), SUCCESSFUL_RETURN, and MatrixVariablesGrid::values.

Referenced by BoxConstraint::getBounds(), and PointConstraint::getBounds().

returnValue MatrixVariablesGrid::setUpperBounds ( uint  pointIdx,
const VectorspaceElement _ub 
) [inline, inherited]
Parameters:
[in]pointIdxIndex of grid point.
[in]_ubNew upper bounds.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS

References ACADOERROR, Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, VariableSettings::setUpperBounds(), and MatrixVariablesGrid::values.

returnValue VariablesGrid::setVector ( uint  pointIdx,
const Vector _values 
)
Parameters:
[in]pointIdxIndex of grid point.
[in]_valueNew vector.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS,
RET_VECTOR_DIMENSION_MISMATCH
Parameters:
pointIdxIndex of the grid point.
_valuesNew values of the sub-vector.

References ACADOERROR, VectorspaceElement::getDim(), Grid::getNumPoints(), MatrixVariablesGrid::getNumRows(), RET_INDEX_OUT_OF_BOUNDS, RET_VECTOR_DIMENSION_MISMATCH, SUCCESSFUL_RETURN, and uint.

Referenced by appendTimes(), Curve::discretize(), OutputFcn::evaluate(), ShootingMethod::evaluate(), TransferDevice::init(), Process::init(), RealTimeAlgorithm::initializeNlpSolver(), Process::run(), setAllVectors(), Process::simulate(), SimulationEnvironment::step(), Process::step(), and OCPiterate::update().

returnValue MatrixVariablesGrid::setZero ( ) [inline, inherited]
Returns:
Reference to object with shifted points

References BT_FALSE, VectorspaceElement::getDim(), VectorspaceElement::isEmpty(), and Matrix::setCol().

Referenced by OCPiterate::shift().

Returns:
Reference to object with shifted points

References BT_FALSE, Grid::getNumIntervals(), Grid::getNumPoints(), VectorspaceElement::isEmpty(), uint, and MatrixVariablesGrid::values.

VariablesGrid & VariablesGrid::shiftTimes ( double  timeShift)
Parameters:
[in]timeShiftTime offset for shifting.
Returns:
Reference to object with shifted times

Reimplemented from MatrixVariablesGrid.

Referenced by PeriodicReferenceTrajectory::getReference(), and ShootingMethod::rescale().

int MatrixVariablesGrid::sprintf ( char *  buffer) [inherited]

If the char* buffer is equal to zero the length of the requested printing data will be returned (can be used to allocate memory exactly the same way how it would be done with standard C library).

Parameters:
[in,out]bufferBuffer for printing.
Returns:
>= 0: number of written characters,
-1: an error occured

References ACADOERROR, MatrixVariablesGrid::getNumCols(), Grid::getNumPoints(), MatrixVariablesGrid::getNumRows(), MatrixVariablesGrid::getNumValues(), Grid::getTime(), MatrixVariablesGrid::operator()(), RET_MEMBER_NOT_INITIALISED, Grid::times, uint, and writeDoublePointerToString().

Referenced by GnuplotWindow::obtainPlotDataString(), and MatrixVariablesGrid::printToString().


Friends And Related Function Documentation

returnValue operator<< ( FILE *  file,
VariablesGrid arg 
) [friend]


Parameters:
[in]fileFile to print to.
[in]argVariablesGrid to print.
Returns:
SUCCESSFUL_RETURN
RET_CAN_NOT_WRITE_INTO_FILE
returnValue operator<< ( FILE *  file,
MatrixVariablesGrid arg 
) [friend, inherited]


Parameters:
[in]fileFile to print to.
[in]argMatrixVariablesGrid to print.
Returns:
SUCCESSFUL_RETURN
RET_CAN_NOT_WRITE_INTO_FILE
friend class OptimizationAlgorithm [friend]
friend class OptimizationAlgorithmBase [friend]
friend class RealTimeAlgorithm [friend]

Member Data Documentation

uint Grid::nPoints [protected, inherited]
double* Grid::times [protected, inherited]
MatrixVariable** MatrixVariablesGrid::values [protected, inherited]

Referenced by MatrixVariablesGrid::addMatrix(), appendTimes(), MatrixVariablesGrid::appendTimes(), appendValues(), MatrixVariablesGrid::appendValues(), MatrixVariablesGrid::clearValues(), MatrixVariablesGrid::determineStringLength(), MatrixVariablesGrid::disableAutoInit(), MatrixVariablesGrid::enableAutoInit(), MatrixVariablesGrid::getAutoInit(), MatrixVariablesGrid::getCoarsenedGrid(), MatrixVariablesGrid::getDim(), MatrixVariablesGrid::getLowerBound(), MatrixVariablesGrid::getLowerBounds(), MatrixVariablesGrid::getMatrix(), MatrixVariablesGrid::getMax(), MatrixVariablesGrid::getMean(), MatrixVariablesGrid::getMin(), MatrixVariablesGrid::getName(), MatrixVariablesGrid::getNumCols(), MatrixVariablesGrid::getNumRows(), MatrixVariablesGrid::getNumValues(), MatrixVariablesGrid::getRefinedGrid(), MatrixVariablesGrid::getScaling(), getTimeSubGrid(), MatrixVariablesGrid::getTimeSubGrid(), MatrixVariablesGrid::getType(), MatrixVariablesGrid::getUnit(), MatrixVariablesGrid::getUpperBound(), MatrixVariablesGrid::getUpperBounds(), getValuesSubGrid(), MatrixVariablesGrid::getValuesSubGrid(), getVector(), MatrixVariablesGrid::hasLowerBounds(), MatrixVariablesGrid::hasNames(), MatrixVariablesGrid::hasScaling(), MatrixVariablesGrid::hasUnits(), MatrixVariablesGrid::hasUpperBounds(), MatrixVariablesGrid::init(), MatrixVariablesGrid::initMatrixVariables(), MatrixVariablesGrid::linearInterpolation(), MatrixVariablesGrid::MatrixVariablesGrid(), merge(), MatrixVariablesGrid::merge(), MatrixVariablesGrid::operator()(), operator()(), MatrixVariablesGrid::operator+(), MatrixVariablesGrid::operator+=(), MatrixVariablesGrid::operator-(), MatrixVariablesGrid::operator-=(), MatrixVariablesGrid::operator=(), MatrixVariablesGrid::operator[](), operator[](), MatrixVariablesGrid::printToString(), MatrixVariablesGrid::setAll(), MatrixVariablesGrid::setAutoInit(), MatrixVariablesGrid::setLowerBound(), MatrixVariablesGrid::setLowerBounds(), MatrixVariablesGrid::setMatrix(), MatrixVariablesGrid::setName(), MatrixVariablesGrid::setScaling(), MatrixVariablesGrid::setType(), MatrixVariablesGrid::setUnit(), MatrixVariablesGrid::setUpperBound(), MatrixVariablesGrid::setUpperBounds(), MatrixVariablesGrid::setZero(), and MatrixVariablesGrid::shiftBackwards().


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines