humoto
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
humoto::qpoases::Solver Class Reference

Detailed Description

QP solver.

Solves hierarchy as an optimization problem of the following form: minimize 1/2* x' H x + x' g subject to lb <= x <= ub lbA <= A x <= ubA where 'x' is solution, 'H' – Hessian matrix, 'g' – gradient vector, 'lb' and 'ub' vectors of simple lower and upper bounds, 'Ax' – matrix of general constraints with bounds 'lbA' and 'ubA'.

Definition at line 134 of file solver.h.

#include <solver.h>

Inheritance diagram for humoto::qpoases::Solver:
Inheritance graph

Public Member Functions

 Solver ()
 Default constructor (with default parameters) More...
 
 Solver (const SolverParameters &parameters)
 Set parameters. More...
 
 ~Solver ()
 Destructor. More...
 
void log (humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="qpoases") const
 Log a QP problem. More...
 
void setParameters (const SolverParameters &parameters)
 Construct solver with specified parameters. More...
 
void solve (humoto::Solution &solution, const humoto::OptimizationProblem &hierarchy)
 Solve an optimization problem (using previously specified parameters) More...
 
void solve (humoto::Solution &solution, const humoto::OptimizationProblem &hierarchy, const SolverParameters &parameters)
 Solve an optimization problem (using previously specified parameters) More...
 
void solve (humoto::Solution &solution, const humoto::OptimizationProblem &hierarchy, const humoto::Solution &solution_guess)
 Solve an optimization problem (using previously specified parameters) More...
 
void solve (Solution &solution, ActiveSet &active_set, const humoto::OptimizationProblem &hierarchy, const ActiveSet &active_set_guess)
 Solve an optimization problem (using previously specified parameters) More...
 
void solve (Solution &solution, const humoto::OptimizationProblem &hierarchy, const ActiveSet &active_set_guess)
 Solve an optimization problem (using previously specified parameters) More...
 
void solve (humoto::Solution &solution, humoto::ActiveSet &active_set, const humoto::OptimizationProblem &hierarchy)
 Solve an optimization problem (using previously specified parameters) More...
 
void solve (Solution &solution, ActiveSet &active_set, const humoto::OptimizationProblem &hierarchy, const humoto::Solution &solution_guess, const ActiveSet &active_set_guess)
 Solve an optimization problem (using previously specified parameters) More...
 
void solve (Solution &solution, const humoto::OptimizationProblem &hierarchy, const humoto::Solution &solution_guess, const ActiveSet &active_set_guess)
 Solve an optimization problem (using previously specified parameters) More...
 
void solve (humoto::Solution &solution, humoto::ActiveSet &active_set, const humoto::OptimizationProblem &hierarchy, const humoto::Solution &solution_guess)
 Solve an optimization problem (using previously specified parameters) More...
 

Protected Member Functions

virtual void checkInputs (const humoto::OptimizationProblem &hierarchy) const
 
void checkResults (const humoto::Solution &solution) const
 Check return status and crash if it indicates a failure and crashing is enabled. More...
 

Protected Attributes

SolverParameters parameters_
 

Private Member Functions

void getActiveSet (humoto::ActiveSet &active_set, const humoto::OptimizationProblem &hierarchy)
 Get active set. More...
 
void initialize (const humoto::OptimizationProblem &hierarchy, const humoto::SolutionStructure &sol_structure)
 Initialize solver. More...
 
void reset ()
 Reset solver. More...
 
void setActiveSet (const humoto::ActiveSet &active_set, const humoto::OptimizationProblem &hierarchy)
 Set active set guess. More...
 
void setSolutionGuess (const humoto::Solution &solution_guess)
 Set solution guess. More...
 
void solveHierarchy (humoto::Solution &solution, const humoto::OptimizationProblem &hierarchy)
 Solve the hierarchy. More...
 

Private Attributes

bool active_set_guess_provided_
 If set the active set is returned. More...
 
std::size_t number_of_constraints_
 Nonzero if constraints are specified. More...
 
qpOASES::QProblem * qp_
 
humoto::QPProblem_ILU_ALU qp_problem_
 
Eigen::VectorXd qpoases_active_set_bounds_
 
Eigen::VectorXd qpoases_active_set_constraints_
 
const doublesolution_guess_
 Guess of the solution. More...
 
qpOASES::Bounds qpoases_active_set_guess_bounds_
 The active set guess for qpOASES. More...
 
qpOASES::Constraints qpoases_active_set_guess_constraints_
 

Constructor & Destructor Documentation

◆ Solver() [1/2]

humoto::qpoases::Solver::Solver ( )
inline

Default constructor (with default parameters)

Definition at line 494 of file solver.h.

◆ ~Solver()

humoto::qpoases::Solver::~Solver ( )
inline

Destructor.

Definition at line 504 of file solver.h.

