constraint-bound.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_bound_hpp__
19 #define __invdyn_math_constraint_bound_hpp__
20 
22 
23 namespace tsid
24 {
25  namespace math
26  {
27 
29  {
30  public:
31  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
32 
33  ConstraintBound(const std::string & name);
34 
35  ConstraintBound(const std::string & name,
36  const unsigned int size);
37 
38  ConstraintBound(const std::string & name,
39  ConstRefVector lb,
40  ConstRefVector ub);
41  virtual ~ConstraintBound() {}
42 
43  unsigned int rows() const;
44  unsigned int cols() const;
45  void resize(const unsigned int r, const unsigned int c);
46 
47  bool isEquality() const;
48  bool isInequality() const;
49  bool isBound() const;
50 
51  const Vector & vector() const;
52  const Vector & lowerBound() const;
53  const Vector & upperBound() const;
54 
55  Vector & vector();
56  Vector & lowerBound();
57  Vector & upperBound();
58 
59  bool setVector(ConstRefVector b);
62 
63  bool checkConstraint(ConstRefVector x, double tol=1e-6) const;
64 
65  protected:
66 
69  };
70 
71  }
72 }
73 
74 #endif // ifndef __invdyn_math_constraint_bound_hpp__
tsid::math::ConstraintBound::isBound
bool isBound() const
Definition: constraint-bound.cpp:66
tsid::math::ConstraintBound::upperBound
const Vector & upperBound() const
Definition: constraint-bound.cpp:70
tsid::math::ConstraintBase
Abstract class representing a linear equality/inequality constraint. Equality constraints are represe...
Definition: constraint-base.hpp:36
tsid::math::ConstraintBound::isEquality
bool isEquality() const
Definition: constraint-bound.cpp:64
tsid::math::Vector
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: fwd.hpp:37
tsid::math::ConstraintBound::rows
unsigned int rows() const
Definition: constraint-bound.cpp:44
tsid::math::ConstraintBound
Definition: constraint-bound.hpp:28
tsid::math::ConstraintBase::name
virtual const std::string & name() const
Definition: constraint-base.cpp:39
tsid::math::ConstraintBound::m_lb
Vector m_lb
Definition: constraint-bound.hpp:67
tsid::math::ConstraintBound::cols
unsigned int cols() const
Definition: constraint-bound.cpp:50
tsid::math::ConstraintBound::lowerBound
const Vector & lowerBound() const
Definition: constraint-bound.cpp:69
tsid::math::ConstraintBound::~ConstraintBound
virtual ~ConstraintBound()
Definition: constraint-bound.hpp:41
tsid::math::ConstraintBound::checkConstraint
bool checkConstraint(ConstRefVector x, double tol=1e-6) const
Definition: constraint-bound.cpp:80
tsid::math::ConstraintBound::setUpperBound
bool setUpperBound(ConstRefVector ub)
Definition: constraint-bound.cpp:78
tsid::math::ConstraintBound::isInequality
bool isInequality() const
Definition: constraint-bound.cpp:65
tsid::math::ConstraintBound::vector
const Vector & vector() const
Definition: constraint-bound.cpp:68
constraint-base.hpp
tsid::math::ConstraintBound::resize
void resize(const unsigned int r, const unsigned int c)
Definition: constraint-bound.cpp:56
tsid::math::ConstraintBound::m_ub
Vector m_ub
Definition: constraint-bound.hpp:68
tsid::math::ConstRefVector
const typedef Eigen::Ref< const Vector > ConstRefVector
Definition: fwd.hpp:50
tsid::math::ConstraintBound::setVector
bool setVector(ConstRefVector b)
Definition: constraint-bound.cpp:76
tsid
Definition: constraint-bound.hpp:26
tsid::math::ConstraintBound::ConstraintBound
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ConstraintBound(const std::string &name)
Definition: constraint-bound.cpp:23
tsid::math::ConstraintBound::setLowerBound
bool setLowerBound(ConstRefVector lb)
Definition: constraint-bound.cpp:77