Public Member Functions | Protected Member Functions | Protected Attributes | List of all members

Defines a matrix-valued variable that can be passed as argument to exported functions. More...

#include <export_argument_internal.hpp>

Inheritance diagram for ExportArgumentInternal:
Inheritance graph
[legend]

Public Member Functions

returnValue callByValue ()
 
virtual ExportArgumentInternalclone () const
 Make a deep copy of the instance. More...
 
virtual void deepCopyMembers (std::map< CasADi::SharedObjectNode *, CasADi::SharedObject > &already_copied)
 
 ExportArgumentInternal ()
 
 ExportArgumentInternal (const std::string &_name, const DMatrixPtr &_data, ExportType _type, ExportStruct _dataStruct, bool _callByValue, const ExportIndex &_addressIdx, const std::string &_prefix)
 
virtual returnValue exportDataDeclaration (std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
 
ExportArgument getAddress (const ExportIndex &rowIdx, const ExportIndex &colIdx=emptyConstExportIndex) const
 
const std::string getAddressString (bool withDataStruct=true) const
 
virtual uint getDim () const
 
virtual uint getNumCols () const
 
virtual uint getNumRows () const
 
bool isCalledByValue () const
 
virtual bool isGiven () const
 
virtual ~ExportArgumentInternal ()
 
- Public Member Functions inherited from ExportDataInternal
 ExportDataInternal (const std::string &_name=std::string(), ExportType _type=REAL, ExportStruct _dataStruct=ACADO_LOCAL, const std::string &_prefix=std::string())
 
ExportStruct getDataStruct () const
 
std::string getDataStructString () const
 
virtual std::string getDoc () const
 
std::string getFullName () const
 
std::string getName () const
 
std::string getPrefix () const
 
ExportType getType () const
 
std::string getTypeString (const std::string &_realString="real_t", const std::string &_intString="int") const
 
returnValue setDataStruct (ExportStruct _dataStruct)
 
virtual returnValue setDoc (const std::string &_doc)
 
returnValue setName (const std::string &_name)
 
returnValue setPrefix (const std::string &_prefix)
 
returnValue setType (ExportType _type)
 
virtual ~ExportDataInternal ()
 
- Public Member Functions inherited from CasADi::SharedObjectNode
void assertInit () const
 Assert that the object has been initialized. More...
 
int getCount () const
 Get the reference count. More...
 
virtual void init ()
 Initialize the object. More...
 
bool isInit () const
 Check if the object has been initialized. More...
 
SharedObjectNodeoperator= (const SharedObjectNode &node)
 Assignment operator. More...
 
virtual void print (std::ostream &stream) const
 Print a destription of the object. More...
 
virtual void repr (std::ostream &stream) const
 Print a representation of the object. More...
 
 SharedObjectNode ()
 Default constructor. More...
 
 SharedObjectNode (const SharedObjectNode &node)
 Copy constructor. More...
 
virtual ~SharedObjectNode ()=0
 Destructor. More...
 

Protected Member Functions

virtual uint getColDim () const
 
virtual ExportIndex getTotalIdx (const ExportIndex &rowIdx, const ExportIndex &colIdx) const
 
- Protected Member Functions inherited from ExportDataInternal
returnValue setFullName (void)
 
- Protected Member Functions inherited from CasADi::SharedObjectNode
template<class B >
shared_from_this ()
 Get a shared object from the current internal object. More...
 
template<class B >
const B shared_from_this () const
 Get a shared object from the current internal object. More...
 

Protected Attributes

ExportIndex addressIdx
 
bool callItByValue
 
DMatrixPtr data
 
- Protected Attributes inherited from ExportDataInternal
ExportStruct dataStruct
 
std::string description
 
std::string fullName
 
std::string name
 
std::string prefix
 
ExportType type
 
- Protected Attributes inherited from CasADi::SharedObjectNode
bool is_init_
 Has the function been initialized? More...
 

Additional Inherited Members

- Static Public Attributes inherited from ExportDataInternal
static std::string fcnPrefix = "acado"
 

Detailed Description

Defines a matrix-valued variable that can be passed as argument to exported functions.

The class ExportArgumentInternal defines a matrix-valued variable that can be passed as argument to exported functions. By default, all entries of an arguments are undefined, but each of its component can be set to a fixed value if known beforehand.

Author
Hans Joachim Ferreau, Boris Houska, Milan Vukov

Definition at line 63 of file export_argument_internal.hpp.

Constructor & Destructor Documentation

ExportArgumentInternal::ExportArgumentInternal ( )

Default constructor.

Definition at line 51 of file export_argument_internal.cpp.

ExportArgumentInternal::ExportArgumentInternal ( const std::string &  _name,
const DMatrixPtr _data,
ExportType  _type,
ExportStruct  _dataStruct,
bool  _callByValue,
const ExportIndex _addressIdx,
const std::string &  _prefix 
)

Constructor which takes the name and type of the argument. Moreover, it initializes the argument with the dimensions and the values of the given matrix.

Parameters
[in]_nameName of the argument.
[in]_dataDMatrix used for initialization.
[in]_typeData type of the argument.
[in]_dataStructGlobal data struct to which the argument belongs to (if any).
[in]_callByValueFlag indicating whether argument it to be called by value.
[in]_addressIdxIf an address index is specified, not the argument itself but a pointer to this address within the memory of the argument is passed.

Definition at line 58 of file export_argument_internal.cpp.

ExportArgumentInternal::~ExportArgumentInternal ( )
virtual

Destructor.

Definition at line 73 of file export_argument_internal.cpp.

Member Function Documentation

returnValue ExportArgumentInternal::callByValue ( )

Specifies to call argument by value.

\return SUCCESSFUL_RETURN

Definition at line 178 of file export_argument_internal.cpp.

ExportArgumentInternal * ExportArgumentInternal::clone ( ) const
virtual

Make a deep copy of the instance.

Implements ExportDataInternal.

Reimplemented in ExportVariableInternal.

Definition at line 76 of file export_argument_internal.cpp.

void ExportArgumentInternal::deepCopyMembers ( std::map< CasADi::SharedObjectNode *, CasADi::SharedObject > &  already_copied)
virtual

Deep copy data members.

Reimplemented from CasADi::SharedObjectNode.

Definition at line 81 of file export_argument_internal.cpp.

returnValue ExportArgumentInternal::exportDataDeclaration ( std::ostream &  stream,
const std::string &  _realString = "real_t",
const std::string &  _intString = "int",
int  _precision = 16 
) const
virtual

Exports declaration of the argument into given file. Its appearance can can be adjusted by various options.

@param[in] stream                   Name of file to be used to export declaration.
@param[in] _realString              std::string to be used to declare real variables.
@param[in] _intString               std::string to be used to declare integer variables.
@param[in] _precision               Number of digits to be used for exporting real values.

\return SUCCESSFUL_RETURN

Implements ExportDataInternal.

Definition at line 185 of file export_argument_internal.cpp.

ExportArgument ExportArgumentInternal::getAddress ( const ExportIndex rowIdx,
const ExportIndex colIdx = emptyConstExportIndex 
) const

Returns a copy of the argument with address index set to given location.

@param[in] rowIdx           Row index of the adress.
@param[in] colIdx           Column index of the adress.

\return Copy of the argument with address index set to given location

Definition at line 87 of file export_argument_internal.cpp.

const std::string ExportArgumentInternal::getAddressString ( bool  withDataStruct = true) const

Returns a string containing the address of the argument to be called. If an address index has been set, the string contains a pointer to the desired location. The string also depends on whether the argument is to be called by value or not.

Returns
std::string containing the address of the argument

Definition at line 108 of file export_argument_internal.cpp.

uint ExportArgumentInternal::getColDim ( ) const
protectedvirtual

Returns column dimension of the argument.

\return Column dimension of the argument

Reimplemented in ExportVariableInternal.

Definition at line 273 of file export_argument_internal.cpp.

uint ExportArgumentInternal::getDim ( ) const
virtual

Returns total dimension of the argument.

\return Total dimension of the argument

Reimplemented in ExportVariableInternal.

Definition at line 148 of file export_argument_internal.cpp.

uint ExportArgumentInternal::getNumCols ( ) const
virtual

Returns number of columns of the argument.

\return Number of columns of the argument

Reimplemented in ExportVariableInternal.

Definition at line 142 of file export_argument_internal.cpp.

uint ExportArgumentInternal::getNumRows ( ) const
virtual

Returns number of rows of the argument.

\return Number of rows of the argument

Reimplemented in ExportVariableInternal.

Definition at line 136 of file export_argument_internal.cpp.

ExportIndex ExportArgumentInternal::getTotalIdx ( const ExportIndex rowIdx,
const ExportIndex colIdx 
) const
protectedvirtual

Returns total index of given component within memory.

@param[in] rowIdx           Row index of the component.
@param[in] colIdx           Column index of the component.

\return Total index of given component

Reimplemented in ExportVariableInternal.

Definition at line 278 of file export_argument_internal.cpp.

bool ExportArgumentInternal::isCalledByValue ( ) const

Returns whether argument is to be called by value.

\return true  iff argument is to be called by value, \n
        false otherwise

Definition at line 172 of file export_argument_internal.cpp.

bool ExportArgumentInternal::isGiven ( ) const
virtual

Returns whether all components of the argument are given.

\return true  iff all components of the argument have given values, \n
        false otherwise

Implements ExportDataInternal.

Reimplemented in ExportVariableInternal.

Definition at line 154 of file export_argument_internal.cpp.

Member Data Documentation

ExportIndex ExportArgumentInternal::addressIdx
protected

Address index in case not the argument itself but a pointer to this address within the memory of the argument is to be passed.

Definition at line 209 of file export_argument_internal.hpp.

bool ExportArgumentInternal::callItByValue
protected

Flag indicating whether argument it to be called by value.

Definition at line 211 of file export_argument_internal.hpp.

DMatrixPtr ExportArgumentInternal::data
protected

DMatrix containing the values of each component of the argument (by default, all entries are undefined).

Definition at line 207 of file export_argument_internal.hpp.


The documentation for this class was generated from the following files:


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:23