◆ Solver() [2/2]

humoto::qpoases::Solver::Solver ( const SolverParameters parameters)
inlineexplicit

Set parameters.

Parameters
[in]parametersparameters

Definition at line 515 of file solver.h.

Member Function Documentation

◆ checkInputs()

virtual void humoto::QPSolverMixin< humoto::SolverGuessSolutionActiveSet< SolverParameters > >::checkInputs ( const humoto::OptimizationProblem hierarchy) const
inlineprotectedvirtualinherited

Reimplemented from humoto::Solver< SolverParameters >.

Definition at line 469 of file solver.h.

◆ checkResults()

void humoto::Solver< SolverParameters >::checkResults ( const humoto::Solution solution) const
inlineprotectedinherited

Check return status and crash if it indicates a failure and crashing is enabled.

Parameters
[in]solution

Definition at line 85 of file solver.h.

◆ getActiveSet()

void humoto::qpoases::Solver::getActiveSet ( humoto::ActiveSet active_set,
const humoto::OptimizationProblem hierarchy 
)
inlineprivatevirtual

Get active set.

Parameters
[out]active_set
[in]hierarchy

Implements humoto::SolverGuessActiveSetMixin< Solver< SolverParameters > >.

Definition at line 296 of file solver.h.

◆ initialize()

void humoto::qpoases::Solver::initialize ( const humoto::OptimizationProblem hierarchy,
const humoto::SolutionStructure sol_structure 
)
inlineprivatevirtual

Initialize solver.

Parameters
[in]hierarchyhierarchy
[in]sol_structuresolution structure

Implements humoto::Solver< SolverParameters >.

Definition at line 166 of file solver.h.

◆ log()

void humoto::qpoases::Solver::log ( humoto::Logger logger,
const LogEntryName parent = LogEntryName(),
const std::string &  name = "qpoases" 
) const
inline

Log a QP problem.

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

Definition at line 530 of file solver.h.

◆ reset()

void humoto::qpoases::Solver::reset ( )
inlineprivatevirtual

Reset solver.

Reimplemented from humoto::Solver< SolverParameters >.

Definition at line 474 of file solver.h.

◆ setActiveSet()

void humoto::qpoases::Solver::setActiveSet ( const humoto::ActiveSet active_set,
const humoto::OptimizationProblem hierarchy 
)
inlineprivatevirtual

Set active set guess.

Parameters
[in]hierarchy
[in]active_set
Attention
One variable may be simply bounded multiple times. In this case, the guess is set to the guess for the last bound on the level.

Implements humoto::SolverGuessActiveSetMixin< Solver< SolverParameters > >.

Definition at line 404 of file solver.h.

◆ setParameters()

void humoto::Solver< SolverParameters >::setParameters ( const SolverParameters &  parameters)
inlineinherited

Construct solver with specified parameters.

Parameters
[in]parametersparameters

Definition at line 141 of file solver.h.

◆ setSolutionGuess()

void humoto::qpoases::Solver::setSolutionGuess ( const humoto::Solution solution_guess)
inlineprivatevirtual

Set solution guess.

Parameters
[in]solution_guess

Implements humoto::SolverGuessSolutionMixin< SolverGuessActiveSetMixin< Solver< SolverParameters > > >.

Definition at line 467 of file solver.h.

◆ solve() [1/9]

void humoto::Solver< SolverParameters >::solve ( humoto::Solution solution,
const humoto::OptimizationProblem hierarchy 
)
inlineinherited

Solve an optimization problem (using previously specified parameters)

Parameters
[out]solution
[in]hierarchy

Definition at line 155 of file solver.h.

◆ solve() [2/9]

void humoto::Solver< SolverParameters >::solve ( humoto::Solution solution,
const humoto::OptimizationProblem hierarchy,
const SolverParameters &  parameters 
)
inlineinherited

Solve an optimization problem (using previously specified parameters)

Parameters
[out]solution
[in]hierarchy
[in]parametersparameters

Definition at line 173 of file solver.h.

◆ solve() [3/9]

void humoto::SolverGuessSolutionMixin< SolverGuessActiveSetMixin< Solver< SolverParameters > > >::solve ( humoto::Solution solution,
const humoto::OptimizationProblem hierarchy,
const humoto::Solution solution_guess 
)
inlineinherited

Solve an optimization problem (using previously specified parameters)

Parameters
[out]solution
[in]hierarchy
[in]solution_guess

Definition at line 230 of file solver.h.

◆ solve() [4/9]

void humoto::SolverGuessActiveSetMixin< Solver< SolverParameters > >::solve ( Solution solution,
ActiveSet active_set,
const humoto::OptimizationProblem hierarchy,
const ActiveSet active_set_guess 
)
inlineinherited

Solve an optimization problem (using previously specified parameters)

