Public Member Functions | Protected Attributes

Allows to export automatically generated algorithms for solving linear systems of specific dimensions. More...

#include <linear_solver_export.hpp>

Inheritance diagram for ExportLinearSolver:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual returnValue appendVariableNames (std::stringstream &string)=0
 ExportLinearSolver (UserInteraction *_userInteraction=0, const std::string &_commonHeaderName="")
virtual returnValue getCode (ExportStatementBlock &code)=0
virtual returnValue getDataDeclarations (ExportStatementBlock &declarations, ExportStruct dataStruct=ACADO_ANY) const =0
uint getDim () const
virtual returnValue getFunctionDeclarations (ExportStatementBlock &declarations) const =0
virtual ExportVariable getGlobalExportVariable (const uint factor) const
const std::string getNameSolveFunction ()
const std::string getNameSolveReuseFunction ()
bool getReuse () const
bool getUnrolling () const
returnValue init (const uint newDim, const bool &reuse=true, const bool &unrolling=false)
returnValue init (const uint newDim, const bool &reuse, const bool &unrolling, const std::string &newId)
returnValue init (unsigned _nRows, unsigned _nCols, unsigned _nBacksolves, bool _reuse, bool _unroll, const std::string &_id)
returnValue setReuse (const bool &reuse)
returnValue setUnrolling (const bool &unrolling)
virtual returnValue setup ()=0
virtual ~ExportLinearSolver ()

Protected Attributes

ExportVariable A
ExportVariable b
ExportVariable determinant
uint dim
std::string identifier
unsigned nBacksolves
unsigned nCols
unsigned nRows
bool REUSE
ExportFunction solve
ExportFunction solveReuse
ExportFunction solveTriangular
bool UNROLLING

Detailed Description

Allows to export automatically generated algorithms for solving linear systems of specific dimensions.

The class ExportLinearSolver allows to export automatically generated algorithms for solving linear systems of specific dimensions.

Author:
Rien Quirynen

Definition at line 62 of file linear_solver_export.hpp.


Constructor & Destructor Documentation

BEGIN_NAMESPACE_ACADO ExportLinearSolver::ExportLinearSolver ( UserInteraction _userInteraction = 0,
const std::string &  _commonHeaderName = "" 
)

Default constructor.

Parameters:
[in]_userInteractionPointer to corresponding user interface.
[in]_commonHeaderNameName of common header file to be included.

Definition at line 45 of file linear_solver_export.cpp.

Destructor.

Definition at line 57 of file linear_solver_export.cpp.


Member Function Documentation

virtual returnValue ExportLinearSolver::appendVariableNames ( std::stringstream &  string) [pure virtual]

Appends the names of the used variables to a given stringstream.

Parameters:
[in]stringThe string to which the names of the used variables are appended.
Returns:
SUCCESSFUL_RETURN

Implemented in ExportCholeskySolver, ExportGaussElim, and ExportHouseholderQR.

virtual returnValue ExportLinearSolver::getCode ( ExportStatementBlock code) [pure virtual]

Exports source code of the auto-generated algorithm into the given directory.

Parameters:
[in]codeCode block containing the auto-generated algorithm.
Returns:
SUCCESSFUL_RETURN

Implements ExportAlgorithm.

Implemented in ExportCholeskySolver, ExportGaussElim, and ExportHouseholderQR.

virtual returnValue ExportLinearSolver::getDataDeclarations ( ExportStatementBlock declarations,
ExportStruct  dataStruct = ACADO_ANY 
) const [pure virtual]

Adds all data declarations of the auto-generated algorithm to given list of declarations.

Parameters:
[in]declarationsList of declarations.
Returns:
SUCCESSFUL_RETURN

Implements ExportAlgorithm.

Implemented in ExportCholeskySolver, ExportGaussElim, and ExportHouseholderQR.

Returns the dimensions of the linear system.

Returns:
The dimensions of the linear system.

Definition at line 103 of file linear_solver_export.cpp.

virtual returnValue ExportLinearSolver::getFunctionDeclarations ( ExportStatementBlock declarations) const [pure virtual]

Adds all function (forward) declarations of the auto-generated algorithm to given list of declarations.

Parameters:
[in]declarationsList of declarations.
Returns:
SUCCESSFUL_RETURN

Implements ExportAlgorithm.

Implemented in ExportCholeskySolver, ExportGaussElim, and ExportHouseholderQR.

Returns the dimension of the auxiliary variables for the linear solver.

Returns:
The dimension of the auxiliary variables for the linear solver.

Reimplemented in ExportGaussElim, and ExportHouseholderQR.

Definition at line 148 of file linear_solver_export.cpp.

Returns a string containing the name of the function which is exported to solve the linear system.

Returns:
A string containing the name of the function which is exported to solve the linear system.

Definition at line 137 of file linear_solver_export.cpp.

