humoto
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
humoto::Solver< t_SolverParameters > Class Template Referenceabstract

Detailed Description

template<class t_SolverParameters>
class humoto::Solver< t_SolverParameters >

Base solver class.

Template Parameters
t_SolverParametersclass representing parameters of the solver, should inherit from SolverParametersBase

Definition at line 64 of file solver.h.

#include <solver.h>

Inheritance diagram for humoto::Solver< t_SolverParameters >:
Inheritance graph

Public Member Functions

void setParameters (const t_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 t_SolverParameters &parameters)
 Solve an optimization problem (using previously specified parameters) More...
 

Protected Member Functions

 Solver ()
 
 ~Solver ()
 Protected destructor: prevent destruction of the child classes through a base pointer. More...
 
virtual void checkInputs (const humoto::OptimizationProblem &hierarchy) const
 Checks input, does nothing by default, may include extra checks in mixins. More...
 
void checkResults (const humoto::Solution &solution) const
 Check return status and crash if it indicates a failure and crashing is enabled. More...
 
virtual void initialize (const humoto::OptimizationProblem &hierarchy, const humoto::SolutionStructure &sol_structure)=0
 Initialize solver. More...
 
virtual void reset ()
 Reset solver. More...
 
virtual void solveHierarchy (humoto::Solution &solution, const humoto::OptimizationProblem &hierarchy)=0
 Solve the hierarchy. More...
 

Protected Attributes

t_SolverParameters parameters_
 

Constructor & Destructor Documentation

◆ ~Solver()

template<class t_SolverParameters>
humoto::Solver< t_SolverParameters >::~Solver ( )
inlineprotected

Protected destructor: prevent destruction of the child classes through a base pointer.

Definition at line 75 of file solver.h.

◆ Solver()

template<class t_SolverParameters>
humoto::Solver< t_SolverParameters >::Solver ( )
inlineprotected

Definition at line 76 of file solver.h.

Member Function Documentation

◆ checkInputs()

template<class t_SolverParameters>
virtual void humoto::Solver< t_SolverParameters >::checkInputs ( const humoto::OptimizationProblem hierarchy) const
inlineprotectedvirtual

Checks input, does nothing by default, may include extra checks in mixins.

Parameters
[in]hierarchy

Reimplemented in humoto::QPSolverMixin< humoto::Solver< SolverParameters > >, and humoto::QPSolverMixin< humoto::SolverGuessSolutionActiveSet< SolverParameters > >.

Definition at line 102 of file solver.h.

◆ checkResults()

template<class t_SolverParameters>
void humoto::Solver< t_SolverParameters >::checkResults ( const humoto::Solution solution) const
inlineprotected

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.

◆ initialize()

template<class t_SolverParameters>
virtual void humoto::Solver< t_SolverParameters >::initialize ( const humoto::OptimizationProblem hierarchy,
const humoto::SolutionStructure sol_structure 
)
protectedpure virtual

Initialize solver.

Parameters
[in]hierarchyhierarchy
[in]sol_structuresolution structure

Implemented in humoto::qpoases::Solver, humoto::kktsolver::Solver, humoto::qpmad::Solver, and humoto::quadprogpp::Solver.

◆ reset()

template<class t_SolverParameters>
virtual void humoto::Solver< t_SolverParameters >::reset ( )
inlineprotectedvirtual

Reset solver.

Reimplemented in humoto::qpoases::Solver.

Definition at line 110 of file solver.h.

◆ setParameters()

template<class t_SolverParameters>
void humoto::Solver< t_SolverParameters >::setParameters ( const t_SolverParameters &  parameters)
inline

Construct solver with specified parameters.

Parameters
[in]parametersparameters

Definition at line 141 of file solver.h.

◆ solve() [1/2]

template<class t_SolverParameters>
void humoto::Solver< t_SolverParameters >::solve ( humoto::Solution solution,
const humoto::OptimizationProblem hierarchy 
)
inline

Solve an optimization problem (using previously specified parameters)

Parameters
[out]solution
[in]hierarchy

Definition at line 155 of file solver.h.

◆ solve() [2/2]

template<class t_SolverParameters>
void humoto::Solver< t_SolverParameters >::solve ( humoto::Solution solution,
const humoto::OptimizationProblem hierarchy,
const t_SolverParameters &  parameters 
)
inline

Solve an optimization problem (using previously specified parameters)

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

Definition at line 173 of file solver.h.

◆ solveHierarchy()

template<class t_SolverParameters>
virtual void humoto::Solver< t_SolverParameters >::solveHierarchy ( humoto::Solution solution,
const humoto::OptimizationProblem hierarchy 
)
protectedpure virtual

Solve the hierarchy.

Parameters
[out]solutionsolution
[in]hierarchyhierarchy

Implemented in humoto::qpoases::Solver, humoto::kktsolver::Solver, humoto::qpmad::Solver, and humoto::quadprogpp::Solver.

Member Data Documentation

◆ parameters_

template<class t_SolverParameters>
t_SolverParameters humoto::Solver< t_SolverParameters >::parameters_
protected

Definition at line 67 of file solver.h.


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