humoto
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
humoto::quadprogpp::Solution Class Referenceabstract

Detailed Description

Solution of a QP.

Definition at line 19 of file solution.h.

#include <solution.h>

Inheritance diagram for humoto::quadprogpp::Solution:
Inheritance graph

Public Member Functions

void addSolutionPart (const std::string &id, const std::size_t length)
 Add part of the solution. More...
 
const Eigen::VectorXd & get_x () const
 Returns solution vector. More...
 
Eigen::VectorBlock< Eigen::VectorXd > getData (const Location &location)
 Get data from solution vector. More...
 
Eigen::VectorXd getData (const Location &location) const
 Get data from solution vector. 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...
 
Eigen::VectorBlock< Eigen::VectorXd > getSolutionPart (const std::string &id)
 Get part of the solution by its id. More...
 
Eigen::VectorXd getSolutionPart (const std::string &id) const
 Get part of the solution by its id. More...
 
Location getSolutionPartLocation (const std::string &id) const
 Get location of a data in the solution vector. More...
 
std::string getStatusDescription () const
 Status description. More...
 
void initialize (const SolutionStructure &sol_structure)
 Initialize the solution vector. More...
 
void initialize (const SolutionStructure &sol_structure, const double value)
 Initialize the solution vector. More...
 
void initialize (const SolutionStructure &sol_structure, const Solution &old_solution)
 Initialize the solution vector using an old solution. More...
 
bool isNonEmpty () const
 Checks if the structure is empty or not. More...
 
void log (humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="solution") const
 Log a QP problem. More...
 
void readConfig (t_Reader &reader, const bool crash_on_missing_entry=default_crash_on_missing_entry_)
 Read configuration (assuming the configuration node to be in the root). More...
 
void readConfig (t_Reader &reader, const std::string &node_name, const bool crash_on_missing_entry=default_crash_on_missing_entry_)
 Read configuration (assuming the configuration node to be in the root). More...
 
void readConfig (t_Reader &reader, const char *node_name, const bool crash_on_missing_entry=default_crash_on_missing_entry_)
 Read configuration (assuming the configuration node to be in the root). More...
 
void readConfig (const std::string &file_name, const bool crash_on_missing_entry=default_crash_on_missing_entry_)
 Read configuration (assuming the configuration node to be in the root). More...
 
void readConfig (const std::string &file_name, const std::string &node_name, const bool crash_on_missing_entry=default_crash_on_missing_entry_)
 Read configuration (assuming the configuration node to be in the root). More...
 
void readConfig (const std::string &file_name, const char *node_name, const bool crash_on_missing_entry=default_crash_on_missing_entry_)
 Read configuration (assuming the configuration node to be in the root). More...
 
void readNestedConfig (t_Reader &reader, const std::string &node_name, const bool crash_on_missing_entry=default_crash_on_missing_entry_)
 Read nested configuration node. More...
 
void reset ()
 Reset. More...
 
void setDefaults ()
 No defaults. More...
 
void writeConfig (t_Writer &writer) const
 Write configuration. More...
 
void writeConfig (t_Writer &writer, const std::string &node_name) const
 Write configuration. More...
 
void writeConfig (const std::string &file_name) const
 Write configuration. More...
 
void writeConfig (const std::string &file_name, const std::string &node_name) const
 Write configuration. More...
 
void writeNestedConfig (t_Writer &writer) const
 Write nested configuration node. More...
 
void writeNestedConfig (t_Writer &writer, const std::string &node_name) const
 Write nested configuration node. More...
 

Public Attributes

double quadprogpp_return_value_
 The return value of quadprogpp. More...
 
SolverStatus::Status return_status_
 
Eigen::VectorXd x_
 

Protected Member Functions

virtual void finalize ()
 This function is called automaticaly after reading a configuration file. Does nothing by default. More...
 
virtual const std::string & getConfigSectionID () const=0
 Return the default name of a configuration node corresponding to this class. More...
 
virtual std::size_t getNumberOfEntries () const=0
 Get number of entries in the corresponding configuration node. More...
 

Protected Attributes

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

Static Protected Attributes

static const bool default_crash_on_missing_entry_
 

Member Function Documentation

◆ addSolutionPart()

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

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.

◆ finalize()