Returns a string containing the name of the function which is exported to solve the linear system with the reuse of previous results.

Returns:
A string containing the name of the function which is exported to solve the linear system with the reuse of previous results.

Definition at line 143 of file linear_solver_export.cpp.

Returns a boolean that is true when an extra algorithm will be exported for reuse.

Returns:
A boolean that is true when an extra algorithm will be exported for reuse.

Definition at line 109 of file linear_solver_export.cpp.

Returns a boolean that is true when the exported code for the linear solver needs to be unrolled completely.

Returns:
A boolean that is true when the exported code for the linear solver needs to be unrolled completely.

Definition at line 123 of file linear_solver_export.cpp.

returnValue ExportLinearSolver::init ( const uint  newDim,
const bool &  reuse = true,
const bool &  unrolling = false 
)

Initializes the different parameters of the linear solver that will be exported.

Parameters:
[in]newDimThe dimensions of the linear system.
[in]reuseA boolean that is true when more than one system of linear equations with the same matrix needs to be solved. This means that an algorithm will be exported expecially for this case, with extra optimizations by reusing as many intermediate results as possible.
[in]unrollingA boolean that is true when the exported code for the linear solver needs to be unrolled completely.
Returns:
SUCCESSFUL_RETURN

Definition at line 61 of file linear_solver_export.cpp.

returnValue ExportLinearSolver::init ( const uint  newDim,
const bool &  reuse,
const bool &  unrolling,
const std::string &  newId 
)

Initializes the different parameters of the linear solver that will be exported.

Parameters:
[in]newDimThe dimensions of the linear system.
[in]reuseA boolean that is true when more than one system of linear equations with the same matrix needs to be solved. This means that an algorithm will be exported expecially for this case, with extra optimizations by reusing as many intermediate results as possible.
[in]unrollingA boolean that is true when the exported code for the linear solver needs to be unrolled completely.
[in]newIdThe new identifier for this linear solver to be exported.
Returns:
SUCCESSFUL_RETURN

Definition at line 70 of file linear_solver_export.cpp.

returnValue ExportLinearSolver::init ( unsigned  _nRows,
unsigned  _nCols,
unsigned  _nBacksolves,
bool  _reuse,
bool  _unroll,
const std::string &  _id 
)
Todo:
DOC

Definition at line 79 of file linear_solver_export.cpp.

returnValue ExportLinearSolver::setReuse ( const bool &  reuse)

Sets the boolean that is true when an extra algorithm will be exported for reuse.

Parameters:
[in]reuseThe new value of this boolean.
Returns:
SUCCESSFUL_RETURN

Definition at line 115 of file linear_solver_export.cpp.

returnValue ExportLinearSolver::setUnrolling ( const bool &  unrolling)

Sets the boolean that is true when the exported code for the linear solver needs to be unrolled completely.

Parameters:
[in]unrollingThe new value of this boolean.
Returns:
SUCCESSFUL_RETURN

Definition at line 129 of file linear_solver_export.cpp.

virtual returnValue ExportLinearSolver::setup ( ) [pure virtual]

Initializes code export into given file.

Returns:
SUCCESSFUL_RETURN

Reimplemented from ExportAlgorithm.

Implemented in ExportCholeskySolver, ExportGaussElim, and ExportHouseholderQR.


Member Data Documentation

Variable containing the matrix of the linear system.

Definition at line 256 of file linear_solver_export.hpp.

Variable containing the right-hand side of the linear system and it will also contain the solution.

Definition at line 257 of file linear_solver_export.hpp.

Variable containing the matrix determinant.

Definition at line 263 of file linear_solver_export.hpp.

The dimensions of the linear system.

Definition at line 249 of file linear_solver_export.hpp.

std::string ExportLinearSolver::identifier [protected]

This identifier allows the use of more than one exported linear solver.

Definition at line 245 of file linear_solver_export.hpp.

unsigned ExportLinearSolver::nBacksolves [protected]

Number of back-solves.

Definition at line 253 of file linear_solver_export.hpp.

unsigned ExportLinearSolver::nCols [protected]

Number of columns of matrix A.

Definition at line 252 of file linear_solver_export.hpp.

unsigned ExportLinearSolver::nRows [protected]

Number of rows of matrix A.

Definition at line 251 of file linear_solver_export.hpp.

bool ExportLinearSolver::REUSE [protected]

The boolean that defines the reuse.

Definition at line 248 of file linear_solver_export.hpp.

Function that solves the linear system.

Definition at line 259 of file linear_solver_export.hpp.

Function that solves a linear system with the same matrix, reusing previous results.

Definition at line 261 of file linear_solver_export.hpp.

Function that solves the upper-triangular system.

Definition at line 260 of file linear_solver_export.hpp.

The boolean that defines the unrolling.

Definition at line 247 of file linear_solver_export.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:24