Defines a scalar-valued index variable to be used for exporting code. More...
#include <export_index.hpp>
Public Member Functions | |
virtual returnValue | exportDataDeclaration (std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const |
ExportIndex () | |
ExportIndex (const int _value) | |
ExportIndex (const std::string &_name, const std::string &_prefix=std::string()) | |
const std::string | get () const |
int | getGivenValue () const |
bool | isBinary () const |
bool | isGiven () const |
bool | isVariable () const |
operator ExportArgument () | |
ExportIndexNode * | operator-> () |
const ExportIndexNode * | operator-> () 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) |
std::string | operator== (const ExportIndex &_arg1, const ExportIndex &_arg2) |
Defines a scalar-valued index variable to be used for exporting code.
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:
Definition at line 54 of file export_index.hpp.
Definition at line 44 of file export_index.cpp.
ExportIndex::ExportIndex | ( | const int | _value | ) |
Definition at line 48 of file export_index.cpp.
ExportIndex::ExportIndex | ( | const std::string & | _name, |
const std::string & | _prefix = std::string() |
||
) | [explicit] |
Definition at line 53 of file export_index.cpp.
returnValue ExportIndex::exportDataDeclaration | ( | std::ostream & | stream, |
const std::string & | _realString = "real_t" , |
||
const std::string & | _intString = "int" , |
||
int | _precision = 16 |
||
) | const [virtual] |
Exports declaration of the index variable. Its appearance can can be adjusted by various options.
[in] | stream | Name of file to be used to export function. |
[in] | _realString | std::string to be used to declare real variables. |
[in] | _intString | std::string to be used to declare integer variables. |
[in] | _precision | Number of digits to be used for exporting real values. |
Reimplemented from ExportData.
Definition at line 72 of file export_index.cpp.
const std::string ExportIndex::get | ( | ) | const |
Returns a string containing the value of the index.
Reimplemented from CasADi::SharedObject.
Definition at line 246 of file export_index.cpp.
int ExportIndex::getGivenValue | ( | ) | const |
Returns the given value of the index (if defined).
Definition at line 252 of file export_index.cpp.
bool ExportIndex::isBinary | ( | ) | const |
Definition at line 263 of file export_index.cpp.
bool ExportIndex::isGiven | ( | ) | const |
Returns whether the index is set to a given value.
Definition at line 258 of file export_index.cpp.
bool ExportIndex::isVariable | ( | ) | const |
Definition at line 268 of file export_index.cpp.
ExportIndex::operator ExportArgument | ( | ) |
Definition at line 274 of file export_index.cpp.
ExportIndexNode * ExportIndex::operator-> | ( | ) |
An operator for access to functions and members of the node
Reimplemented from ExportData.
Definition at line 60 of file export_index.cpp.
const ExportIndexNode * ExportIndex::operator-> | ( | ) | const |
An operator for const access to functions and members of the node
Reimplemented from ExportData.
Definition at line 66 of file export_index.cpp.
ExportIndex operator% | ( | const ExportIndex & | _arg1, |
const ExportIndex & | _arg2 | ||
) | [friend] |
Definition at line 217 of file export_index.cpp.
ExportIndex operator* | ( | const ExportIndex & | _arg1, |
const ExportIndex & | _arg2 | ||
) | [friend] |
Definition at line 166 of file export_index.cpp.
ExportIndex operator+ | ( | const ExportIndex & | _arg1, |
const ExportIndex & | _arg2 | ||
) | [friend] |
Definition at line 82 of file export_index.cpp.
ExportIndex operator- | ( | const ExportIndex & | _arg1, |
const ExportIndex & | _arg2 | ||
) | [friend] |
Definition at line 125 of file export_index.cpp.
ExportIndex operator/ | ( | const ExportIndex & | _arg1, |
const ExportIndex & | _arg2 | ||
) | [friend] |
Definition at line 199 of file export_index.cpp.
std::string operator== | ( | const ExportIndex & | _arg1, |
const ExportIndex & | _arg2 | ||
) | [friend] |
Definition at line 235 of file export_index.cpp.