humoto
Public Member Functions | Protected Attributes | List of all members
humoto::SolutionStructure Class Reference

Detailed Description

Analog of 'sol_structure' struct in Octave code. [determine_solution_structure.m].

Definition at line 33 of file solution.h.

#include <solution.h>

Inheritance diagram for humoto::SolutionStructure:
Inheritance graph

Public Member Functions

 SolutionStructure ()
 Default constructor. More...
 
virtual ~SolutionStructure ()
 Virtual destructor. More...
 
void addSolutionPart (const std::string &id, const std::size_t length)
 Add part of the solution. More...
 
Eigen::Block< Eigen::MatrixXd > getMatrixPart (const std::string &id, Eigen::MatrixXd &matrix) const
 Get part of a matrix corresponding to given part of the solution. More...
 
const Eigen::Block< const Eigen::MatrixXd > getMatrixPart (const std::string &id, const Eigen::MatrixXd &matrix) const
 Get part of a matrix corresponding to given part of the solution. More...
 
std::size_t getNumberOfVariables () const
 Get total number of variables in the solution vector. More...
 
Location getSolutionPartLocation (const std::string &id) const
 Get location of a data in the solution vector. More...
 
bool isNonEmpty () const
 Checks if the structure is empty or not. More...
 
void reset ()
 Reset. More...
 

Protected Attributes

std::size_t number_of_variables_
 
std::map< std::string, Locationvariable_map_
 

Constructor & Destructor Documentation

◆ ~SolutionStructure()

virtual humoto::SolutionStructure::~SolutionStructure ( )
inlinevirtual

Virtual destructor.

Definition at line 44 of file solution.h.

◆ SolutionStructure()

humoto::SolutionStructure::SolutionStructure ( )
inline

Default constructor.

Definition at line 50 of file solution.h.

Member Function Documentation

◆ addSolutionPart()

void humoto::SolutionStructure::addSolutionPart ( const std::string &  id,
const std::size_t  length 
)
inline

Add part of the solution.

Parameters
[in]idstring id of the solution part
[in]lengthlength of the solution part

Definition at line 72 of file solution.h.

◆ getMatrixPart() [1/2]

Eigen::Block<Eigen::MatrixXd> humoto::SolutionStructure::getMatrixPart ( const std::string &  id,
Eigen::MatrixXd &  matrix 
) const
inline

Get part of a matrix corresponding to given part of the solution.

Parameters
[in]idid of the data block
[in]matrixmatrix
Returns

Definition at line 147 of file solution.h.

◆ getMatrixPart() [2/2]

const Eigen::Block<const Eigen::MatrixXd> humoto::SolutionStructure::getMatrixPart ( const std::string &  id,
const Eigen::MatrixXd &  matrix 
) const
inline

Get part of a matrix corresponding to given part of the solution.

Parameters
[in]idid of the data block
[in]matrixmatrix
Returns

Definition at line 163 of file solution.h.

◆ getNumberOfVariables()

std::size_t humoto::SolutionStructure::getNumberOfVariables ( ) const
inline

Get total number of variables in the solution vector.

Returns
number of variables.
Attention
This method should be called only after addition of all solution parts.

Definition at line 109 of file solution.h.

◆ getSolutionPartLocation()

Location humoto::SolutionStructure::getSolutionPartLocation ( const std::string &  id) const
inline

Get location of a data in the solution vector.

Parameters
[in]idid of the data block
Returns
Location

Definition at line 122 of file solution.h.

◆ isNonEmpty()

bool humoto::SolutionStructure::isNonEmpty ( ) const
inline

Checks if the structure is empty or not.

Returns
true / false

Definition at line 88 of file solution.h.

◆ reset()

void humoto::SolutionStructure::reset ( )
inline

Reset.

Definition at line 59 of file solution.h.

Member Data Documentation

◆ number_of_variables_

std::size_t humoto::SolutionStructure::number_of_variables_
protected

Definition at line 36 of file solution.h.

◆ variable_map_

std::map<std::string, Location> humoto::SolutionStructure::variable_map_
protected

Definition at line 37 of file solution.h.


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