virtual void humoto::config::CommonConfigurableBase< t_crash_on_missing_entry >::finalize ( )
inlineprotectedvirtualinherited

This function is called automaticaly after reading a configuration file. Does nothing by default.

Reimplemented in humoto::WeightedSimpleTaskBaseMixin< constraints::ConstraintsGIB< TaskBase > >, humoto::WeightedSimpleTaskBaseMixin< constraints::ConstraintsGILU< TaskBase > >, humoto::WeightedSimpleTaskBaseMixin< constraints::ConstraintsGIL< TaskBase > >, humoto::WeightedSimpleTaskBaseMixin< constraints::ConstraintsGIU< TaskBase > >, humoto::WeightedSimpleTaskBaseMixin< constraints::ConstraintsGIB0< TaskBase > >, humoto::GeneralTaskBaseMixin< constraints::ConstraintsAB< TaskBase > >, humoto::GeneralTaskBaseMixin< constraints::ConstraintsAB0< TaskBase > >, humoto::GeneralTaskBaseMixin< constraints::ConstraintsASU< TaskBase > >, humoto::GeneralTaskBaseMixin< constraints::ConstraintsASL< TaskBase > >, humoto::GeneralTaskBaseMixin< constraints::ConstraintsASLU< TaskBase > >, humoto::GeneralTaskBaseMixin< constraints::ConstraintsAU< TaskBase > >, humoto::GeneralTaskBaseMixin< constraints::ConstraintsAL< TaskBase > >, humoto::GeneralTaskBaseMixin< constraints::ConstraintsASB< TaskBase > >, humoto::GeneralTaskBaseMixin< constraints::ConstraintsALU< TaskBase > >, humoto::GeneralTaskBaseMixin< constraints::ConstraintsASB0< TaskBase > >, humoto::pepper_mpc::MPCParameters, humoto::pepper_mpc::MotionParameters, humoto::walking::RobotFootParameters, humoto::wpg04::MPCParameters, humoto::pepper_mpc::RobotParameters, humoto::pepper_ik::WBCParameters, humoto::pepper_ik::GeneralizedCoordinates< t_features >, humoto::wpg04::TaskCoPPosition, humoto::wpg04::TaskCoMVelocity, humoto::wpg04::TaskCoPVelocity, and humoto::wpg04::TaskTerminalConstraint.

Definition at line 102 of file config.h.

◆ get_x()

const Eigen::VectorXd& humoto::Solution::get_x ( ) const
inlineinherited

Returns solution vector.

Returns
Solution vector (not a copy!)

Definition at line 337 of file solution.h.

◆ getConfigSectionID()

virtual const std::string& humoto::config::CommonConfigurableBase< t_crash_on_missing_entry >::getConfigSectionID ( ) const
protectedpure virtualinherited

Return the default name of a configuration node corresponding to this class.

Returns
the name
Attention
Implementation of this method is added automatically upon inclusion of define_accessors.h if HUMOTO_CONFIG_SECTION_ID is defined.

Implemented in humoto::TaskBase.

◆ getData() [1/2]

Eigen::VectorBlock<Eigen::VectorXd> humoto::Solution::getData ( const Location location)
inlineinherited

Get data from solution vector.

Parameters
[in]locationlocation of the data
Returns
data (not a copy!)

Definition at line 294 of file solution.h.

◆ getData() [2/2]

Eigen::VectorXd humoto::Solution::getData ( const Location location) const
inlineinherited

Get data from solution vector.

Parameters
[in]locationlocation of the data
Returns
data

Definition at line 323 of file solution.h.

◆ getMatrixPart() [1/2]

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

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
inlineinherited

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.

◆ getNumberOfEntries()

virtual std::size_t humoto::config::CommonConfigurableBase< t_crash_on_missing_entry >::getNumberOfEntries ( ) const
protectedpure virtualinherited

Get number of entries in the corresponding configuration node.

Returns
number of entries

Implemented in humoto::ConfigurableOptimizationProblem.

◆ getNumberOfVariables()

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

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.

◆ getSolutionPart() [1/2]

Eigen::VectorBlock<Eigen::VectorXd> humoto::Solution::getSolutionPart ( const std::string &  id)
inlineinherited

Get part of the solution by its id.

Parameters
[in]idid of the solution part
Returns
part of the solution (not a copy!)

Definition at line 281 of file solution.h.

