hpp-centroidal-dynamics: centroidal_dynamics::Solver_LP_abstract Class Reference

hpp-centroidal-dynamics 9.0.2 Utility classes for testing (robust) equilibrium of a system in contact with the environment, and other centroidal dynamics methods.

Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
centroidal_dynamics::Solver_LP_abstract Class Referenceabstract

Abstract interface for a Linear Program (LP) solver. More...

`#include <hpp/centroidal-dynamics/solver_LP_abstract.hh>`

## Public Member Functions
| Solver_LP_abstract ()
virtual | ~Solver_LP_abstract ()
virtual LP_status | solve (Cref_vectorX c, Cref_vectorX lb, Cref_vectorX ub, Cref_matrixXX A, Cref_vectorX Alb, Cref_vectorX Aub, Ref_vectorX sol)=0
virtual LP_status | solve (const std::string &filename, Ref_vectorX sol)
| Solve the linear program described in the specified file. More...
virtual bool | writeLpToFile (const std::string &filename, Cref_vectorX c, Cref_vectorX lb, Cref_vectorX ub, Cref_matrixXX A, Cref_vectorX Alb, Cref_vectorX Aub)
| Write the specified Linear Program to binary file. minimize c' x subject to Alb <= A x <= Aub lb <= x <= ub. More...
virtual bool | readLpFromFile (const std::string &filename, VectorX &c, VectorX &lb, VectorX &ub, MatrixXX &A, VectorX &Alb, VectorX &Aub)
| Read the data describing a Linear Program from the specified binary file. The vectors and matrices are resized inside the method. minimize c' x subject to Alb <= A x <= Aub lb <= x <= ub. More...
virtual LP_status | getStatus ()=0
virtual double | getObjectiveValue ()=0
virtual void | getDualSolution (Ref_vectorX res)=0
virtual bool | getUseWarmStart ()
virtual void | setUseWarmStart (bool useWarmStart)
virtual unsigned int | getMaximumIterations ()
virtual bool | setMaximumIterations (unsigned int maxIter)
virtual double | getMaximumTime ()
virtual bool | setMaximumTime (double seconds)

## Static Public Member Functions
static Solver_LP_abstract * | getNewSolver (SolverLP solverType)
| Create a new LP solver of the specified type. More...

## Protected Attributes
bool | m_useWarmStart
int | m_maxIter
double | m_maxTime

## Detailed Description

Abstract interface for a Linear Program (LP) solver.

## Constructor & Destructor Documentation

## ◆ Solver_LP_abstract()

centroidal_dynamics::Solver_LP_abstract::Solver_LP_abstract | ( |  | ) |
| inline

## ◆ ~Solver_LP_abstract()

virtual centroidal_dynamics::Solver_LP_abstract::~Solver_LP_abstract | ( |  | ) |
| inlinevirtual

## Member Function Documentation

## ◆ getDualSolution()

virtual void centroidal_dynamics::Solver_LP_abstract::getDualSolution | ( | Ref_vectorX | res | ) |
| pure virtual

Get the value of the dual variables.

## ◆ getMaximumIterations()

virtual unsigned int centroidal_dynamics::Solver_LP_abstract::getMaximumIterations | ( |  | ) |
| inlinevirtual

Get the current maximum number of iterations performed by the solver.

## ◆ getMaximumTime()

virtual double centroidal_dynamics::Solver_LP_abstract::getMaximumTime | ( |  | ) |
| inlinevirtual

Get the maximum time allowed to solve a problem.

## ◆ getNewSolver()

Solver_LP_abstract * centroidal_dynamics::Solver_LP_abstract::getNewSolver | ( | SolverLP | solverType | ) |
| static

Create a new LP solver of the specified type.

Parameters

  solverType | Type of LP solver.

Returns
  A pointer to the new solver.

## ◆ getObjectiveValue()

virtual double centroidal_dynamics::Solver_LP_abstract::getObjectiveValue | ( |  | ) |
| pure virtual

