Abstract interface for a Linear Program (LP) solver.
More...
#include <hpp/centroidal-dynamics/solver_LP_abstract.hh>
|
| | 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.
|
| |
| 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.
|
| |
| 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.
|
| |
| 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) |
| |
Abstract interface for a Linear Program (LP) solver.
◆ 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 |
◆ 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()
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]
Solve the linear program minimize c' x subject to Alb <= A x <= Aub lb <= x <= ub
◆ writeLpToFile()
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.
◆ 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: