Public Member Functions | Protected Attributes | List of all members

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]

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 ()
 
const std::string getNameSolveTransposeReuseFunction ()
 
bool getReuse () const
 
bool getTranspose () const
 
bool getUnrolling () const
 
returnValue init (const uint newDim, const bool &reuse=true, const bool &unrolling=false)
 
returnValue init (const uint newDim, const uint _nRightHandSides, 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 init (unsigned _nRows, unsigned _nCols, unsigned _nBacksolves, unsigned _nRightHandSides, bool _reuse, bool _unroll, const std::string &_id)
 
returnValue setReuse (const bool &reuse)
 
returnValue setTranspose (const bool &transpose)
 
returnValue setUnrolling (const bool &unrolling)
 
virtual returnValue setup ()=0
 
virtual ~ExportLinearSolver ()
 
- Public Member Functions inherited from ExportAlgorithm
 ExportAlgorithm (UserInteraction *_userInteraction=0, const std::string &_commonHeaderName=std::string())
 
uint getN () const
 
uint getNDX () const
 
uint getNOD () const
 
uint getNP () const
 
uint getNU () const
 
uint getNX () const
 
uint getNXA () const
 
uint getNY () const
 
uint getNYN () const
 
returnValue setDimensions (uint _NX=0, uint _NU=0, uint _NP=0, uint _NI=0, uint _NOD=0)
 
returnValue setDimensions (uint _NX, uint _NDX, uint _NXA, uint _NU, uint _NP, uint _NI, uint _NOD)
 
void setNY (uint NY_)
 
void setNYN (uint NYN_)
 
virtual ~ExportAlgorithm ()
 
- Public Member Functions inherited from AlgorithmicBase
int addLogRecord (LogRecord &_record)
 
returnValue addOption (OptionsName name, int value)
 
returnValue addOption (OptionsName name, double value)
 
returnValue addOption (uint idx, OptionsName name, int value)
 
returnValue addOption (uint idx, OptionsName name, double value)
 
returnValue addOptionsList ()
 
 AlgorithmicBase ()
 
 AlgorithmicBase (UserInteraction *_userInteraction)
 
 AlgorithmicBase (const AlgorithmicBase &rhs)
 
returnValue get (OptionsName name, int &value) const
 
returnValue get (OptionsName name, double &value) const
 
returnValue get (OptionsName name, std::string &value) const
 
returnValue get (uint idx, OptionsName name, int &value) const
 
returnValue get (uint idx, OptionsName name, double &value) const
 
returnValue getAll (LogName _name, MatrixVariablesGrid &values) const
 
returnValue getFirst (LogName _name, DMatrix &firstValue) const
 
returnValue getFirst (LogName _name, VariablesGrid &firstValue) const
 
returnValue getLast (LogName _name, DMatrix &lastValue) const
 
returnValue getLast (LogName _name, VariablesGrid &lastValue) const
 
Options getOptions (uint idx) const
 
BooleanType haveOptionsChanged () const
 
BooleanType haveOptionsChanged (uint idx) const
 
AlgorithmicBaseoperator= (const AlgorithmicBase &rhs)
 
returnValue plot (PlotFrequency _frequency=PLOT_IN_ANY_CASE)
 
returnValue printLogRecord (std::ostream &_stream, int idx, LogPrintMode _mode=PRINT_ITEM_BY_ITEM) const
 
returnValue replot (PlotFrequency _frequency=PLOT_IN_ANY_CASE)
 
returnValue set (OptionsName name, int value)
 
returnValue set (OptionsName name, double value)
 
returnValue set (OptionsName name, const std::string &value)
 
returnValue set (uint idx, OptionsName name, int value)
 
returnValue set (uint idx, OptionsName name, double value)
 
returnValue setAll (LogName _name, const MatrixVariablesGrid &values)
 
returnValue setLast (LogName _name, int lastValue, double time=-INFTY)
 
returnValue setLast (LogName _name, double lastValue, double time=-INFTY)
 
returnValue setLast (LogName _name, const DVector &lastValue, double time=-INFTY)
 
returnValue setLast (LogName _name, const DMatrix &lastValue, double time=-INFTY)
 
returnValue setLast (LogName _name, const VariablesGrid &lastValue, double time=-INFTY)
 
returnValue setOptions (const Options &arg)
 
returnValue setOptions (uint idx, const Options &arg)
 
virtual ~AlgorithmicBase ()
 

Protected Attributes

ExportVariable A
 
ExportVariable b
 
ExportVariable determinant
 
uint dim
 
std::string identifier
 
unsigned nBacksolves
 
unsigned nCols
 
unsigned nRightHandSides
 
unsigned nRows
 
bool REUSE
 
ExportFunction solve
 
ExportFunction solveReuse
 
ExportFunction solveReuseTranspose
 
ExportFunction solveTriangular
 
bool TRANSPOSE
 
bool UNROLLING
 
- Protected Attributes inherited from ExportAlgorithm
std::string commonHeaderName
 
uint N
 
uint NDX
 
uint NOD
 
uint NP
 
uint NU
 
uint NX
 
uint NXA
 
uint NY
 
uint NYN
 
- Protected Attributes inherited from AlgorithmicBase
int outputLoggingIdx
 
BooleanType useModuleStandalone
 
UserInteractionuserInteraction
 

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.

    @param[in] _userInteraction             Pointer to corresponding user interface.
    @param[in] _commonHeaderName    Name of common header file to be included.

Definition at line 45 of file linear_solver_export.cpp.

ExportLinearSolver::~ExportLinearSolver ( )
virtual

Destructor.

Definition at line 58 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.

@param[in] string                           The string to which the names of the used variables are appended.

\return SUCCESSFUL_RETURN

Implemented in ExportIRK3StageSimplifiedNewton, ExportIRK4StageSimplifiedNewton, ExportCholeskySolver, ExportGaussElim, and ExportHouseholderQR.

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

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

@param[in] code                             Code block containing the auto-generated algorithm.

\return SUCCESSFUL_RETURN

Implements ExportAlgorithm.

Implemented in ExportIRK3StageSimplifiedNewton, ExportIRK4StageSimplifiedNewton, ExportIRK3StageSingleNewton, ExportIRK4StageSingleNewton, 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.

@param[in] declarations             List of declarations.

\return SUCCESSFUL_RETURN

Implements ExportAlgorithm.

Implemented in ExportIRK3StageSimplifiedNewton, ExportIRK4StageSimplifiedNewton, ExportIRK3StageSingleNewton, ExportIRK4StageSingleNewton, ExportCholeskySolver, ExportGaussElim, and ExportHouseholderQR.

uint ExportLinearSolver::getDim ( ) const

Returns the dimensions of the linear system.

Returns
The dimensions of the linear system.

Definition at line 127 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.

@param[in] declarations             List of declarations.

\return SUCCESSFUL_RETURN

Implements ExportAlgorithm.

Implemented in ExportIRK3StageSimplifiedNewton, ExportIRK4StageSimplifiedNewton, ExportIRK3StageSingleNewton, ExportIRK4StageSingleNewton, ExportCholeskySolver, ExportGaussElim, and ExportHouseholderQR.

ExportVariable ExportLinearSolver::getGlobalExportVariable ( const uint  factor) const
virtual

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 192 of file linear_solver_export.cpp.

const std::string ExportLinearSolver::getNameSolveFunction ( )

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 175 of file linear_solver_export.cpp.

const std::string ExportLinearSolver::getNameSolveReuseFunction ( )

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 181 of file linear_solver_export.cpp.

const std::string ExportLinearSolver::getNameSolveTransposeReuseFunction ( )

Definition at line 187 of file linear_solver_export.cpp.

bool ExportLinearSolver::getReuse ( ) const

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 133 of file linear_solver_export.cpp.

bool ExportLinearSolver::getTranspose ( ) const

Returns a boolean that is true when an extra algorithm will be exported for solving a transposed linear system based on reuse.

Returns
A boolean that is true when an extra algorithm will be exported for solving a transposed linear system based on reuse.

Definition at line 147 of file linear_solver_export.cpp.

bool ExportLinearSolver::getUnrolling ( ) const

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

@param[in] newDim           The dimensions of the linear system.
@param[in] reuse            A 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.
@param[in] unrolling        A boolean that is true when the exported code for the linear solver needs to be unrolled
                                            completely.

\return SUCCESSFUL_RETURN

Definition at line 62 of file linear_solver_export.cpp.

returnValue ExportLinearSolver::init ( const uint  newDim,
const uint  _nRightHandSides,
const bool &  reuse = true,
const bool &  unrolling = false 
)
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.

@param[in] newDim           The dimensions of the linear system.
@param[in] reuse            A 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.
@param[in] unrolling        A boolean that is true when the exported code for the linear solver needs to be unrolled
                                            completely.
@param[in] newId            The new identifier for this linear solver to be exported.

\return SUCCESSFUL_RETURN

Definition at line 80 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 89 of file linear_solver_export.cpp.

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

Definition at line 100 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.

@param[in] reuse            The new value of this boolean.
Returns
SUCCESSFUL_RETURN

Definition at line 139 of file linear_solver_export.cpp.

returnValue ExportLinearSolver::setTranspose ( const bool &  transpose)

Sets the boolean that is true when an extra algorithm will be exported for solving a transposed linear system based on reuse.

@param[in] transpose                The new value of this boolean.
Returns
SUCCESSFUL_RETURN

Definition at line 153 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 167 of file linear_solver_export.cpp.

virtual returnValue ExportLinearSolver::setup ( )
pure virtual

Member Data Documentation

ExportVariable ExportLinearSolver::A
protected

Variable containing the matrix of the linear system.

Definition at line 290 of file linear_solver_export.hpp.

ExportVariable ExportLinearSolver::b
protected

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

Definition at line 291 of file linear_solver_export.hpp.

ExportVariable ExportLinearSolver::determinant
protected

Variable containing the matrix determinant.

Definition at line 298 of file linear_solver_export.hpp.

uint ExportLinearSolver::dim
protected

The dimensions of the linear system.

Definition at line 282 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 277 of file linear_solver_export.hpp.

unsigned ExportLinearSolver::nBacksolves
protected

Number of back-solves.

Definition at line 286 of file linear_solver_export.hpp.

unsigned ExportLinearSolver::nCols
protected

Number of columns of matrix A.

Definition at line 285 of file linear_solver_export.hpp.

unsigned ExportLinearSolver::nRightHandSides
protected

Number of back-solves.

Definition at line 287 of file linear_solver_export.hpp.

unsigned ExportLinearSolver::nRows
protected

Number of rows of matrix A.

Definition at line 284 of file linear_solver_export.hpp.

bool ExportLinearSolver::REUSE
protected

The boolean that defines the reuse.

Definition at line 280 of file linear_solver_export.hpp.

ExportFunction ExportLinearSolver::solve
protected

Function that solves the linear system.

Definition at line 293 of file linear_solver_export.hpp.

ExportFunction ExportLinearSolver::solveReuse
protected

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

Definition at line 295 of file linear_solver_export.hpp.

ExportFunction ExportLinearSolver::solveReuseTranspose
protected

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

Definition at line 296 of file linear_solver_export.hpp.

ExportFunction ExportLinearSolver::solveTriangular
protected

Function that solves the upper-triangular system.

Definition at line 294 of file linear_solver_export.hpp.

bool ExportLinearSolver::TRANSPOSE
protected

Definition at line 281 of file linear_solver_export.hpp.

bool ExportLinearSolver::UNROLLING
protected

The boolean that defines the unrolling.

Definition at line 279 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 Mon Jun 10 2019 12:35:24