Get the objective value of the last solved problem.

## ◆ getStatus()

virtual LP_status centroidal_dynamics::Solver_LP_abstract::getStatus | ( |  | ) |
| pure virtual

Get the status of the solver.

## ◆ getUseWarmStart()

virtual bool centroidal_dynamics::Solver_LP_abstract::getUseWarmStart | ( |  | ) |
| inlinevirtual

Return true if the solver is allowed to warm start, false otherwise.

## ◆ readLpFromFile()

bool centroidal_dynamics::Solver_LP_abstract::readLpFromFile | ( | const std::string & | filename,
|  | VectorX & | c,
|  | VectorX & | lb,
|  | VectorX & | ub,
|  | MatrixXX & | A,
|  | VectorX & | Alb,
|  | VectorX & | Aub
| ) |  |
| virtual

Read the data describing a Linear Program from the specified binary file. The vectors and matrices are resized inside the method. minimize c' x subject to Alb <= A x <= Aub lb <= x <= ub.

Parameters

  filename |
  c |
  lb |
  ub |
  A |
  Alb |
  Aub |

Returns
  True if the operation succeeded, false otherwise.

## ◆ setMaximumIterations()

bool centroidal_dynamics::Solver_LP_abstract::setMaximumIterations | ( | unsigned int | maxIter | ) |
| virtual

Set the current maximum number of iterations performed by the solver.

## ◆ setMaximumTime()

bool centroidal_dynamics::Solver_LP_abstract::setMaximumTime | ( | double | seconds | ) |
| virtual

Set the maximum time allowed to solve a problem.

## ◆ setUseWarmStart()

virtual void centroidal_dynamics::Solver_LP_abstract::setUseWarmStart | ( | bool | useWarmStart | ) |
| inlinevirtual

Specify whether the solver is allowed to use warm-start techniques.

## ◆ solve() [1/2]

LP_status centroidal_dynamics::Solver_LP_abstract::solve | ( | const std::string & | filename,
|  | Ref_vectorX | sol
| ) |  |
| virtual

Solve the linear program described in the specified file.

Parameters

  filename | Name of the file containing the LP description.
  sol | Output solution of the LP.

Returns
  A flag describing the final status of the solver.

## ◆ solve() [2/2]

virtual LP_status centroidal_dynamics::Solver_LP_abstract::solve | ( | Cref_vectorX | c,
|  | Cref_vectorX | lb,
|  | Cref_vectorX | ub,
|  | Cref_matrixXX | A,
|  | Cref_vectorX | Alb,
|  | Cref_vectorX | Aub,
|  | Ref_vectorX | sol
| ) |  |
| pure virtual

Solve the linear program minimize c' x subject to Alb <= A x <= Aub lb <= x <= ub

## ◆ writeLpToFile()

bool centroidal_dynamics::Solver_LP_abstract::writeLpToFile | ( | const std::string & | filename,
|  | Cref_vectorX | c,
|  | Cref_vectorX | lb,
|  | Cref_vectorX | ub,
|  | Cref_matrixXX | A,
|  | Cref_vectorX | Alb,
|  | Cref_vectorX | Aub
| ) |  |
| virtual

Write the specified Linear Program to binary file. minimize c' x subject to Alb <= A x <= Aub lb <= x <= ub.

Parameters

  filename |
  c |
  lb |
  ub |
  A |
  Alb |
  Aub |

Returns
  True if the operation succeeded, false otherwise.

## Member Data Documentation

## ◆ m_maxIter

int centroidal_dynamics::Solver_LP_abstract::m_maxIter
| protected

## ◆ m_maxTime

double centroidal_dynamics::Solver_LP_abstract::m_maxTime
| protected

## ◆ m_useWarmStart

bool centroidal_dynamics::Solver_LP_abstract::m_useWarmStart
| protected

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

- include/hpp/centroidal-dynamics/solver_LP_abstract.hh
- src/solver_LP_abstract.cpp