◆ getSolutionPart() [2/2]

Eigen::VectorXd humoto::Solution::getSolutionPart ( const std::string &  id) const
inlineinherited

Get part of the solution by its id.

Parameters
[in]idid of the solution part
Returns
part of the solution

Definition at line 309 of file solution.h.

◆ getSolutionPartLocation()

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

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.

◆ getStatusDescription()

std::string humoto::quadprogpp::Solution::getStatusDescription ( ) const
inlinevirtual

Status description.

Returns
description of the status if available

Reimplemented from humoto::Solution.

Definition at line 32 of file solution.h.

◆ initialize() [1/3]

void humoto::Solution::initialize ( const SolutionStructure sol_structure)
inlineinherited

Initialize the solution vector.

Parameters
[in]sol_structurestructure of the solution

Definition at line 214 of file solution.h.

◆ initialize() [2/3]

void humoto::Solution::initialize ( const SolutionStructure sol_structure,
const double  value 
)
inlineinherited

Initialize the solution vector.

Parameters
[in]sol_structurestructure of the solution
[in]value

Definition at line 229 of file solution.h.

◆ initialize() [3/3]

void humoto::Solution::initialize ( const SolutionStructure sol_structure,
const Solution old_solution 
)
inlineinherited

Initialize the solution vector using an old solution.

Parameters
[in]sol_structurestructure of the solution
[in]old_solutionold solution

Definition at line 251 of file solution.h.

◆ isNonEmpty()

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

Checks if the structure is empty or not.

Returns
true / false

Definition at line 88 of file solution.h.

◆ log()

void humoto::quadprogpp::Solution::log ( humoto::Logger logger,
const LogEntryName parent = LogEntryName(),
const std::string &  name = "solution" 
) const
inlinevirtual

Log a QP problem.

Parameters
[in,out]loggerlogger
[in]parentparent
[in]namename

Reimplemented from humoto::Solution.

Definition at line 52 of file solution.h.

◆ readConfig() [1/6]

void humoto::config::CommonConfigurableBase< t_crash_on_missing_entry >::readConfig ( t_Reader &  reader,
const bool  crash_on_missing_entry = default_crash_on_missing_entry_ 
)
inlineinherited

Read configuration (assuming the configuration node to be in the root).

Parameters
[in]readerconfiguration reader
[in]crash_on_missing_entry

Definition at line 167 of file config.h.

◆ readConfig() [2/6]

void humoto::config::CommonConfigurableBase< t_crash_on_missing_entry >::readConfig ( t_Reader &  reader,
const std::string &  node_name,
const bool  crash_on_missing_entry = default_crash_on_missing_entry_ 
)
inlineinherited

Read configuration (assuming the configuration node to be in the root).

Parameters
[in]readerconfiguration reader
[in]crash_on_missing_entry
[in]node_namenode name, the default is used if empty

Definition at line 183 of file config.h.

◆ readConfig() [3/6]

void humoto::config::CommonConfigurableBase< t_crash_on_missing_entry >::readConfig ( t_Reader &  reader,
const char *  node_name,
const bool  crash_on_missing_entry = default_crash_on_missing_entry_ 
)
inlineinherited

Read configuration (assuming the configuration node to be in the root).

Parameters
[in]readerconfiguration reader
[in]crash_on_missing_entry
[in]node_namenode name, the default is used if empty
Note
Intercept implicit conversion of a pointer to bool.

Definition at line 202 of file config.h.

◆ readConfig() [4/6]

void humoto::config::CommonConfigurableBase< t_crash_on_missing_entry >::readConfig ( const std::string &  file_name,
const bool  crash_on_missing_entry = default_crash_on_missing_entry_ 
)
inlineinherited

Read configuration (assuming the configuration node to be in the root).

Parameters
[in]file_namefile name
[in]crash_on_missing_entry

Definition at line 218 of file config.h.

◆ readConfig() [5/6]

void humoto::config::CommonConfigurableBase< t_crash_on_missing_entry >::readConfig ( const std::string &  file_name,
const std::string &  node_name,
const bool  crash_on_missing_entry = default_crash_on_missing_entry_ 
)
inlineinherited

Read configuration (assuming the configuration node to be in the root).

Parameters
[in]file_namefile name
[in]node_namenode name, the default is used if empty
[in]crash_on_missing_entry

