Allows to export code of different arithmetic statements. More...
#include <export_arithmetic_statement.hpp>
Public Member Functions | |
ExportArithmeticStatement & | allocate (MemoryAllocatorPtr allocator) |
virtual ExportStatement * | clone () const |
ExportArithmeticStatement () | |
ExportArithmeticStatement (const ExportVariable &_lhs, ExportStatementOperator _op0, const ExportVariable &_rhs1, ExportStatementOperator _op1, const ExportVariable &_rhs2, ExportStatementOperator _op2=ESO_UNDEFINED, const ExportVariable &_rhs3=0) | |
virtual returnValue | exportCode (std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const |
virtual returnValue | exportDataDeclaration (std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const |
virtual | ~ExportArithmeticStatement () |
Public Member Functions inherited from ExportStatement | |
virtual ExportStatement & | acquire (ExportIndex &) |
ExportStatement () | |
ExportStatement (const ExportStatement &arg) | |
ExportStatement & | operator= (const ExportStatement &arg) |
virtual ExportStatement & | release (const ExportIndex &) |
virtual | ~ExportStatement () |
Protected Member Functions | |
returnValue | exportCodeAddSubtract (std::ostream &stream, const std::string &_sign="+", const std::string &_realString="real_t", const std::string &_intString="int") const |
returnValue | exportCodeAssign (std::ostream &stream, const std::string &_op="=", const std::string &_realString="real_t", const std::string &_intString="int") const |
returnValue | exportCodeMultiply (std::ostream &stream, bool transposeRhs1=false, const std::string &_realString="real_t", const std::string &_intString="int") const |
Private Member Functions | |
std::string | getAssignString () const |
uint | getNumCols () const |
uint | getNumRows () const |
Friends | |
class | ExportVariable |
Additional Inherited Members | |
Public Types inherited from ExportStatement | |
typedef std::shared_ptr< MemoryAllocator > | MemoryAllocatorPtr |
typedef std::shared_ptr< ExportStatement > | StatementPtr |
typedef std::vector< StatementPtr > | StatementPtrArray |
Static Public Attributes inherited from ExportStatement | |
static std::string | fcnPrefix = "acado" |
static std::string | varPrefix = "ACADO" |
Allows to export code of different arithmetic statements.
The class ExportArithmeticStatement allows to export code of different arithmetic statements of the form:
lhs <op0> rhs1 <op1> rhs2 <op2> rhs3,
where <op0> can be "=", "+=" or "-=", <op1> can be "+", "-" or "*" and <op2> can be "+" or "-".
Definition at line 59 of file export_arithmetic_statement.hpp.
BEGIN_NAMESPACE_ACADO ExportArithmeticStatement::ExportArithmeticStatement | ( | ) |
Default constructor.
Definition at line 46 of file export_arithmetic_statement.cpp.
ExportArithmeticStatement::ExportArithmeticStatement | ( | const ExportVariable & | _lhs, |
ExportStatementOperator | _op0, | ||
const ExportVariable & | _rhs1, | ||
ExportStatementOperator | _op1, | ||
const ExportVariable & | _rhs2, | ||
ExportStatementOperator | _op2 = ESO_UNDEFINED , |
||
const ExportVariable & | _rhs3 = 0 |
||
) |
Constructor which takes all expressions and operators of the arithmetic statement.
@param[in] _lhs Left-hand side expressions @param[in] _op0 Operator between left- and right-hand side expression. @param[in] _rhs1 First right-hand side expression. @param[in] _op1 Operator between first and second right-hand side expression. @param[in] _rhs2 Second right-hand side expression of arithmetic statement. @param[in] _op2 Operator between second and third right-hand side expression. @param[in] _rhs3 Third right-hand side expression.
Definition at line 53 of file export_arithmetic_statement.cpp.
|
virtual |
Destructor.
Definition at line 75 of file export_arithmetic_statement.cpp.
|
virtual |
Set a memory allocator.
Reimplemented from ExportStatement.
Definition at line 660 of file export_arithmetic_statement.cpp.
|
virtual |
Clone constructor (deep copy).
\return Pointer to cloned object.
Implements ExportStatement.
Definition at line 78 of file export_arithmetic_statement.cpp.
|
virtual |
Exports source code of the statement into given file. Its appearance can can be adjusted by various options.
@param[in] stream Name of file to be used to export statement. @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 ExportStatement.
Definition at line 118 of file export_arithmetic_statement.cpp.
|
protected |
Exports source code for an addition or subtraction to given file. Its appearance can be adjusted by various options.
@param[in] stream Name of file to be used to export statement. @param[in] _sign std::string of the operation ("+" or "-"). @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
Definition at line 178 of file export_arithmetic_statement.cpp.
|
protected |
Exports source code for an assignment to given file. Its appearance can be adjusted by various options.
@param[in] stream Name of file to be used to export statement. @param[in] _op std::string of the assignment operation ("=", "+=" or "-="). @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
Definition at line 548 of file export_arithmetic_statement.cpp.
|
protected |
Exports source code for a multiplication to given file. Its appearance can be adjusted by various options.
@param[in] stream Name of file to be used to export statement. @param[in] transposeRhs1 Flag indicating whether rhs1 shall be transposed. @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
Definition at line 288 of file export_arithmetic_statement.cpp.
|
virtual |
Exports data declaration of the statement into given file. Its appearance can can be adjusted by various options.
@param[in] stream Name of file to be used to export statement. @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
Reimplemented from ExportStatement.
Definition at line 108 of file export_arithmetic_statement.cpp.
|
private |
Definition at line 642 of file export_arithmetic_statement.cpp.
|
private |
Definition at line 96 of file export_arithmetic_statement.cpp.
|
private |
Definition at line 84 of file export_arithmetic_statement.cpp.
|
friend |
Definition at line 61 of file export_arithmetic_statement.hpp.
|
protected |
Left-hand side expression of arithmetic statement.
Definition at line 194 of file export_arithmetic_statement.hpp.
|
protected |
Definition at line 203 of file export_arithmetic_statement.hpp.
|
protected |
Operator between left- and right-hand side expression of arithmetic statement.
Definition at line 199 of file export_arithmetic_statement.hpp.
|
protected |
Operator between first and second right-hand side expression of arithmetic statement.
Definition at line 200 of file export_arithmetic_statement.hpp.
|
protected |
Operator between second and third right-hand side expression of arithmetic statement.
Definition at line 201 of file export_arithmetic_statement.hpp.
|
protected |
First right-hand side expression of arithmetic statement.
Definition at line 195 of file export_arithmetic_statement.hpp.
|
protected |
Second right-hand side expression of arithmetic statement.
Definition at line 196 of file export_arithmetic_statement.hpp.
|
protected |
Third right-hand side expression of arithmetic statement.
Definition at line 197 of file export_arithmetic_statement.hpp.