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