Definition at line 235 of file config.h.

◆ readConfig() [6/6]

void humoto::config::CommonConfigurableBase< t_crash_on_missing_entry >::readConfig ( const std::string &  file_name,
const char *  node_name,
const bool  crash_on_missing_entry = default_crash_on_missing_entry_ 
)
inlineinherited

Read configuration (assuming the configuration node to be in the root).

Parameters
[in]file_namefile name
[in]crash_on_missing_entry
[in]node_namenode name, the default is used if empty
Note
Intercept implicit conversion of a pointer to bool.

Definition at line 255 of file config.h.

◆ readNestedConfig()

void humoto::config::CommonConfigurableBase< t_crash_on_missing_entry >::readNestedConfig ( t_Reader &  reader,
const std::string &  node_name,
const bool  crash_on_missing_entry = default_crash_on_missing_entry_ 
)
inlineinherited

Read nested configuration node.

Parameters
[in]reader
[in]crash_on_missing_entry
[in]node_namenode name, the default is used if empty

Definition at line 132 of file config.h.

◆ reset()

void humoto::SolutionStructure::reset ( )
inlineinherited

Reset.

Definition at line 59 of file solution.h.

◆ setDefaults()

void humoto::Solution::setDefaults ( )
inlinevirtualinherited

No defaults.

Implements humoto::config::CommonConfigurableBase< true >.

Definition at line 206 of file solution.h.

◆ writeConfig() [1/4]

void humoto::config::CommonConfigurableBase< t_crash_on_missing_entry >::writeConfig ( t_Writer &  writer) const
inlineinherited

Write configuration.

Parameters
[in,out]writerconfiguration writer

Definition at line 300 of file config.h.

◆ writeConfig() [2/4]

void humoto::config::CommonConfigurableBase< t_crash_on_missing_entry >::writeConfig ( t_Writer &  writer,
const std::string &  node_name 
) const
inlineinherited

Write configuration.

Parameters
[in,out]writerconfiguration writer
[in]node_namenode name, the default is used if empty

Definition at line 313 of file config.h.

◆ writeConfig() [3/4]

void humoto::config::CommonConfigurableBase< t_crash_on_missing_entry >::writeConfig ( const std::string &  file_name) const
inlineinherited

Write configuration.

Parameters
[in]file_namefile name

Definition at line 328 of file config.h.

◆ writeConfig() [4/4]

void humoto::config::CommonConfigurableBase< t_crash_on_missing_entry >::writeConfig ( const std::string &  file_name,
const std::string &  node_name 
) const
inlineinherited

Write configuration.

Parameters
[in]file_namefile name
[in]node_namenode name, the default is used if empty

Definition at line 342 of file config.h.

◆ writeNestedConfig() [1/2]

void humoto::config::CommonConfigurableBase< t_crash_on_missing_entry >::writeNestedConfig ( t_Writer &  writer) const
inlineinherited

Write nested configuration node.

Parameters
[in,out]writerconfiguration writer

Definition at line 272 of file config.h.

◆ writeNestedConfig() [2/2]

void humoto::config::CommonConfigurableBase< t_crash_on_missing_entry >::writeNestedConfig ( t_Writer &  writer,
const std::string &  node_name 
) const
inlineinherited

Write nested configuration node.

Parameters
[in,out]writerconfiguration writer
[in]node_namenode name, the default is used if empty

Definition at line 285 of file config.h.

Member Data Documentation

◆ default_crash_on_missing_entry_

const bool humoto::config::CommonConfigurableBase< t_crash_on_missing_entry >::default_crash_on_missing_entry_
staticprotectedinherited

Definition at line 67 of file config.h.

◆ number_of_variables_

std::size_t humoto::SolutionStructure::number_of_variables_
protectedinherited

Definition at line 36 of file solution.h.

◆ quadprogpp_return_value_

double humoto::quadprogpp::Solution::quadprogpp_return_value_

The return value of quadprogpp.

Definition at line 23 of file solution.h.

◆ return_status_

SolverStatus::Status humoto::Solution::return_status_
inherited

Definition at line 187 of file solution.h.

◆ variable_map_

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

Definition at line 37 of file solution.h.

◆ x_

Eigen::VectorXd humoto::Solution::x_
inherited

Definition at line 186 of file solution.h.


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