Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends

Allows to export code of different arithmetic statements. More...

#include <export_arithmetic_statement.hpp>

Inheritance diagram for ExportArithmeticStatement:
Inheritance graph
[legend]

List of all members.

Public Member Functions

ExportArithmeticStatementallocate (MemoryAllocatorPtr allocator)
virtual ExportStatementclone () 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 ()

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

Protected Attributes

ExportVariable lhs
MemoryAllocatorPtr memAllocator
ExportStatementOperator op0
ExportStatementOperator op1
ExportStatementOperator op2
ExportVariable rhs1
ExportVariable rhs2
ExportVariable rhs3

Private Member Functions

std::string getAssignString () const
uint getNumCols () const
uint getNumRows () const

Friends

class ExportVariable

Detailed Description

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 "-".

Author:
Hans Joachim Ferreau, Boris Houska, Milan Vukov

Definition at line 59 of file export_arithmetic_statement.hpp.


Constructor & Destructor Documentation

Default constructor.

Definition at line 46 of file export_arithmetic_statement.cpp.

Constructor which takes all expressions and operators of the arithmetic statement.

Parameters:
[in]_lhsLeft-hand side expressions
[in]_op0Operator between left- and right-hand side expression.
[in]_rhs1First right-hand side expression.
[in]_op1Operator between first and second right-hand side expression.
[in]_rhs2Second right-hand side expression of arithmetic statement.
[in]_op2Operator between second and third right-hand side expression.
[in]_rhs3Third right-hand side expression.

Definition at line 53 of file export_arithmetic_statement.cpp.

Destructor.

Definition at line 75 of file export_arithmetic_statement.cpp.


Member Function Documentation

Set a memory allocator.

Reimplemented from ExportStatement.

Definition at line 660 of file export_arithmetic_statement.cpp.

Clone constructor (deep copy).

Returns:
Pointer to cloned object.

Implements ExportStatement.

Definition at line 78 of file export_arithmetic_statement.cpp.

returnValue ExportArithmeticStatement::exportCode ( std::ostream &  stream,
const std::string &  _realString = "real_t",
const std::string &  _intString = "int",
int  _precision = 16 
) const [virtual]

Exports source code of the statement into given file. Its appearance can can be adjusted by various options.

Parameters:
[in]streamName of file to be used to export statement.
[in]_realStringstd::string to be used to declare real variables.
[in]_intStringstd::string to be used to declare integer variables.
[in]_precisionNumber of digits to be used for exporting real values.
Returns:
SUCCESSFUL_RETURN

Implements ExportStatement.

Definition at line 118 of file export_arithmetic_statement.cpp.

returnValue ExportArithmeticStatement::exportCodeAddSubtract ( std::ostream &  stream,
const std::string &  _sign = "+",
const std::string &  _realString = "real_t",
const std::string &  _intString = "int" 
) const [protected]

Exports source code for an addition or subtraction to given file. Its appearance can be adjusted by various options.

Parameters:
[in]streamName of file to be used to export statement.
[in]_signstd::string of the operation ("+" or "-").
[in]_realStringstd::string to be used to declare real variables.
[in]_intStringstd::string to be used to declare integer variables.
[in]_precisionNumber of digits to be used for exporting real values.
Returns:
SUCCESSFUL_RETURN

Definition at line 178 of file export_arithmetic_statement.cpp.

returnValue ExportArithmeticStatement::exportCodeAssign ( std::ostream &  stream,
const std::string &  _op = "=",
const std::string &  _realString = "real_t",
const std::string &  _intString = "int" 
) const [protected]

Exports source code for an assignment to given file. Its appearance can be adjusted by various options.

Parameters:
[in]streamName of file to be used to export statement.
[in]_opstd::string of the assignment operation ("=", "+=" or "-=").
[in]_realStringstd::string to be used to declare real variables.
[in]_intStringstd::string to be used to declare integer variables.
[in]_precisionNumber of digits to be used for exporting real values.
Returns:
SUCCESSFUL_RETURN

Definition at line 548 of file export_arithmetic_statement.cpp.

returnValue ExportArithmeticStatement::exportCodeMultiply ( std::ostream &  stream,
bool  transposeRhs1 = false,
const std::string &  _realString = "real_t",
const std::string &  _intString = "int" 
) const [protected]

Exports source code for a multiplication to given file. Its appearance can be adjusted by various options.

Parameters:
[in]streamName of file to be used to export statement.
[in]transposeRhs1Flag indicating whether rhs1 shall be transposed.
[in]_realStringstd::string to be used to declare real variables.
[in]_intStringstd::string to be used to declare integer variables.
[in]_precisionNumber of digits to be used for exporting real values.
Returns:
SUCCESSFUL_RETURN

Definition at line 288 of file export_arithmetic_statement.cpp.

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

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

Parameters:
[in]streamName of file to be used to export statement.
[in]_realStringstd::string to be used to declare real variables.
[in]_intStringstd::string to be used to declare integer variables.
[in]_precisionNumber of digits to be used for exporting real values.
Returns:
SUCCESSFUL_RETURN

Reimplemented from ExportStatement.

Definition at line 108 of file export_arithmetic_statement.cpp.

std::string ExportArithmeticStatement::getAssignString ( ) const [private]

Definition at line 642 of file export_arithmetic_statement.cpp.

Definition at line 96 of file export_arithmetic_statement.cpp.

Definition at line 84 of file export_arithmetic_statement.cpp.


Friends And Related Function Documentation

friend class ExportVariable [friend]

Definition at line 61 of file export_arithmetic_statement.hpp.


Member Data Documentation

Left-hand side expression of arithmetic statement.

Definition at line 194 of file export_arithmetic_statement.hpp.

Definition at line 203 of file export_arithmetic_statement.hpp.

Operator between left- and right-hand side expression of arithmetic statement.

Definition at line 199 of file export_arithmetic_statement.hpp.

Operator between first and second right-hand side expression of arithmetic statement.

Definition at line 200 of file export_arithmetic_statement.hpp.

Operator between second and third right-hand side expression of arithmetic statement.

Definition at line 201 of file export_arithmetic_statement.hpp.

First right-hand side expression of arithmetic statement.

Definition at line 195 of file export_arithmetic_statement.hpp.

Second right-hand side expression of arithmetic statement.

Definition at line 196 of file export_arithmetic_statement.hpp.

Third right-hand side expression of arithmetic statement.

Definition at line 197 of file export_arithmetic_statement.hpp.


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


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:40:23