54 f = std::shared_ptr< Function >(
new Function( ));
61 const std::string& _name
84 const std::string& _name,
100 f = std::shared_ptr< Function >(
new Function( _f ));
112 const std::string& _realString,
113 const std::string& _intString,
119 stream << _realString <<
" " <<
f->getGlobalExportVariableName()
120 <<
"[ " <<
f->getGlobalExportVariableSize( ) <<
" ];" << std::endl;
127 const std::string& _realString,
128 const std::string& _intString,
138 stream <<
"/** An external function for evaluation of symbolic expressions. */" << endl;
139 stream <<
"void " <<
name <<
"(const " << _realString <<
"* in, " << _realString <<
"* out);" << endl;
144 return f->exportForwardDeclarations(stream,
name.c_str(), _realString.c_str());
149 const std::string& _realString,
150 const std::string& _intString,
157 return f->exportCode(
std::string getFullName() const
Allows to setup and evaluate a general function based on SymbolicExpressions.
ExportVariable getGlobalExportVariable() const
ExportVariable & setup(const std::string &_name, uint _nRows=1, uint _nCols=1, ExportType _type=REAL, ExportStruct _dataStruct=ACADO_LOCAL, bool _callItByValue=false, const std::string &_prefix=std::string())
returnValue init(const std::string &_name="defaultFunctionName", const ExportArgument &_argument1=emptyConstExportArgument, const ExportArgument &_argument2=emptyConstExportArgument, const ExportArgument &_argument3=emptyConstExportArgument, const ExportArgument &_argument4=emptyConstExportArgument, const ExportArgument &_argument5=emptyConstExportArgument, const ExportArgument &_argument6=emptyConstExportArgument, const ExportArgument &_argument7=emptyConstExportArgument, const ExportArgument &_argument8=emptyConstExportArgument, const ExportArgument &_argument9=emptyConstExportArgument)
Allows to pass back messages to the calling function.
std::shared_ptr< Function > f
virtual bool isDefined() const
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
virtual returnValue exportForwardDeclaration(std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
#define CLOSE_NAMESPACE_ACADO
unsigned getFunctionDim(void)
Defines a matrix-valued variable that can be passed as argument to exported functions.
virtual ExportStatement * clone() const
Base class for all kind of statements to be exported by the code generation tool. ...
Allows to export code of an arbitrary function.
virtual returnValue exportDataDeclaration(std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
virtual ~ExportAcadoFunction()
returnValue setGlobalExportVariable(const ExportVariable &var)
A deepcopy(const A &a)
Make a deep copy of an object (Note: default is a shallow copy!)
#define BEGIN_NAMESPACE_ACADO
virtual returnValue exportCode(std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
returnValue init(const Function &_f, const std::string &_name="acadoFcn", const uint _numX=0, const uint _numXA=0, const uint _numU=0, const uint _numP=0, const uint _numDX=0, const uint _numOD=0)
Defines a matrix-valued variable to be used for exporting code.