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

Defines a scalar-valued index variable to be used for exporting code. More...

#include <export_index.hpp>

Inheritance diagram for ExportIndex:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ExportIndex ()
 ExportIndex (const int _value)
 ExportIndex (const String &_name, const String &_prefix=emptyConstString)
ExportIndexNodeoperator-> ()
 An operator for access to functions and members of the node.
const ExportIndexNodeoperator-> () 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)

Detailed Description

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:

Author:
Hans Joachim Ferreau, Boris Houska, Milan Vukov

Constructor & Destructor Documentation

ExportIndex::ExportIndex ( const int  _value)
ExportIndex::ExportIndex ( const String _name,
const String _prefix = emptyConstString 
) [explicit]

Member Function Documentation

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.

Parameters:
[in]fileName of file to be used to export function.
[in]_realStringString to be used to declare real variables.
[in]_intStringString to be used to declare integer variables.
[in]_precisionNumber of digits to be used for exporting real values.
Returns:
SUCCESSFUL_RETURN

Reimplemented from ExportData.

const String ExportIndex::get ( ) const
ExportStruct ExportData::getDataStruct ( ) const [inherited]
Returns:
Global data struct to which the data object belongs to

Referenced by ExportStatementBlock::addDeclaration(), and ExportNLPSolver::setObjective().

String ExportData::getDataStructString ( ) const [inherited]
Returns:
String containing the global data struct to which the data object belongs to.

Referenced by ExportGaussNewtonForces::setupQPInterface(), and ExportNLPSolver::setupSimulation().

String ExportData::getDoc ( ) const [virtual, inherited]

Referenced by makeArgument().

String ExportData::getFullName ( ) const [inherited]
Returns:
Full name of the data object

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().

String ExportData::getName ( ) const [inherited]
String ExportData::getPrefix ( ) const [inherited]
Returns:
Prefix name

Referenced by operator*(), operator+(), and operator-().

ExportType ExportData::getType ( ) const [inherited]
Returns:
Data type of the data object
String ExportData::getTypeString ( const String _realString = "real_t",
const String _intString = "int" 
) const [inherited]
Parameters:
[in]_realStringString to be used to declare real variables.
[in]_intStringString to be used to declare integer variables.
Returns:
String containing the data type of the data object.
BooleanType ExportData::isGiven ( ) [virtual, inherited]
Returns:
BT_TRUE iff index is set to a given value,
BT_FALSE otherwise

Referenced by operator*(), operator+(), and operator-().

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]
Parameters:
[in]_dataStructNew global data struct to which the data object belongs to.
Returns:
SUCCESSFUL_RETURN

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]
returnValue ExportData::setName ( const String _name) [inherited]
returnValue ExportData::setPrefix ( const String _prefix) [inherited]
Parameters:
[in]_prefixPrefix name.
Returns:
SUCCESSFUL_RETURN
returnValue ExportData::setType ( ExportType  _type) [inherited]
Parameters:
[in]_typeNew data type of the data object.
Returns:
SUCCESSFUL_RETURN

Friends And Related Function Documentation

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]

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