Loading...
Searching...
No Matches
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
28namespace tsid
29{
30 namespace solvers
31 {
32
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__
Definition: solver-HQP-output.hpp:33
Abstract interface for a Quadratic Program (HQP) solver.
Definition: solver-HQP-base.hpp:37
virtual double getMaximumTime()
Definition: solver-HQP-base.hpp:74
int m_maxIter
Definition: solver-HQP-base.hpp:82
bool m_useWarmStart
Definition: solver-HQP-base.hpp:81
math::ConstRefMatrix ConstRefMatrix
Definition: solver-HQP-base.hpp:46
virtual bool getUseWarmStart()
Definition: solver-HQP-base.hpp:63
double m_maxTime
Definition: solver-HQP-base.hpp:83
std::string m_name
Definition: solver-HQP-base.hpp:80
virtual double getObjectiveValue()=0
virtual const HQPOutput & solve(const HQPData &problemData)=0
virtual const std::string & name()
Definition: solver-HQP-base.hpp:51
virtual void resize(unsigned int n, unsigned int neq, unsigned int nin)=0
math::RefVector RefVector
Definition: solver-HQP-base.hpp:44
HQPOutput m_output
Definition: solver-HQP-base.hpp:84
virtual void setUseWarmStart(bool useWarmStart)
Definition: solver-HQP-base.hpp:65
virtual unsigned int getMaximumIterations()
Definition: solver-HQP-base.hpp:68
math::ConstRefVector ConstRefVector
Definition: solver-HQP-base.hpp:45
virtual ~SolverHQPBase()
Definition: solver-HQP-base.hpp:49
#define TSID_DLLAPI
Definition: config.hh:64
const Eigen::Ref< const Matrix > ConstRefMatrix
Definition: fwd.hpp:53
const Eigen::Ref< const Vector > ConstRefVector
Definition: fwd.hpp:50
Eigen::Ref< Vector > RefVector
Definition: fwd.hpp:49
pinocchio::container::aligned_vector< ConstraintLevel > HQPData
Definition: fwd.hpp:91
Definition: constraint-bound.hpp:27