constraint-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_math_constraint_base_hpp__
19 #define __invdyn_math_constraint_base_hpp__
20 
21 #include "tsid/math/fwd.hpp"
22 #include <string>
23 #include <pinocchio/macros.hpp>
24 
25 namespace tsid {
26 namespace math {
27 
36  public:
37  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
38 
39  ConstraintBase(const std::string& name);
40 
41  ConstraintBase(const std::string& name, const unsigned int rows,
42  const unsigned int cols);
43 
44  ConstraintBase(const std::string& name, ConstRefMatrix A);
45  virtual ~ConstraintBase() = default;
46 
47  virtual const std::string& name() const;
48  virtual unsigned int rows() const = 0;
49  virtual unsigned int cols() const = 0;
50  virtual void resize(const unsigned int r, const unsigned int c) = 0;
51 
52  virtual bool isEquality() const = 0;
53  virtual bool isInequality() const = 0;
54  virtual bool isBound() const = 0;
55 
56  virtual const Matrix& matrix() const;
57  virtual const Vector& vector() const = 0;
58  virtual const Vector& lowerBound() const = 0;
59  virtual const Vector& upperBound() const = 0;
60 
61  virtual Matrix& matrix();
62  virtual Vector& vector() = 0;
63  virtual Vector& lowerBound() = 0;
64  virtual Vector& upperBound() = 0;
65 
66  virtual bool setMatrix(ConstRefMatrix A);
67  virtual bool setVector(ConstRefVector b) = 0;
68  virtual bool setLowerBound(ConstRefVector lb) = 0;
69  virtual bool setUpperBound(ConstRefVector ub) = 0;
70 
71  virtual bool checkConstraint(ConstRefVector x, double tol = 1e-6) const = 0;
72 
73  protected:
74  std::string m_name;
76 };
77 
78 } // namespace math
79 } // namespace tsid
80 
81 #endif // ifndef __invdyn_math_constraint_base_hpp__
ex_4_plan_LIPM_romeo.A
A
Definition: ex_4_plan_LIPM_romeo.py:110
test_Constraint.ub
ub
Definition: test_Constraint.py:13
tsid::math::ConstraintBase::isEquality
virtual bool isEquality() const =0
tsid::math::ConstraintBase::setLowerBound
virtual bool setLowerBound(ConstRefVector lb)=0
tsid::math::ConstraintBase::setVector
virtual bool setVector(ConstRefVector b)=0
tsid::math::ConstraintBase
Abstract class representing a linear equality/inequality constraint. Equality constraints are represe...
Definition: constraint-base.hpp:35
tsid::math::ConstraintBase::vector
virtual const Vector & vector() const =0
c
Vec3f c
tsid::math::ConstraintBase::upperBound
virtual const Vector & upperBound() const =0
tsid::math::ConstraintBase::m_A
Matrix m_A
Definition: constraint-base.hpp:75
tsid::math::ConstraintBase::ConstraintBase
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ConstraintBase(const std::string &name)
Definition: constraint-base.cpp:22
tsid::math::ConstraintBase::isBound
virtual bool isBound() const =0
tsid::math::ConstraintBase::name
virtual const std::string & name() const
Definition: constraint-base.cpp:33
tsid::math::ConstraintBase::resize
virtual void resize(const unsigned int r, const unsigned int c)=0
b
Vec3f b
r
FCL_REAL r
test_Constraint.tol
int tol
Definition: test_Constraint.py:10
tsid::math::ConstraintBase::setUpperBound
virtual bool setUpperBound(ConstRefVector ub)=0
tsid::math::ConstraintBase::matrix
virtual const Matrix & matrix() const
Definition: constraint-base.cpp:35
tsid::math::ConstraintBase::~ConstraintBase
virtual ~ConstraintBase()=default
fwd.hpp
test_Constraint.lb
float lb
Definition: test_Constraint.py:12
tsid::math::ConstraintBase::lowerBound
virtual const Vector & lowerBound() const =0
tsid::math::Matrix
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition: math/fwd.hpp:36
tsid::math::ConstraintBase::cols
virtual unsigned int cols() const =0
tsid::math::ConstRefVector
const typedef Eigen::Ref< const Vector > ConstRefVector
Definition: math/fwd.hpp:48
tsid::math::ConstraintBase::rows
virtual unsigned int rows() const =0
tsid::math::Vector
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: math/fwd.hpp:35
tsid::math::ConstraintBase::checkConstraint
virtual bool checkConstraint(ConstRefVector x, double tol=1e-6) const =0
tsid::math::ConstraintBase::isInequality
virtual bool isInequality() const =0
tsid
Definition: bindings/python/constraint/constraint-bound.cpp:21
test_Solvers.x
x
Definition: test_Solvers.py:67
tsid::math::ConstRefMatrix
const typedef Eigen::Ref< const Matrix > ConstRefMatrix
Definition: math/fwd.hpp:51
tsid::math::ConstraintBase::m_name
std::string m_name
Definition: constraint-base.hpp:74
tsid::math::ConstraintBase::setMatrix
virtual bool setMatrix(ConstRefMatrix A)
Definition: constraint-base.cpp:39


tsid
Author(s): Andrea Del Prete, Justin Carpentier
autogenerated on Thu Apr 3 2025 02:47:15