Parameters
[out]solution
[out]active_set
[in]hierarchy
[in]active_set_guess

Definition at line 297 of file solver.h.

◆ solve() [5/9]

void humoto::SolverGuessActiveSetMixin< Solver< SolverParameters > >::solve ( Solution solution,
const humoto::OptimizationProblem hierarchy,
const ActiveSet active_set_guess 
)
inlineinherited

Solve an optimization problem (using previously specified parameters)

Parameters
[out]solution
[in]hierarchy
[in]active_set_guess

Definition at line 319 of file solver.h.

◆ solve() [6/9]

void humoto::SolverGuessActiveSetMixin< Solver< SolverParameters > >::solve ( humoto::Solution solution,
humoto::ActiveSet active_set,
const humoto::OptimizationProblem hierarchy 
)
inlineinherited

Solve an optimization problem (using previously specified parameters)

Parameters
[out]solution
[out]active_set
[in]hierarchy

Definition at line 339 of file solver.h.

◆ solve() [7/9]

void humoto::SolverGuessSolutionActiveSetMixin< SolverGuessSolutionMixin< SolverGuessActiveSetMixin< Solver< SolverParameters > > > >::solve ( Solution solution,
ActiveSet active_set,
const humoto::OptimizationProblem hierarchy,
const humoto::Solution solution_guess,
const ActiveSet active_set_guess 
)
inlineinherited

Solve an optimization problem (using previously specified parameters)

Parameters
[out]solution
[out]active_set
[in]hierarchy
[in]solution_guess
[in]active_set_guess

Definition at line 393 of file solver.h.

◆ solve() [8/9]

void humoto::SolverGuessSolutionActiveSetMixin< SolverGuessSolutionMixin< SolverGuessActiveSetMixin< Solver< SolverParameters > > > >::solve ( Solution solution,
const humoto::OptimizationProblem hierarchy,
const humoto::Solution solution_guess,
const ActiveSet active_set_guess 
)
inlineinherited

Solve an optimization problem (using previously specified parameters)

Parameters
[out]solution
[in]hierarchy
[in]solution_guess
[in]active_set_guess

Definition at line 418 of file solver.h.

◆ solve() [9/9]

void humoto::SolverGuessSolutionActiveSetMixin< SolverGuessSolutionMixin< SolverGuessActiveSetMixin< Solver< SolverParameters > > > >::solve ( humoto::Solution solution,
humoto::ActiveSet active_set,
const humoto::OptimizationProblem hierarchy,
const humoto::Solution solution_guess 
)
inlineinherited

Solve an optimization problem (using previously specified parameters)

Parameters
[out]solution
[out]active_set
[in]hierarchy
[in]solution_guess

Definition at line 441 of file solver.h.

◆ solveHierarchy()

void humoto::qpoases::Solver::solveHierarchy ( humoto::Solution solution,
const humoto::OptimizationProblem hierarchy 
)
inlineprivatevirtual

Solve the hierarchy.

Parameters
[out]solutionsolution
[in]hierarchyhierarchy

Implements humoto::Solver< SolverParameters >.

Definition at line 182 of file solver.h.

Member Data Documentation

◆ active_set_guess_provided_

bool humoto::qpoases::Solver::active_set_guess_provided_
private

If set the active set is returned.

Definition at line 138 of file solver.h.

◆ number_of_constraints_

std::size_t humoto::qpoases::Solver::number_of_constraints_
private

Nonzero if constraints are specified.

Definition at line 159 of file solver.h.

◆ parameters_

SolverParameters humoto::Solver< SolverParameters >::parameters_
protectedinherited

Definition at line 67 of file solver.h.

◆ qp_

qpOASES::QProblem* humoto::qpoases::Solver::qp_
private

Definition at line 161 of file solver.h.

◆ qp_problem_

humoto::QPProblem_ILU_ALU humoto::qpoases::Solver::qp_problem_
private

Definition at line 141 of file solver.h.

◆ qpoases_active_set_bounds_

Eigen::VectorXd humoto::qpoases::Solver::qpoases_active_set_bounds_
private

Definition at line 154 of file solver.h.

◆ qpoases_active_set_constraints_

Eigen::VectorXd humoto::qpoases::Solver::qpoases_active_set_constraints_
private

Definition at line 155 of file solver.h.

◆ qpoases_active_set_guess_bounds_

qpOASES::Bounds humoto::qpoases::Solver::qpoases_active_set_guess_bounds_
private

The active set guess for qpOASES.

Definition at line 150 of file solver.h.

◆ qpoases_active_set_guess_constraints_

qpOASES::Constraints humoto::qpoases::Solver::qpoases_active_set_guess_constraints_
private

Definition at line 151 of file solver.h.

◆ solution_guess_

const double* humoto::qpoases::Solver::solution_guess_
private

Guess of the solution.

Definition at line 145 of file solver.h.


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