solver-HQP-base.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2017 CNRS
3 //
4 // This file is part of tsid
5 // tsid is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 // tsid is distributed in the hope that it will be
10 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Lesser Public License for more details. You should have
13 // received a copy of the GNU Lesser General Public License along with
14 // tsid If not, see
15 // <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef __invdyn_solvers_hqp_base_hpp__
19 #define __invdyn_solvers_hqp_base_hpp__
20 
21 #include "tsid/solvers/fwd.hpp"
24 
25 #include <vector>
26 #include <utility>
27 
28 namespace tsid
29 {
30  namespace solvers
31  {
32 
36  class TSID_DLLAPI SolverHQPBase
37  {
38  public:
39 
40  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
41 
42  static std::string const HQP_status_string [5];
43 
47 
48  SolverHQPBase(const std::string & name);
49  virtual ~SolverHQPBase() {};
50 
51  virtual const std::string & name() { return m_name; }
52 
53  virtual void resize(unsigned int n, unsigned int neq, unsigned int nin) = 0;
54 
57  virtual const HQPOutput & solve(const HQPData & problemData) = 0;
58 
60  virtual double getObjectiveValue() = 0;
61 
63  virtual bool getUseWarmStart(){ return m_useWarmStart; }
65  virtual void setUseWarmStart(bool useWarmStart){ m_useWarmStart = useWarmStart; }
66 
68  virtual unsigned int getMaximumIterations(){ return m_maxIter; }
70  virtual bool setMaximumIterations(unsigned int maxIter);
71 
72 
74  virtual double getMaximumTime(){ return m_maxTime; }
76  virtual bool setMaximumTime(double seconds);
77 
78  protected:
79 
80  std::string m_name;
81  bool m_useWarmStart; // true if the solver is allowed to warm start
82  int m_maxIter; // max number of iterations
83  double m_maxTime; // max time to solve the HQP [s]
85  };
86 
87  }
88 }
89 
90 #endif // ifndef __invdyn_solvers_hqp_base_hpp__
tsid::solvers::SolverHQPBase::m_output
HQPOutput m_output
Definition: solver-HQP-base.hpp:84
tsid::solvers::SolverHQPBase::ConstRefVector
math::ConstRefVector ConstRefVector
Definition: solver-HQP-base.hpp:45
tsid::solvers::SolverHQPBase::m_maxIter
int m_maxIter
Definition: solver-HQP-base.hpp:82
tsid::solvers::SolverHQPBase::m_useWarmStart
bool m_useWarmStart
Definition: solver-HQP-base.hpp:81
tsid::solvers::SolverHQPBase::m_name
std::string m_name
Definition: solver-HQP-base.hpp:80
solver-HQP-output.hpp
tsid::solvers::SolverHQPBase::getMaximumIterations
virtual unsigned int getMaximumIterations()
Definition: solver-HQP-base.hpp:68
tsid::math::RefVector
Eigen::Ref< Vector > RefVector
Definition: fwd.hpp:49
tsid::solvers::HQPOutput
Definition: solver-HQP-output.hpp:32
tsid::solvers::SolverHQPBase::name
virtual const std::string & name()
Definition: solver-HQP-base.hpp:51
tsid::solvers::SolverHQPBase
Abstract interface for a Quadratic Program (HQP) solver.
Definition: solver-HQP-base.hpp:36
tsid::solvers::SolverHQPBase::getUseWarmStart
virtual bool getUseWarmStart()
Definition: solver-HQP-base.hpp:63
constraint-base.hpp
tsid::math::ConstRefVector
const typedef Eigen::Ref< const Vector > ConstRefVector
Definition: fwd.hpp:50
tsid::solvers::SolverHQPBase::getMaximumTime
virtual double getMaximumTime()
Definition: solver-HQP-base.hpp:74
tsid::solvers::SolverHQPBase::ConstRefMatrix
math::ConstRefMatrix ConstRefMatrix
Definition: solver-HQP-base.hpp:46
tsid
Definition: constraint-bound.hpp:26
tsid::solvers::SolverHQPBase::setUseWarmStart
virtual void setUseWarmStart(bool useWarmStart)
Definition: solver-HQP-base.hpp:65
tsid::solvers::SolverHQPBase
class TSID_DLLAPI SolverHQPBase
Definition: fwd.hpp:66
tsid::math::ConstRefMatrix
const typedef Eigen::Ref< const Matrix > ConstRefMatrix
Definition: fwd.hpp:53
tsid::solvers::SolverHQPBase::~SolverHQPBase
virtual ~SolverHQPBase()
Definition: solver-HQP-base.hpp:49
tsid::solvers::SolverHQPBase::m_maxTime
double m_maxTime
Definition: solver-HQP-base.hpp:83
tsid::solvers::HQPData
pinocchio::container::aligned_vector< ConstraintLevel > HQPData
Definition: fwd.hpp:91
tsid::solvers::SolverHQPBase::RefVector
math::RefVector RefVector
Definition: solver-HQP-base.hpp:44
fwd.hpp