ACADO Toolkit
1.2.0beta
Toolkit for Automatic Control and Dynamic Optimization
|
Provides a time grid consisting of vector-valued optimization variables at each grid point. More...
#include <variables_grid.hpp>
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. | |
VariablesGrid & | operator= (const VariablesGrid &rhs) |
Assignment operator (deep copy). | |
VariablesGrid & | operator= (const MatrixVariablesGrid &rhs) |
Assignment operator (deep copy). | |
VariablesGrid & | operator= (FILE *rhs) |
Assignment operator which reads data from a file. | |
VariablesGrid & | operator= (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. | |
VariablesGrid & | operator+= (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. | |
VariablesGrid & | operator-= (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. | |
VariablesGrid & | shiftTimes (double timeShift) |
Shifts times at all grid points by a given offset. | |
VariablesGrid & | shiftBackwards (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. | |
MatrixVariablesGrid & | operator+= (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. | |
MatrixVariablesGrid & | operator-= (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 ×_) |
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. | |
MatrixVariablesGrid & | shiftBackwards (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. | |
Grid & | operator& (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. |
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.
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.
[in] | _dim | Dimension of each vector. |
[in] | _grid | Grid on which the vector-valued MatrixVariable(s) are defined. |
[in] | _type | Type of the variable(s). |
[in] | _names | Array containing names (labels) for each component of the variable(s). |
[in] | _units | Array containing units for each component of the variable(s). |
[in] | _scaling | Array containing the scaling for each component of the variable(s). |
[in] | _lb | Array containing lower bounds for each component of the variable(s). |
[in] | _ub | Array containing upper bounds for each component of the variable(s). |
[in] | _autoInit | Array 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.
[in] | _dim | Dimension of each vector. |
[in] | _nPoints | Number of grid points on which the vector-valued MatrixVariable(s) are defined. |
[in] | _type | Type of the variable(s). |
[in] | _names | Array containing names (labels) for each component of the variable(s). |
[in] | _units | Array containing units for each component of the variable(s). |
[in] | _scaling | Array containing the scaling for each component of the variable(s). |
[in] | _lb | Array containing lower bounds for each component of the variable(s). |
[in] | _ub | Array containing upper bounds for each component of the variable(s). |
[in] | _autoInit | Array 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.
[in] | _dim | Dimension of each vector. |
[in] | _firstTime | Time of first grid point. |
[in] | _lastTime | Time of last grid point. |
[in] | _nPoints | Number of grid points on which the vector-valued MatrixVariable(s) are defined. |
[in] | _type | Type of the variable(s). |
[in] | _names | Array containing names (labels) for each component of the variable(s). |
[in] | _units | Array containing units for each component of the variable(s). |
[in] | _scaling | Array containing the scaling for each component of the variable(s). |
[in] | _lb | Array containing lower bounds for each component of the variable(s). |
[in] | _ub | Array containing upper bounds for each component of the variable(s). |
[in] | _autoInit | Array 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.
VariablesGrid::VariablesGrid | ( | const Matrix & | arg, |
VariableType | _type = VT_UNKNOWN |
||
) |
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.
[in] | file | File to be read. |
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.
[in] | file | File to be read. |
VariablesGrid::VariablesGrid | ( | const VariablesGrid & | rhs | ) |
[in] | rhs | Right-hand side object. |
VariablesGrid::VariablesGrid | ( | const MatrixVariablesGrid & | rhs | ) |
[in] | rhs | Right-hand side object. |
References ASSERT, and MatrixVariablesGrid::getNumCols().
returnValue MatrixVariablesGrid::addMatrix | ( | const Matrix & | newMatrix, |
double | newTime = -INFTY |
||
) | [inherited] |
[in] | newMatrix | Matrix of grid point to be added. |
[in] | newTime | Time of grid point to be added. |
Referenced by addVector(), appendTimes(), MatrixVariablesGrid::appendTimes(), MatrixVariablesGrid::getCoarsenedGrid(), MatrixVariablesGrid::getRefinedGrid(), getTimeSubGrid(), MatrixVariablesGrid::getTimeSubGrid(), getValuesSubGrid(), MatrixVariablesGrid::getValuesSubGrid(), merge(), MatrixVariablesGrid::merge(), MatrixVariablesGrid::operator[](), operator[](), LogRecordItem::setAllValues(), and LogRecordItem::setValue().
returnValue MatrixVariablesGrid::addMatrix | ( | const MatrixVariable & | newMatrix, |
double | newTime = -INFTY |
||
) | [protected, inherited] |
[in] | newMatrix | MatrixVariable of grid point to be added. |
[in] | newTime | Time of grid point to be added. |
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] |
[in] | _time | Time point to be added. |
References ACADOERROR, acadoIsGreater(), BT_FALSE, Grid::getLastTime(), Grid::getNumPoints(), Grid::nPoints, RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, and Grid::times.
Referenced by MatrixVariablesGrid::addMatrix(), TransferDevice::generateNoise(), PlotWindow::getDataGrids(), Actuator::getDelayedInputGrids(), Sensor::getDelayedOutputGrid(), and Grid::merge().
returnValue VariablesGrid::addVector | ( | const Vector & | newVector, |
double | newTime = -INFTY |
||
) |
[in] | newVector | Vector of grid point to be added. |
[in] | newTime | Time of grid point to be added. |
References MatrixVariablesGrid::addMatrix().
Referenced by PlotWindow::getDataGrids().
returnValue VariablesGrid::appendTimes | ( | const VariablesGrid & | arg, |
MergeMethod | _mergeMethod = MM_DUPLICATE |
||
) |
A merge method defines the way duplicate entries are handled.
[in] | arg | Grid to append. |
[in] | _mergeMethod | Merge method, see documentation of MergeMethod for details. |
References ACADOERROR, acadoIsEqual(), acadoIsGreater(), MatrixVariablesGrid::addMatrix(), BT_FALSE, Grid::getFirstTime(), getFirstVector(), Grid::getLastIndex(), Grid::getLastTime(), Grid::getNumPoints(), Grid::getTime(), MM_DUPLICATE, MM_KEEP, MM_REPLACE, RET_INVALID_ARGUMENTS, setVector(), SUCCESSFUL_RETURN, uint, and MatrixVariablesGrid::values.
Referenced by appendTimes(), SimulationEnvironment::getProcessAlgebraicStates(), SimulationEnvironment::getProcessDifferentialStates(), SimulationEnvironment::getProcessIntermediateStates(), PeriodicReferenceTrajectory::getReference(), ShootingMethod::logTrajectory(), and merge().
returnValue VariablesGrid::appendTimes | ( | const Matrix & | arg, |
MergeMethod | _mergeMethod = MM_DUPLICATE |
||
) |
A merge method defines the way duplicate entries are handled.
[in] | arg | Grid to append in matrix form. |
[in] | _mergeMethod | Merge method, see documentation of MergeMethod for details. |
References appendTimes().
returnValue MatrixVariablesGrid::appendTimes | ( | const MatrixVariablesGrid & | arg, |
MergeMethod | _mergeMethod = MM_DUPLICATE |
||
) | [inherited] |
A merge method defines the way duplicate entries are handled.
[in] | arg | Grid to append. |
[in] | _mergeMethod | Merge method, see documentation of MergeMethod for details. |
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().
returnValue VariablesGrid::appendValues | ( | const VariablesGrid & | arg | ) |
Both grids need to be defined over identical grid points.
[in] | arg | Grid whose values are to appended. |
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().
returnValue MatrixVariablesGrid::appendValues | ( | const MatrixVariablesGrid & | arg | ) | [inherited] |
Both grids need to be defined over identical grid points.
[in] | arg | Grid whose values are to appended. |
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.
References Grid::nPoints, SUCCESSFUL_RETURN, uint, and MatrixVariablesGrid::values.
Referenced by MatrixVariablesGrid::init(), MatrixVariablesGrid::operator=(), and MatrixVariablesGrid::~MatrixVariablesGrid().
returnValue Grid::coarsenGrid | ( | uint | factor | ) | [inherited] |
[in] | factor | Coarsening factor. |
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.
[in] | arg | Grid to be used for coarsening. |
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] |
[in] | name | Name label to be printed before the numerical values. |
[in] | startString | Prefix before printing the numerical values. |
[in] | endString | Suffix after printing the numerical values. |
[in] | width | Total number of digits per single numerical value. |
[in] | precision | Number of decimals per single numerical value. |
[in] | colSeparator | Separator between the columns of the numerical values. |
[in] | rowSeparator | Separator between the rows of the numerical values. |
References Grid::getNumPoints(), getStringLength(), uint, and MatrixVariablesGrid::values.
Referenced by MatrixVariablesGrid::printToString().
returnValue MatrixVariablesGrid::disableAutoInit | ( | ) | [inline, inherited] |
References BT_FALSE, Grid::getNumPoints(), MatrixVariablesGrid::setAutoInit(), SUCCESSFUL_RETURN, uint, and MatrixVariablesGrid::values.
Referenced by OCPiterate::enableSimulationMode(), OptimizationAlgorithmBase::init(), OptimizationAlgorithmBase::initializeAlgebraicStates(), OptimizationAlgorithmBase::initializeDifferentialStates(), and SCPmethod::setup().
returnValue MatrixVariablesGrid::enableAutoInit | ( | ) | [inline, inherited] |
References BT_TRUE, Grid::getNumPoints(), MatrixVariablesGrid::setAutoInit(), SUCCESSFUL_RETURN, uint, and MatrixVariablesGrid::values.
Referenced by OCPiterate::enableSimulationMode(), OptimizationAlgorithmBase::initializeAlgebraicStates(), OptimizationAlgorithmBase::initializeDifferentialStates(), and OptimizationAlgorithmBase::simulateStatesForInitialization().
returnValue Grid::equalizeGrids | ( | Grid & | arg | ) | [inherited] |
Note that both the original as well as the argument grid is changed!
[in] | arg | Right-hand side object. |
References SUCCESSFUL_RETURN.
int Grid::findFirstTime | ( | double | _time, |
uint | startIdx = 0 |
||
) | const [inherited] |
[in] | _time | Time to be found. |
[in] | startIdx | Start index for searching for time point. |
References acadoIsEqual(), BT_TRUE, Grid::getNumPoints(), Grid::times, and uint.
Referenced by Grid::findTime().
int Grid::findLastTime | ( | double | _time, |
uint | startIdx = 0 |
||
) | const [inherited] |
[in] | _time | Time to be found. |
[in] | startIdx | Start index for searching for time point. |
References acadoIsEqual(), BT_TRUE, Grid::getNumPoints(), Grid::times, and uint.
Referenced by MatrixVariablesGrid::getCoarsenedGrid().
int Grid::findNextIndex | ( | ) | const [protected, inherited] |
References Grid::getNumPoints(), INFTY, Grid::times, and uint.
Referenced by Grid::setTime().
int Grid::findTime | ( | double | _time, |
uint | startIdx = 0 |
||
) | const [inherited] |
[in] | _time | Time to be found. |
[in] | startIdx | Start index for searching for time point. |
References Grid::findFirstTime().
Referenced by Grid::hasTime(), Grid::operator<(), and Grid::operator>().
BooleanType MatrixVariablesGrid::getAutoInit | ( | uint | pointIdx | ) | const [inline, inherited] |
[in] | pointIdx | Index of grid point. |
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] |
[in] | _time | Time smaller or equal than that of the time point to be found. |
References acadoIsGreater(), acadoIsSmaller(), BT_TRUE, Grid::getLastIndex(), Grid::getTime(), Grid::isInLowerHalfOpenInterval(), and uint.
Referenced by getTimeSubGrid(), and MatrixVariablesGrid::linearInterpolation().
MatrixVariablesGrid MatrixVariablesGrid::getCoarsenedGrid | ( | const Grid & | arg | ) | const [inherited] |
For doing so, the given grid has to be a subset of the current grid.
[in] | arg | Grid to be used for coarsening. |
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] |
the sum of dimensions of matrices at all grid point.
References Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.
Referenced by LogRecordItem::getNumDoubles(), MatrixVariablesGrid::setLowerBound(), MatrixVariablesGrid::setScaling(), and MatrixVariablesGrid::setUpperBound().
Matrix MatrixVariablesGrid::getFirstMatrix | ( | ) | const [inherited] |
References emptyMatrix, MatrixVariablesGrid::getMatrix(), and Grid::getNumPoints().
Referenced by MatrixVariablesGrid::appendTimes(), and LogRecordItem::setAllValues().
double Grid::getFirstTime | ( | ) | const [inline, inherited] |
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().
Vector VariablesGrid::getFirstVector | ( | ) | const |
References emptyVector, Grid::getNumPoints(), and getVector().
Referenced by appendTimes(), Controller::getCurrentReference(), and Process::run().
uint Grid::getFloorIndex | ( | double | time | ) | const [inherited] |
[in] | _time | Time greater or equal than that of the time point to be found. |
References acadoIsGreater(), acadoIsSmaller(), acadoIsStrictlyGreater(), BT_TRUE, Grid::getLastIndex(), Grid::getTime(), Grid::isInUpperHalfOpenInterval(), and uint.
Referenced by Actuator::delayActuatorInput(), Sensor::delaySensorOutput(), Curve::evaluate(), PointConstraint::getBounds(), getTimeSubGrid(), IntegratorBDF::interpolate(), MatrixVariablesGrid::linearInterpolation(), IntegratorBDF::rk_start(), IntegratorDiscretizedODE::step(), IntegratorBDF::step(), IntegratorLYAPUNOV::step(), IntegratorRK::step(), and OCPiterate::update().
returnValue MatrixVariablesGrid::getGrid | ( | Grid & | _grid | ) | const [inline, inherited] |
[out] | grid_ | Time grid. |
References Grid::getNumPoints(), Grid::init(), and Grid::times.
Referenced by Actuator::addActuatorNoise(), Sensor::addSensorNoise(), Process::calculateOutput(), PlotWindow::getExpressionDataGrids(), MatrixVariablesGrid::getTimePoints(), OCPiterate::getUnionGrid(), PlotWindow::getVariableDataGrids(), MatrixVariablesGrid::operator()(), operator()(), Process::simulate(), and Process::step().
returnValue VariablesGrid::getIntegral | ( | InterpolationMode | mode, |
Vector & | value | ||
) | const |
[in] | mode | Specifies how the vector-values are interpolated for approximating the integral, see documentation of InterpolationMode for details. |
[out] | value | Component-wise approximation of the integral over all vectors at all grid points. |
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] |
References Grid::nPoints, and Grid::times.
Referenced by IntegratorBDF::evaluate(), getIntegral(), Grid::isEquidistant(), Grid::refineGrid(), IntegratorBDF::relaxAlgebraic(), and OCPiterate::shift().
double Grid::getIntervalLength | ( | uint | pointIdx | ) | const [inline, inherited] |
[in] | pointIdx | Index of grid point at beginning of interval. |
References ACADOERROR, Grid::getLastIndex(), Grid::getNumPoints(), INFTY, RET_INDEX_OUT_OF_BOUNDS, and Grid::times.
uint Grid::getLastIndex | ( | ) | const [inline, inherited] |
References Grid::getNumPoints().
Referenced by appendTimes(), MatrixVariablesGrid::appendTimes(), Actuator::delayActuatorInput(), Sensor::delaySensorOutput(), BoundaryConstraint::evaluate(), CoupledPathConstraint::evaluate(), PathConstraint::evaluate(), MayerTerm::evaluate(), LSQEndTerm::evaluate(), AlgebraicConsistencyConstraint::evaluate(), Grid::getCeilIndex(), Grid::getFloorIndex(), Grid::getIntervalLength(), Grid::getNumIntervals(), StaticReferenceTrajectory::getReference(), Grid::isInInterval(), Grid::isInUpperHalfOpenInterval(), Grid::isLast(), and OCP::subjectTo().
Matrix MatrixVariablesGrid::getLastMatrix | ( | ) | const [inherited] |
References emptyMatrix, MatrixVariablesGrid::getMatrix(), and Grid::getNumPoints().
Referenced by LogRecordItem::setAllValues().
double Grid::getLastTime | ( | ) | const [inline, inherited] |
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().
Vector VariablesGrid::getLastVector | ( | ) | const |
References emptyVector, Grid::getNumPoints(), and getVector().
Referenced by Actuator::delayActuatorInput(), Sensor::delaySensorOutput(), ShootingMethod::evaluate(), PlotWindow::getDataGrids(), StaticReferenceTrajectory::getReference(), IntegrationAlgorithm::getX(), IntegrationAlgorithm::getXA(), Objective::setReference(), and Process::simulate().
double MatrixVariablesGrid::getLowerBound | ( | uint | pointIdx, |
uint | valueIdx | ||
) | const [inline, inherited] |
[in] | pointIdx | Index of grid point. |
[in] | valueIdx | Index of component. |
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] |
[in] | pointIdx | Index of grid point. |
References emptyVectorspaceElement, VariableSettings::getLowerBounds(), Grid::getNumPoints(), and MatrixVariablesGrid::values.
Referenced by ExportNLPSolver::setConstraints(), ExportGaussNewtonQpDunes::setupConstraintsEvaluation(), ExportGaussNewtonForces::setupConstraintsEvaluation(), and OCPiterate::update().
Matrix MatrixVariablesGrid::getMatrix | ( | uint | pointIdx | ) | const [inherited] |
[in] | pointIdx | Index of grid point. |
References ASSERT, emptyMatrix, MatrixVariable::getMatrix(), Grid::getNumPoints(), and MatrixVariablesGrid::values.
Referenced by Objective::addLSQ(), LogRecordItem::determineStringLength(), ShootingMethod::evaluateSensitivitiesLifted(), MatrixVariablesGrid::getFirstMatrix(), MatrixVariablesGrid::getLastMatrix(), SimulationEnvironment::getProcessAlgebraicStates(), SimulationEnvironment::getProcessDifferentialStates(), SimulationEnvironment::getProcessIntermediateStates(), SimulationEnvironment::getSampledProcessOutput(), LogRecordItem::getValue(), LogRecordItem::getValueString(), LSQTerm::getWeigthingtMatrix(), operator==(), and LSQTerm::setGrid().
double MatrixVariablesGrid::getMax | ( | ) | const [inline, inherited] |
References Grid::getNumPoints(), INFTY, uint, and MatrixVariablesGrid::values.
Referenced by PlotWindow::getAutoScaleYLimits().
double MatrixVariablesGrid::getMean | ( | ) | const [inline, inherited] |
References Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.
Referenced by PlotWindow::getAutoScaleYLimits().
double MatrixVariablesGrid::getMin | ( | ) | const [inline, inherited] |
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] |
[in] | pointIdx | Index of grid point. |
[in] | idx | Index of component. |
[out] | _name | Name label of given component at given grid point. |
References ACADOERROR, VariableSettings::getName(), Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, and MatrixVariablesGrid::values.
uint MatrixVariablesGrid::getNumCols | ( | ) | const [inline, inherited] |
References MatrixVariablesGrid::values.
Referenced by operator=(), MatrixVariablesGrid::sprintf(), and VariablesGrid().
uint MatrixVariablesGrid::getNumCols | ( | uint | pointIdx | ) | const [inline, inherited] |
[in] | pointIdx | Index of grid point. |
References ASSERT, Matrix::getNumCols(), Grid::getNumPoints(), and MatrixVariablesGrid::values.
uint Grid::getNumIntervals | ( | ) | const [inline, inherited] |
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] |
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] |
References MatrixVariablesGrid::values.
Referenced by Curve::add(), Actuator::checkInputConsistency(), Process::checkInputConsistency(), MatrixVariablesGrid::operator()(), operator()(), setVector(), MatrixVariablesGrid::sprintf(), and Sensor::step().
uint MatrixVariablesGrid::getNumRows | ( | uint | pointIdx | ) | const [inline, inherited] |
[in] | pointIdx | Index of grid point. |
References ASSERT, Grid::getNumPoints(), Matrix::getNumRows(), and MatrixVariablesGrid::values.
uint MatrixVariablesGrid::getNumValues | ( | ) | const [inline, inherited] |
References MatrixVariablesGrid::values.
Referenced by acadoPlot(), ClippingFunctionality::clipSignals(), BoxConstraint::evaluateBounds(), TransferDevice::getDim(), Noise::getDim(), StaticReferenceTrajectory::getDim(), OCPiterate::getDim(), getIntegral(), ParameterEstimationAlgorithm::getParameterVarianceCovariance(), DynamicDiscretization::getResiduum(), getValuesSubGrid(), MatrixVariablesGrid::getValuesSubGrid(), Integrator::getX(), Integrator::getXA(), ConstraintElement::init(), ObjectiveElement::init(), PIDcontroller::init(), initializeFromBounds(), Matrix::Matrix(), GnuplotWindow::sendDataToGnuplot(), ConstraintComponent::setLB(), ConstraintComponent::setUB(), Process::simulate(), MatrixVariablesGrid::sprintf(), LinearStateFeedback::step(), PIDcontroller::step(), UniformNoise::step(), and GaussianNoise::step().
uint MatrixVariablesGrid::getNumValues | ( | uint | pointIdx | ) | const [inline, inherited] |
[in] | pointIdx | Index of grid point. |
References ASSERT, VectorspaceElement::getDim(), Grid::getNumPoints(), and MatrixVariablesGrid::values.
MatrixVariablesGrid MatrixVariablesGrid::getRefinedGrid | ( | const Grid & | arg, |
InterpolationMode | mode = IM_CONSTANT |
||
) | const [inherited] |
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.
[in] | arg | Grid to be used for refinement. |
[in] | mode | Interpolation mode, see documentation of InterpolationMode. |
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] |
[in] | pointIdx | Index of grid point. |
References emptyVectorspaceElement, Grid::getNumPoints(), VariableSettings::getScaling(), and MatrixVariablesGrid::values.
double MatrixVariablesGrid::getScaling | ( | uint | pointIdx, |
uint | valueIdx | ||
) | const [inline, inherited] |
[in] | pointIdx | Index of grid point. |
[in] | valueIdx | Index of component. |
References Grid::getNumPoints(), VariableSettings::getScaling(), and MatrixVariablesGrid::values.
returnValue Grid::getSubGrid | ( | double | tStart, |
double | tEnd, | ||
Grid & | _subGrid | ||
) | const [inherited] |
[in] | tStart | Start time of sub-grid. |
[in] | tEnd | End time of sub-grid. |
[out] | _subGrid | Desired sub-grid. |
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().
returnValue VariablesGrid::getSum | ( | Vector & | sum | ) | const |
[out] | sum | Component-wise sum over all vectors at all grid points. |
References Grid::getNumPoints(), getVector(), VectorspaceElement::setZero(), SUCCESSFUL_RETURN, and uint.
double Grid::getTime | ( | uint | pointIdx | ) | const [inline, inherited] |
[in] | pointIdx | Index of grid point. |
References ASSERT, Grid::getLastTime(), Grid::getNumPoints(), and Grid::times.
Referenced by acadoPlot(), Curve::add(), Constraint::add(), appendTimes(), MatrixVariablesGrid::appendTimes(), Curve::discretize(), ShootingMethod::evaluate(), ImplicitRungeKuttaExport::evaluateDerivedPolynomial(), ImplicitRungeKuttaExport::evaluatePolynomial(), PointConstraint::getBounds(), Grid::getCeilIndex(), MatrixVariablesGrid::getCoarsenedGrid(), PlotWindow::getDataGrids(), Grid::getFloorIndex(), IntegratorExport::getIntegrationInterval(), MatrixVariablesGrid::getRefinedGrid(), Grid::getSubGrid(), OCPiterate::getTime(), Curve::getTimeDomain(), getTimeSubGrid(), MatrixVariablesGrid::getTimeSubGrid(), getValuesSubGrid(), MatrixVariablesGrid::getValuesSubGrid(), OptimizationAlgorithmBase::initializeOCPiterate(), IntegratorRK::interpolate(), IntegratorLYAPUNOV::interpolate(), IntegratorBDF::interpolate(), Grid::isInInterval(), Grid::isInLowerHalfOpenInterval(), Grid::isInUpperHalfOpenInterval(), MatrixVariablesGrid::linearInterpolation(), Matrix::Matrix(), Grid::merge(), merge(), MatrixVariablesGrid::merge(), Grid::operator==(), MatrixVariablesGrid::operator[](), operator[](), Grid::print(), MatrixVariablesGrid::printToString(), Grid::refineGrid(), ShootingMethod::rescale(), GnuplotWindow::sendDataToGnuplot(), ModelData::setIntegrationGrid(), LSQTerm::setReference(), and MatrixVariablesGrid::sprintf().
Grid MatrixVariablesGrid::getTimePoints | ( | ) | const [inline, inherited] |
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 |
[in] | startIdx | Index of first grid point to be included in sub grid. |
[in] | endIdx | Index of last grid point to be included in sub grid. |
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 |
[in] | startTime | Time of first grid point to be included in sub grid. |
[in] | endTime | Time of last grid point to be included in sub grid. |
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] |
References Grid::getNumPoints(), and VT_UNKNOWN.
Referenced by PlotWindow::getDataGrids(), PlotWindowSubplot::getYVariableType(), MatrixVariablesGrid::operator()(), operator()(), and MatrixVariablesGrid::operator=().
VariableType MatrixVariablesGrid::getType | ( | uint | pointIdx | ) | const [inline, inherited] |
[in] | pointIdx | Index of grid point. |
References Grid::getNumPoints(), VariableSettings::getType(), MatrixVariablesGrid::values, and VT_UNKNOWN.
returnValue MatrixVariablesGrid::getUnit | ( | uint | pointIdx, |
uint | idx, | ||
char *const | _unit | ||
) | const [inline, inherited] |
[in] | pointIdx | Index of grid point. |
[in] | idx | Index of component. |
[out] | _unit | Unit label of given component at given grid point. |
References ACADOERROR, Grid::getNumPoints(), VariableSettings::getUnit(), RET_INDEX_OUT_OF_BOUNDS, and MatrixVariablesGrid::values.
double MatrixVariablesGrid::getUpperBound | ( | uint | pointIdx, |
uint | valueIdx | ||
) | const [inline, inherited] |
[in] | pointIdx | Index of grid point. |
[in] | valueIdx | Index of component. |
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] |
[in] | pointIdx | Index of grid point. |
References emptyVectorspaceElement, Grid::getNumPoints(), VariableSettings::getUpperBounds(), and MatrixVariablesGrid::values.
Referenced by ExportNLPSolver::setConstraints(), ExportGaussNewtonQpDunes::setupConstraintsEvaluation(), ExportGaussNewtonForces::setupConstraintsEvaluation(), and OCPiterate::update().
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.
[in] | startIdx | Index of first compenent to be included in sub grid. |
[in] | endIdx | Index of last compenent to be included in sub grid. |
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 |
[in] | pointIdx | Index of grid point. |
References emptyVector, Matrix::getCol(), Grid::getNumPoints(), and MatrixVariablesGrid::values.
Referenced by OCPiterate::copy(), ShootingMethod::evaluate(), PlotWindow::getDataGrids(), SCPmethod::getFirstControl(), getFirstVector(), OCPiterate::getInitialData(), getLastVector(), OptimizationAlgorithmBase::getParameters(), SCPmethod::getParameters(), getSum(), PIDcontroller::init(), SimulationEnvironment::init(), SimulationEnvironment::initializeAlgebraicStates(), Controller::initializeAlgebraicStates(), OptimizationAlgorithmBase::initializeOCPiterate(), ShootingMethod::logTrajectory(), LSQTerm::setGrid(), LSQTerm::setReference(), SCPmethod::setupRealTimeParameters(), Process::simulate(), LinearStateFeedback::step(), PIDcontroller::step(), UniformNoise::step(), GaussianNoise::step(), and OCPiterate::update().
BooleanType MatrixVariablesGrid::hasLowerBounds | ( | ) | const [inline, inherited] |
References BT_FALSE, BT_TRUE, Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.
Referenced by OCPiterate::update().
BooleanType MatrixVariablesGrid::hasNames | ( | ) | const [inline, inherited] |
References BT_FALSE, BT_TRUE, Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.
BooleanType MatrixVariablesGrid::hasScaling | ( | ) | const [inline, inherited] |
References BT_FALSE, BT_TRUE, Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.
BooleanType Grid::hasTime | ( | double | _time | ) | const [inherited] |
[in] | _time | Time point to be checked for existence. |
References BT_FALSE, BT_TRUE, and Grid::findTime().
Referenced by MatrixVariablesGrid::getRefinedGrid(), Grid::getSubGrid(), getTimeSubGrid(), and OCPiterate::update().
BooleanType MatrixVariablesGrid::hasUnits | ( | ) | const [inline, inherited] |
References BT_FALSE, BT_TRUE, Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.
BooleanType MatrixVariablesGrid::hasUpperBounds | ( | ) | const [inline, inherited] |
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] |
[in] | _nPoints | Number of grid points. |
[in] | _times | Initialization of times. |
References INFTY, Grid::nPoints, SUCCESSFUL_RETURN, Grid::times, and uint.
Referenced by ShootingMethod::deleteAll(), ShootingMethod::evaluate(), TransferDevice::generateNoise(), PlotWindow::getDataGrids(), MatrixVariablesGrid::getGrid(), Grid::getSubGrid(), PlotWindow::getVariableDataGrids(), Grid::Grid(), GnuplotWindow::sendDataToGnuplot(), and OCP::setupGrid().
returnValue Grid::init | ( | const Vector & | times_ | ) | [inherited] |
[in] | times | Initialization of times. |
References VectorspaceElement::getDim(), Grid::nPoints, SUCCESSFUL_RETURN, Grid::times, and uint.
returnValue Grid::init | ( | double | _firstTime, |
double | _lastTime, | ||
uint | _nPoints = 2 |
||
) | [inherited] |
[in] | _firstTime | Time of first grid point. |
[in] | _lastTime | Time of last grid point. |
[in] | _nPoints | Number of grid points. |
References Grid::nPoints, Grid::setupEquidistant(), and Grid::times.
returnValue Grid::init | ( | const Grid & | rhs | ) | [inherited] |
[in] | rhs | Grid to be taken for initialization. |
References Grid::operator=(), and SUCCESSFUL_RETURN.
Reimplemented from MatrixVariablesGrid.
Referenced by Process::calculateOutput(), UniformNoise::clone(), GaussianNoise::clone(), Actuator::delayActuatorInput(), Sensor::delaySensorOutput(), Curve::discretize(), OutputFcn::evaluate(), IntegratorBDF::evaluate(), IntegratorRK::evaluate(), IntegratorLYAPUNOV::evaluate(), IntegratorLYAPUNOV::evaluateSensitivities(), IntegratorBDF::evaluateSensitivities(), IntegratorRK::evaluateSensitivities(), GaussianNoise::GaussianNoise(), TransferDevice::generateNoise(), Controller::getCurrentReference(), PlotWindow::getDataGrids(), Actuator::getDelayedInputGrids(), Sensor::getDelayedOutputGrid(), MultiObjectiveAlgorithm::getParetoFront(), MultiObjectiveAlgorithm::getParetoFrontWithFilter(), SimulationEnvironment::getProcessAlgebraicStates(), SimulationEnvironment::getProcessDifferentialStates(), SimulationEnvironment::getProcessIntermediateStates(), StaticReferenceTrajectory::getReference(), Integrator::getX(), Integrator::getXA(), TransferDevice::init(), Process::init(), init(), ShootingMethod::logTrajectory(), ExportNLPSolver::setConstraints(), Process::setDynamicSystem(), LSQTerm::setGrid(), UniformNoise::step(), GaussianNoise::step(), TransferDevice::TransferDevice(), and UniformNoise::UniformNoise().
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.
[in] | _nRows | Number of rows of each matrix. |
[in] | _nCols | Number of columns of each matrix. |
[in] | _grid | Grid on which the MatrixVariable(s) are defined. |
[in] | _type | Type of the variable(s). |
[in] | _names | Array containing name labels for each component of the variable(s). |
[in] | _units | Array containing unit labels for each component of the variable(s). |
[in] | _scaling | Array containing the scaling for each component of the variable(s). |
[in] | _lb | Array containing lower bounds for each component of the variable(s). |
[in] | _ub | Array containing upper bounds for each component of the variable(s). |
[in] | _autoInit | Array defining if each component of the variable(s) is to be automatically initialized. |
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.
[in] | _dim | Dimension of each vector. |
[in] | _grid | Grid on which the vector-valued MatrixVariable(s) are defined. |
[in] | _type | Type of the variable(s). |
[in] | _names | Array containing names (labels) for each component of the variable(s). |
[in] | _units | Array containing units for each component of the variable(s). |
[in] | _scaling | Array containing the scaling for each component of the variable(s). |
[in] | _lb | Array containing lower bounds for each component of the variable(s). |
[in] | _ub | Array containing upper bounds for each component of the variable(s). |
[in] | _autoInit | Array defining if each component of the variable(s) is to be automatically initialized. |
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.
[in] | _nRows | Number of rows of each matrix. |
[in] | _nCols | Number of columns of each matrix. |
[in] | _nPoints | Number of grid points on which the MatrixVariable(s) are defined. |
[in] | _type | Type of the variable(s). |
[in] | _names | Array containing name labels for each component of the variable(s). |
[in] | _units | Array containing unit labels for each component of the variable(s). |
[in] | _scaling | Array containing the scaling for each component of the variable(s). |
[in] | _lb | Array containing lower bounds for each component of the variable(s). |
[in] | _ub | Array containing upper bounds for each component of the variable(s). |
[in] | _autoInit | Array defining if each component of the variable(s) is to be automatically initialized. |
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.
[in] | _dim | Dimension of each vector. |
[in] | _nPoints | Number of grid points on which the vector-valued MatrixVariable(s) are defined. |
[in] | _type | Type of the variable(s). |
[in] | _names | Array containing names (labels) for each component of the variable(s). |
[in] | _units | Array containing units for each component of the variable(s). |
[in] | _scaling | Array containing the scaling for each component of the variable(s). |
[in] | _lb | Array containing lower bounds for each component of the variable(s). |
[in] | _ub | Array containing upper bounds for each component of the variable(s). |
[in] | _autoInit | Array defining if each component of the variable(s) is to be automatically initialized. |
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.
[in] | _nRows | Number of rows of each matrix. |
[in] | _nCols | Number of columns of each matrix. |
[in] | _firstTime | Time of first grid point. |
[in] | _lastTime | Time of last grid point. |
[in] | _nPoints | Number of grid points on which the MatrixVariable(s) are defined. |
[in] | _type | Type of the variable(s). |
[in] | _names | Array containing name labels for each component of the variable(s). |
[in] | _units | Array containing unit labels for each component of the variable(s). |
[in] | _scaling | Array containing the scaling for each component of the variable(s). |
[in] | _lb | Array containing lower bounds for each component of the variable(s). |
[in] | _ub | Array containing upper bounds for each component of the variable(s). |
[in] | _autoInit | Array defining if each component of the variable(s) is to be automatically initialized. |
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.
[in] | _dim | Dimension of each vector. |
[in] | _firstTime | Time of first grid point. |
[in] | _lastTime | Time of last grid point. |
[in] | _nPoints | Number of grid points on which the vector-valued MatrixVariable(s) are defined. |
[in] | _type | Type of the variable(s). |
[in] | _names | Array containing names (labels) for each component of the variable(s). |
[in] | _units | Array containing units for each component of the variable(s). |
[in] | _scaling | Array containing the scaling for each component of the variable(s). |
[in] | _lb | Array containing lower bounds for each component of the variable(s). |
[in] | _ub | Array containing upper bounds for each component of the variable(s). |
[in] | _autoInit | Array defining if each component of the variable(s) is to be automatically initialized. |
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.
[in] | arg | Matrix to be assign at each point of the grid. |
[in] | _grid | Grid on which the MatrixVariable(s) are defined. |
[in] | _type | Type of the variable(s). |
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.
[in] | arg | Vector to be assign at each point of the grid. |
[in] | _grid | Grid on which the vector-valued MatrixVariable(s) are defined. |
[in] | _type | Type of the variable(s). |
References init().
returnValue VariablesGrid::initializeFromBounds | ( | ) | [protected] |
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.
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.
[in] | _nRows | Number of rows of each matrix. |
[in] | _nCols | Number of columns of each matrix. |
[in] | _type | Type of the variable(s). |
[in] | _names | Array containing names (labels) for each component of the variable(s). |
[in] | _units | Array containing units for each component of the variable(s). |
[in] | _scaling | Array containing the scaling for each component of the variable(s). |
[in] | _lb | Array containing lower bounds for each component of the variable(s). |
[in] | _ub | Array containing upper bounds for each component of the variable(s). |
[in] | _autoInit | Array defining if each component of the variable(s) is to be automatically initialized. |
References VectorspaceElement::init(), Grid::nPoints, SUCCESSFUL_RETURN, uint, and MatrixVariablesGrid::values.
Referenced by MatrixVariablesGrid::init().
BooleanType Grid::isEmpty | ( | ) | const [inline, inherited] |
no grid points) or not.
References BT_FALSE, BT_TRUE, and Grid::nPoints.
Referenced by Actuator::addActuatorNoise(), OCPiterate::areGridsConsistent(), Actuator::checkInputConsistency(), Process::checkInputConsistency(), MatrixVariablesGrid::coarsenGrid(), Actuator::delayActuatorInput(), MultiObjectiveAlgorithm::evaluateObjectives(), MatrixVariablesGrid::getCoarsenedGrid(), Controller::getCurrentReference(), Actuator::getDelayedInputGrids(), PlotWindow::getExpressionDataGrids(), MatrixVariablesGrid::getRefinedGrid(), ConstraintComponent::hasLBgrid(), ConstraintComponent::hasUBgrid(), RealTimeAlgorithm::init(), Controller::init(), OptimizationAlgorithmBase::initializeAlgebraicStates(), SimulationEnvironment::initializeAlgebraicStates(), Controller::initializeAlgebraicStates(), OptimizationAlgorithmBase::initializeControls(), OptimizationAlgorithmBase::initializeDifferentialStates(), OptimizationAlgorithmBase::initializeDisturbances(), OptimizationAlgorithmBase::initializeParameters(), OCP::minimizeLSQ(), ConstraintComponent::operator()(), RealTimeAlgorithm::performPreparationStep(), MatrixVariablesGrid::refineGrid(), ModelData::setIntegrationGrid(), Process::setProcessDisturbance(), MultiObjectiveAlgorithm::solveSingleObjective(), StaticReferenceTrajectory::StaticReferenceTrajectory(), and Process::step().
BooleanType Grid::isEquidistant | ( | ) | const [inline, inherited] |
References acadoIsEqual(), BT_FALSE, BT_TRUE, Grid::getIntervalLength(), Grid::getNumIntervals(), and uint.
Referenced by ModelData::setIntegrationGrid().
BooleanType Grid::isInInterval | ( | double | _time | ) | const [inline, inherited] |
[in] | _time | Time point to be checked. |
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] |
[in] | pointIdx | Index of grid point at beginning of interval. |
[in] | _time | Time point to be checked. |
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] |
[in] | pointIdx | Index of grid point at beginning of interval. |
[in] | _time | Time point to be checked. |
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] |
[in] | pointIdx | Index of grid point at beginning of interval. |
[in] | _time | Time point to be checked. |
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] |
[in] | pointIdx | Index of grid point. |
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.
[in] | time | Time for evaluation. |
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.
[in] | arg | Grid to append. |
[in] | _mergeMethod | Merge method, see documentation of MergeMethod for details. |
[in] | keepOverlap | Flag indicating whether overlap shall be kept. |
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.
[in] | arg | Grid to append. |
[in] | _mergeMethod | Merge method, see documentation of MergeMethod for details. |
[in] | keepOverlap | Flag indicating whether overlap shall be kept. |
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.
[in] | arg | Grid to append. |
[in] | _mergeMethod | Merge method, see documentation of MergeMethod for details. |
[in] | keepOverlap | Flag indicating whether overlap shall be kept. |
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] |
[in] | arg | Right-hand side object. |
References BT_TRUE, Grid::merge(), and MM_KEEP.
BEGIN_NAMESPACE_ACADO double & MatrixVariablesGrid::operator() | ( | uint | pointIdx, |
uint | rowIdx, | ||
uint | colIdx | ||
) | [inline, inherited] |
[in] | pointIdx | Index of grid point. |
[in] | rowIdx | Row index of the component to be returned. |
[in] | colIdx | Column index of the component to be returned. |
References ASSERT, Grid::getNumPoints(), and MatrixVariablesGrid::values.
Referenced by MatrixVariablesGrid::sprintf().
BEGIN_NAMESPACE_ACADO double & VariablesGrid::operator() | ( | uint | pointIdx, |
uint | rowIdx | ||
) | [inline] |
[in] | pointIdx | Index of grid point. |
[in] | rowIdx | Row index of the component to be returned. |
Referenced by getIntegral(), initializeFromBounds(), and operator()().
double MatrixVariablesGrid::operator() | ( | uint | pointIdx, |
uint | rowIdx, | ||
uint | colIdx | ||
) | const [inline, inherited] |
[in] | pointIdx | Index of grid point. |
[in] | rowIdx | Row index of the component to be returned. |
[in] | colIdx | Column index of the component to be returned. |
References ASSERT, Grid::getNumPoints(), and MatrixVariablesGrid::values.
[in] | pointIdx | Index of grid point. |
[in] | rowIdx | Row index of the component to be returned. |
References operator()().
VariablesGrid VariablesGrid::operator() | ( | const uint | rowIdx | ) | const |
[in] | rowIdx | Row index of the component to be returned. |
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] |
[in] | arg | Second summand. |
References ASSERT, Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.
VariablesGrid VariablesGrid::operator+ | ( | const VariablesGrid & | arg | ) | const [inline] |
[in] | arg | Second summand. |
MatrixVariablesGrid & MatrixVariablesGrid::operator+= | ( | const MatrixVariablesGrid & | arg | ) | [inline, inherited] |
[in] | arg | Second summand. |
References ASSERT, Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.
VariablesGrid & VariablesGrid::operator+= | ( | const VariablesGrid & | arg | ) | [inline] |
[in] | arg | Second summand. |
MatrixVariablesGrid MatrixVariablesGrid::operator- | ( | const MatrixVariablesGrid & | arg | ) | const [inline, inherited] |
[in] | arg | Subtrahend. |
References ASSERT, Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.
VariablesGrid VariablesGrid::operator- | ( | const VariablesGrid & | arg | ) | const [inline] |
[in] | arg | Subtrahend. |
MatrixVariablesGrid & MatrixVariablesGrid::operator-= | ( | const MatrixVariablesGrid & | arg | ) | [inline, inherited] |
[in] | arg | Subtrahend. |
References ASSERT, Grid::getNumPoints(), uint, and MatrixVariablesGrid::values.
VariablesGrid & VariablesGrid::operator-= | ( | const VariablesGrid & | arg | ) | [inline] |
[in] | arg | Subtrahend. |
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).
[in] | rhs | Object of comparison. |
References BT_FALSE, BT_TRUE, Grid::findTime(), Grid::getNumPoints(), Grid::times, and uint.
BooleanType Grid::operator<= | ( | const Grid & | arg | ) | const [inline, inherited] |
VariablesGrid & VariablesGrid::operator= | ( | const VariablesGrid & | rhs | ) |
[in] | rhs | Right-hand side object. |
Referenced by operator=().
VariablesGrid & VariablesGrid::operator= | ( | const MatrixVariablesGrid & | rhs | ) |
[in] | rhs | Right-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.
[in] | rhs | File to be read. |
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.
[in] | rhs | Matrix to be read. |
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.
[in] | rhs | Object of comparison. |
References acadoIsEqual(), BT_FALSE, BT_TRUE, Grid::getNumPoints(), Grid::getTime(), and uint.
BooleanType VariablesGrid::operator== | ( | const VariablesGrid & | arg | ) | const [inline] |
[in] | rhs | Object of comparison. |
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).
[in] | rhs | Object of comparison. |
References BT_FALSE, BT_TRUE, Grid::findTime(), Grid::getNumPoints(), Grid::times, and uint.
BooleanType Grid::operator>= | ( | const Grid & | arg | ) | const [inline, inherited] |
VariablesGrid VariablesGrid::operator[] | ( | const uint | pointIdx | ) | const |
[in] | pointIdx | Index of 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] |
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.
[in] | name | Name label to be printed before the numerical values. |
[in] | startString | Prefix before printing the numerical values. |
[in] | endString | Suffix after printing the numerical values. |
[in] | width | Total number of digits per single numerical value. |
[in] | precision | Number of decimals per single numerical value. |
[in] | colSeparator | Separator between the columns of the numerical values. |
[in] | rowSeparator | Separator between the rows of the numerical values. |
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.
[in] | name | Name label to be printed before the numerical values. |
[in] | printScheme | Print scheme defining the output format of the information. |
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.
[in] | filename | Filename for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | startString | Prefix before printing the numerical values. |
[in] | endString | Suffix after printing the numerical values. |
[in] | width | Total number of digits per single numerical value. |
[in] | precision | Number of decimals per single numerical value. |
[in] | colSeparator | Separator between the columns of the numerical values. |
[in] | rowSeparator | Separator between the rows of the numerical values. |
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.
[in] | file | File for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | startString | Prefix before printing the numerical values. |
[in] | endString | Suffix after printing the numerical values. |
[in] | width | Total number of digits per single numerical value. |
[in] | precision | Number of decimals per single numerical value. |
[in] | colSeparator | Separator between the columns of the numerical values. |
[in] | rowSeparator | Separator between the rows of the numerical values. |
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.
[in] | filename | Filename for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | printScheme | Print scheme defining the output format of the information. |
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.
[in] | filen | File for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | printScheme | Print scheme defining the output format of the information. |
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.
[in,out] | string | File for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | startString | Prefix before printing the numerical values. |
[in] | endString | Suffix after printing the numerical values. |
[in] | width | Total number of digits per single numerical value. |
[in] | precision | Number of decimals per single numerical value. |
[in] | colSeparator | Separator between the columns of the numerical values. |
[in] | rowSeparator | Separator between the rows of the numerical values. |
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.
[in,out] | string | File for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | printScheme | Print scheme defining the output format of the information. |
References getGlobalStringDefinitions(), MatrixVariablesGrid::printToString(), SUCCESSFUL_RETURN, and uint.
returnValue Grid::refineGrid | ( | uint | factor | ) | [inherited] |
[in] | factor | Refinement factor. |
References ACADOERROR, Grid::getIntervalLength(), Grid::getLastTime(), Grid::getNumIntervals(), Grid::getTime(), Grid::nPoints, RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, Grid::times, and uint.
returnValue MatrixVariablesGrid::refineGrid | ( | const Grid & | arg, |
InterpolationMode | mode = IM_CONSTANT |
||
) | [inherited] |
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.
[in] | arg | Grid to be used for refinement. |
[in] | mode | Interpolation mode, see documentation of InterpolationMode. |
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] |
[in] | scaling | Positive scaling factor. |
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] |
[in] | _value | New value. |
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] |
[in] | _value | New matrix. |
References ACADO_TRY, Grid::getNumPoints(), MatrixVariablesGrid::setMatrix(), SUCCESSFUL_RETURN, and uint.
returnValue VariablesGrid::setAllVectors | ( | const Vector & | _values | ) |
[in] | _value | New vector. |
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] |
[in] | pointIdx | Index of grid point. |
[in] | _autoInit | New auto initialization flag. |
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] |
[in] | pointIdx | Index of grid point. |
[in] | valueIdx | Index of component. |
[in] | _lb | New lower bound. |
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] |
[in] | pointIdx | Index of grid point. |
[in] | _lb | New lower 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] |
[in] | pointIdx | Index of grid point. |
[in] | _value | New matrix. |
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] |
[in] | pointIdx | Index of grid point. |
[in] | idx | Index of component. |
[in] | _name | New name label of given component at given grid point. |
References ACADOERROR, Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, VariableSettings::setName(), and MatrixVariablesGrid::values.
returnValue MatrixVariablesGrid::setScaling | ( | uint | pointIdx, |
const VectorspaceElement & | _scaling | ||
) | [inline, inherited] |
[in] | pointIdx | Index of grid point. |
[in] | _scaling | New scaling. |
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] |
[in] | pointIdx | Index of grid point. |
[in] | valueIdx | Index of component. |
[in] | _scaling | New scaling. |
References ACADOERROR, MatrixVariablesGrid::getDim(), Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, VariableSettings::setScaling(), SUCCESSFUL_RETURN, and MatrixVariablesGrid::values.
returnValue Grid::setTime | ( | double | _time | ) | [inherited] |
[in] | _time | New time point. |
References ACADOERROR, acadoIsStrictlyGreater(), BT_TRUE, Grid::findNextIndex(), RET_GRIDPOINT_HAS_INVALID_TIME, RET_GRIDPOINT_SETUP_FAILED, SUCCESSFUL_RETURN, and Grid::times.
Referenced by Actuator::delayActuatorInput(), Sensor::delaySensorOutput(), StaticReferenceTrajectory::getReference(), Grid::getSubGrid(), TransferDevice::init(), Process::init(), MatrixVariablesGrid::operator=(), SimulationEnvironment::step(), and VariablesGrid().
returnValue Grid::setTime | ( | uint | pointIdx, |
double | _time | ||
) | [inherited] |
[in] | pointIdx | Index of grid point. |
[in] | _time | New time. |
References ACADOERROR, Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, SUCCESSFUL_RETURN, and Grid::times.
returnValue MatrixVariablesGrid::setType | ( | VariableType | _type | ) | [inline, inherited] |
[in] | _type | Type of the variable(s). |
References Grid::getNumPoints(), SUCCESSFUL_RETURN, and uint.
Referenced by PlotWindow::getDataGrids(), SimulationEnvironment::getFeedbackControl(), SimulationEnvironment::getFeedbackParameter(), SimulationEnvironment::getProcessAlgebraicStates(), SimulationEnvironment::getProcessDifferentialStates(), SimulationEnvironment::getProcessIntermediateStates(), and SimulationEnvironment::getSampledProcessOutput().
returnValue MatrixVariablesGrid::setType | ( | uint | pointIdx, |
VariableType | _type | ||
) | [inline, inherited] |
[in] | pointIdx | Index of grid point. |
[in] | _type | New type of the variable(s). |
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] |
[in] | pointIdx | Index of grid point. |
[in] | idx | Index of component. |
[in] | _unit | New unit label of given component at given grid point. |
References ACADOERROR, Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, VariableSettings::setUnit(), and MatrixVariablesGrid::values.
returnValue Grid::setupEquidistant | ( | double | _firstTime, |
double | _lastTime | ||
) | [protected, inherited] |
[in] | _firstTime | Time of first grid point. |
[in] | _lastTime | Time 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] |
[in] | pointIdx | Index of grid point. |
[in] | valueIdx | Index of component. |
[in] | _ub | New upper bound. |
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] |
[in] | pointIdx | Index of grid point. |
[in] | _ub | New upper bounds. |
References ACADOERROR, Grid::getNumPoints(), RET_INDEX_OUT_OF_BOUNDS, VariableSettings::setUpperBounds(), and MatrixVariablesGrid::values.
returnValue VariablesGrid::setVector | ( | uint | pointIdx, |
const Vector & | _values | ||
) |
[in] | pointIdx | Index of grid point. |
[in] | _value | New vector. |
pointIdx | Index of the grid point. |
_values | New 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] |
References Grid::getNumPoints(), SUCCESSFUL_RETURN, uint, and MatrixVariablesGrid::values.
Referenced by TransferDevice::generateNoise(), ColoredNoise::init(), and Process::setDynamicSystem().
VariablesGrid & VariablesGrid::shiftBackwards | ( | Vector | lastValue = emptyVector | ) |
References BT_FALSE, VectorspaceElement::getDim(), VectorspaceElement::isEmpty(), and Matrix::setCol().
Referenced by OCPiterate::shift().
MatrixVariablesGrid & MatrixVariablesGrid::shiftBackwards | ( | Matrix | lastValue = emptyMatrix | ) | [inherited] |
References BT_FALSE, Grid::getNumIntervals(), Grid::getNumPoints(), VectorspaceElement::isEmpty(), uint, and MatrixVariablesGrid::values.
VariablesGrid & VariablesGrid::shiftTimes | ( | double | timeShift | ) |
[in] | timeShift | Time offset for shifting. |
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).
[in,out] | buffer | Buffer for printing. |
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().
returnValue operator<< | ( | FILE * | file, |
VariablesGrid & | arg | ||
) | [friend] |
[in] | file | File to print to. |
[in] | arg | VariablesGrid to print. |
returnValue operator<< | ( | FILE * | file, |
MatrixVariablesGrid & | arg | ||
) | [friend, inherited] |
[in] | file | File to print to. |
[in] | arg | MatrixVariablesGrid to print. |
friend class OptimizationAlgorithm [friend] |
friend class OptimizationAlgorithmBase [friend] |
friend class RealTimeAlgorithm [friend] |
uint Grid::nPoints [protected, inherited] |
Referenced by MatrixVariablesGrid::addMatrix(), Grid::addTime(), MatrixVariablesGrid::clearValues(), Grid::getIntervalLength(), Grid::getLastTime(), Grid::getNumIntervals(), Grid::getNumPoints(), Grid::Grid(), Grid::init(), MatrixVariablesGrid::init(), MatrixVariablesGrid::initMatrixVariables(), Grid::isEmpty(), MatrixVariablesGrid::MatrixVariablesGrid(), Grid::operator=(), MatrixVariablesGrid::operator=(), Grid::refineGrid(), Grid::scaleTimes(), MatrixVariablesGrid::setLowerBounds(), Grid::setupEquidistant(), and Grid::shiftTimes().
double* Grid::times [protected, inherited] |
Referenced by Grid::addTime(), Grid::findFirstTime(), Grid::findLastTime(), Grid::findNextIndex(), Grid::getFirstTime(), MatrixVariablesGrid::getGrid(), Grid::getIntervalLength(), Grid::getLastTime(), Grid::getTime(), Grid::Grid(), Grid::init(), Grid::isInInterval(), Grid::isInLowerHalfOpenInterval(), Grid::isInUpperHalfOpenInterval(), Grid::operator<(), Grid::operator=(), Grid::operator>(), Grid::refineGrid(), Grid::scaleTimes(), Grid::setTime(), Grid::setupEquidistant(), Grid::shiftTimes(), MatrixVariablesGrid::sprintf(), and Grid::~Grid().
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().