ACADO Toolkit
1.2.0beta
Toolkit for Automatic Control and Dynamic Optimization
|
Defines a scalar-valued index variable to be used for exporting code. More...
#include <export_index.hpp>
Public Member Functions | |
ExportIndex () | |
ExportIndex (const int _value) | |
ExportIndex (const String &_name, const String &_prefix=emptyConstString) | |
ExportIndexNode * | operator-> () |
An operator for access to functions and members of the node. | |
const ExportIndexNode * | operator-> () const |
An operator for const access to functions and members of the node. | |
virtual returnValue | exportDataDeclaration (FILE *file, const String &_realString="real_t", const String &_intString="int", int _precision=16) const |
Exports declaration of the index variable. | |
const String | get () const |
Returns a string containing the value of the index. | |
int | getGivenValue () const |
Returns the given value of the index (if defined). | |
BooleanType | isGiven () const |
Returns whether the index is set to a given value. | |
BooleanType | isBinary () const |
BooleanType | isVariable () const |
ExportArgument | makeArgument () const |
Converts index into a calling argument. | |
returnValue | setName (const String &_name) |
Sets the name of the data object. | |
returnValue | setType (ExportType _type) |
Sets the data type of the data object. | |
returnValue | setDataStruct (ExportStruct _dataStruct) |
Sets the global data struct to which the data object belongs to. | |
returnValue | setPrefix (const String &_prefix) |
Sets the prefix which is placed before the structure name. | |
String | getName () const |
Returns the name of the data object. | |
ExportType | getType () const |
Returns the data type of the data object. | |
String | getTypeString (const String &_realString="real_t", const String &_intString="int") const |
Returns a string containing the data type of the data object. | |
ExportStruct | getDataStruct () const |
Returns the global data struct to which the data object belongs to. | |
String | getDataStructString () const |
Returns a string containing the global data struct to which the data object belongs to. | |
String | getPrefix () const |
Returns a string which contains a prefix name. | |
String | getFullName () const |
Returns the full name of the data object including the possible prefix of the global data struct. | |
virtual BooleanType | isGiven () |
Returns whether the index is set to a given value. | |
virtual returnValue | setDoc (const String &_doc) |
virtual String | getDoc () const |
Friends | |
ExportIndex | operator+ (const ExportIndex &_arg1, const ExportIndex &_arg2) |
ExportIndex | operator- (const ExportIndex &_arg1, const ExportIndex &_arg2) |
ExportIndex | operator* (const ExportIndex &_arg1, const ExportIndex &_arg2) |
ExportIndex | operator/ (const ExportIndex &_arg1, const ExportIndex &_arg2) |
ExportIndex | operator% (const ExportIndex &_arg1, const ExportIndex &_arg2) |
String | operator== (const ExportIndex &_arg1, const ExportIndex &_arg2) |
The class ExportIndex defines a scalar-valued index variable to be used for exporting code. Instances of this class can be used similar to usual integers but offer additional functionality, e.g. they allow to export arithmetic expressions involving indices of the form:
ExportIndex::ExportIndex | ( | const int | _value | ) |
ExportIndex::ExportIndex | ( | const String & | _name, |
const String & | _prefix = emptyConstString |
||
) | [explicit] |
returnValue ExportIndex::exportDataDeclaration | ( | FILE * | file, |
const String & | _realString = "real_t" , |
||
const String & | _intString = "int" , |
||
int | _precision = 16 |
||
) | const [virtual] |
Its appearance can can be adjusted by various options.
[in] | file | Name of file to be used to export function. |
[in] | _realString | String to be used to declare real variables. |
[in] | _intString | String to be used to declare integer variables. |
[in] | _precision | Number of digits to be used for exporting real values. |
Reimplemented from ExportData.
const String ExportIndex::get | ( | ) | const |
Referenced by ExportForLoop::exportCode(), ExportArithmeticStatement::exportCodeAssign(), ExportVariableInternal::get(), ExportArgumentInternal::getAddressString(), and operator==().
ExportStruct ExportData::getDataStruct | ( | ) | const [inherited] |
Referenced by ExportStatementBlock::addDeclaration(), and ExportNLPSolver::setObjective().
String ExportData::getDataStructString | ( | ) | const [inherited] |
Referenced by ExportGaussNewtonForces::setupQPInterface(), and ExportNLPSolver::setupSimulation().
String ExportData::getDoc | ( | ) | const [virtual, inherited] |
Referenced by makeArgument().
String ExportData::getFullName | ( | ) | const [inherited] |
Referenced by MemoryAllocator::add(), ExportGaussElim::appendVariableNames(), ImplicitRungeKuttaExport::evaluateDerivedPolynomial(), ImplicitRungeKuttaExport::evaluatePolynomial(), ExportArithmeticStatement::exportCode(), ExportArithmeticStatement::exportCodeAssign(), ExportGaussElim::getCode(), ExportHouseholderQR::getCode(), ForwardIRKExport::getCode(), AdjointIRKExport::getCode(), ExplicitRungeKuttaExport::getCode(), DiscreteTimeExport::getCode(), ImplicitRungeKuttaExport::getCode(), ExportAcadoFunction::init(), operator+(), operator-(), MemoryAllocator::release(), ForwardIRKExport::sensitivitiesImplicitSystem(), AdjointIRKExport::sensitivitiesImplicitSystem(), DiagonallyImplicitRKExport::sensitivitiesImplicitSystem(), ExportAcadoFunction::setGlobalExportVariable(), ExportNLPSolver::setupArrivalCostCalculation(), ExportNLPSolver::setupAuxiliaryFunctions(), ExportGaussNewtonForces::setupConstraintsEvaluation(), ExportGaussNewtonCN2::setupConstraintsEvaluation(), ExportGaussNewtonCondensed::setupConstraintsEvaluation(), ExportGaussNewtonQpDunes::setupEvaluation(), ExportGaussNewtonCN2::setupEvaluation(), ExportGaussNewtonForces::setupEvaluation(), ExportGaussNewtonCondensed::setupEvaluation(), ExportGaussNewtonForces::setupObjectiveEvaluation(), ExportGaussNewtonQpDunes::setupQPInterface(), ExportGaussNewtonCN2::setupQPInterface(), ExportGaussNewtonCondensed::setupQPInterface(), ExportNLPSolver::setupSimulation(), DiagonallyImplicitRKExport::solveImplicitSystem(), and ImplicitRungeKuttaExport::solveImplicitSystem().
int ExportIndex::getGivenValue | ( | ) | const |
Referenced by ExportForLoop::exportCode(), ExportVariableInternal::get(), ExportArgumentInternal::getAddress(), ExportArgumentInternal::getAddressString(), ExportVariableInternal::getCol(), ExportVariableInternal::getCols(), ExportVariableInternal::getRow(), ExportVariableInternal::getRows(), ExportVariableInternal::getSubMatrix(), ExportVariableInternal::hasValue(), makeArgument(), operator%(), operator*(), operator+(), operator-(), operator/(), and ExportVariableInternal::setSubmatrixOffsets().
String ExportData::getName | ( | ) | const [inherited] |
References String::getName().
Referenced by ImplicitRungeKuttaExport::evaluateDerivedPolynomial(), ImplicitRungeKuttaExport::evaluateMatrix(), ExportArithmeticStatement::exportCodeAddSubtract(), ExportArithmeticStatement::exportCodeAssign(), ExportArithmeticStatement::exportCodeMultiply(), ImplicitRungeKuttaExport::generateOutput(), ExportGaussElim::getCode(), AdjointIRKExport::getCode(), ForwardIRKExport::getCode(), ImplicitRungeKuttaExport::getCode(), ExportIndexComparator::operator()(), operator*(), operator+(), operator-(), AdjointIRKExport::propagateOutputs(), ForwardIRKExport::propagateOutputs(), ForwardIRKExport::sensitivitiesImplicitSystem(), AdjointIRKExport::sensitivitiesImplicitSystem(), DiagonallyImplicitRKExport::sensitivitiesImplicitSystem(), AdjointIRKExport::sensitivitiesInputSystem(), ForwardIRKExport::sensitivitiesInputSystem(), ForwardIRKExport::sensitivitiesOutputs(), AdjointIRKExport::sensitivitiesOutputs(), DiagonallyImplicitRKExport::sensitivitiesOutputSystem(), ForwardIRKExport::sensitivitiesOutputSystem(), AdjointIRKExport::sensitivitiesOutputSystem(), ExportNLPSolver::setObjective(), ExportCholeskyDecomposition::setup(), NARXExport::setup(), ExplicitRungeKuttaExport::setup(), DiscreteTimeExport::setup(), ExportNLPSolver::setupArrivalCostCalculation(), ExportGaussNewtonCN2::setupEvaluation(), ExportGaussNewtonCondensed::setupEvaluation(), and ExportNLPSolver::setupSimulation().
String ExportData::getPrefix | ( | ) | const [inherited] |
Referenced by operator*(), operator+(), and operator-().
ExportType ExportData::getType | ( | ) | const [inherited] |
String ExportData::getTypeString | ( | const String & | _realString = "real_t" , |
const String & | _intString = "int" |
||
) | const [inherited] |
BooleanType ExportIndex::isBinary | ( | ) | const |
BooleanType ExportIndex::isGiven | ( | ) | const |
Referenced by ExportForLoop::exportCode(), ExportVariableInternal::get(), ExportArgumentInternal::getAddress(), ExportArgumentInternal::getAddressString(), ExportVariableInternal::getCol(), ExportVariableInternal::getCols(), ExportVariableInternal::getRow(), ExportVariableInternal::getRows(), ExportVariableInternal::getSubMatrix(), ExportVariableInternal::hasValue(), makeArgument(), operator%(), operator*(), operator+(), operator-(), operator/(), and ExportVariableInternal::setSubmatrixOffsets().
BooleanType ExportData::isGiven | ( | ) | [virtual, inherited] |
BooleanType ExportIndex::isVariable | ( | ) | const |
Referenced by operator*(), operator+(), and operator-().
ExportArgument ExportIndex::makeArgument | ( | ) | const |
References ACADO_LOCAL, BT_TRUE, emptyConstExportIndex(), ExportData::getDoc(), getGivenValue(), String::getName(), isGiven(), and ExportData::setDoc().
Referenced by ExportNLPSolver::setupAuxiliaryFunctions(), ExportGaussNewtonCN2::setupCondensing(), ExportGaussNewtonCondensed::setupCondensing(), ExportGaussNewtonQpDunes::setupConstraintsEvaluation(), ExportGaussNewtonForces::setupConstraintsEvaluation(), ExportGaussNewtonCondensed::setupConstraintsEvaluation(), ExportGaussNewtonQpDunes::setupEvaluation(), ExportGaussNewtonForces::setupEvaluation(), ExportGaussNewtonCN2::setupMultiplicationRoutines(), ExportGaussNewtonCondensed::setupMultiplicationRoutines(), ExportGaussNewtonQpDunes::setupObjectiveEvaluation(), and ExportGaussNewtonForces::setupObjectiveEvaluation().
ExportIndexNode * ExportIndex::operator-> | ( | ) |
Reimplemented from ExportData.
Referenced by operator->().
const ExportIndexNode * ExportIndex::operator-> | ( | ) | const |
Reimplemented from ExportData.
References operator->().
returnValue ExportData::setDataStruct | ( | ExportStruct | _dataStruct | ) | [inherited] |
[in] | _dataStruct | New global data struct to which the data object belongs to. |
Referenced by AdjointIRKExport::getCode(), ForwardIRKExport::getCode(), DiscreteTimeExport::getCode(), ImplicitRungeKuttaExport::getCode(), ExportNLPSolver::setConstraints(), ExportNLPSolver::setObjective(), and ExplicitRungeKuttaExport::setup().
returnValue ExportData::setDoc | ( | const String & | _doc | ) | [virtual, inherited] |
Referenced by makeArgument(), ExportNLPSolver::setObjective(), NARXExport::setup(), ExplicitRungeKuttaExport::setup(), DiscreteTimeExport::setup(), ImplicitRungeKuttaExport::setup(), ExportNLPSolver::setupArrivalCostCalculation(), ExportNLPSolver::setupAuxiliaryFunctions(), ExportGaussNewtonCondensed::setupCondensing(), ExportGaussNewtonCN2::setupConstraintsEvaluation(), ExportGaussNewtonCondensed::setupConstraintsEvaluation(), ExportGaussNewtonQpDunes::setupEvaluation(), ExportGaussNewtonCN2::setupEvaluation(), ExportGaussNewtonForces::setupEvaluation(), ExportGaussNewtonCondensed::setupEvaluation(), ExportNLPSolver::setupResidualVariables(), ExportNLPSolver::setupSimulation(), ExportGaussNewtonQpDunes::setupVariables(), ExportGaussNewtonForces::setupVariables(), ExportGaussNewtonCN2::setupVariables(), and ExportGaussNewtonCondensed::setupVariables().
returnValue ExportData::setName | ( | const String & | _name | ) | [inherited] |
[in] | _name | New name of the data object. |
Referenced by AdjointIRKExport::getCode(), ForwardIRKExport::getCode(), DiscreteTimeExport::getCode(), ImplicitRungeKuttaExport::getCode(), ExportVariable::operator()(), ExportNLPSolver::setConstraints(), ExportNLPSolver::setObjective(), and ExplicitRungeKuttaExport::setup().
returnValue ExportData::setPrefix | ( | const String & | _prefix | ) | [inherited] |
[in] | _prefix | Prefix name. |
returnValue ExportData::setType | ( | ExportType | _type | ) | [inherited] |
[in] | _type | New data type of the data object. |
ExportIndex operator% | ( | const ExportIndex & | _arg1, |
const ExportIndex & | _arg2 | ||
) | [friend] |
ExportIndex operator* | ( | const ExportIndex & | _arg1, |
const ExportIndex & | _arg2 | ||
) | [friend] |
ExportIndex operator+ | ( | const ExportIndex & | _arg1, |
const ExportIndex & | _arg2 | ||
) | [friend] |
ExportIndex operator- | ( | const ExportIndex & | _arg1, |
const ExportIndex & | _arg2 | ||
) | [friend] |
ExportIndex operator/ | ( | const ExportIndex & | _arg1, |
const ExportIndex & | _arg2 | ||
) | [friend] |
String operator== | ( | const ExportIndex & | _arg1, |
const ExportIndex & | _arg2 | ||
) | [friend] |