Loading...
Searching...
No Matches
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
23namespace 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,
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();
58
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__
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-bound.hpp:29
bool checkConstraint(ConstRefVector x, double tol=1e-6) const
Definition: constraint-bound.cpp:80
Vector m_lb
Definition: constraint-bound.hpp:67
bool isInequality() const
Definition: constraint-bound.cpp:65
bool setVector(ConstRefVector b)
Definition: constraint-bound.cpp:76
unsigned int cols() const
Definition: constraint-bound.cpp:50
const Vector & lowerBound() const
Definition: constraint-bound.cpp:69
const Vector & upperBound() const
Definition: constraint-bound.cpp:70
virtual ~ConstraintBound()
Definition: constraint-bound.hpp:41
bool setUpperBound(ConstRefVector ub)
Definition: constraint-bound.cpp:78
const Vector & vector() const
Definition: constraint-bound.cpp:68
bool isBound() const
Definition: constraint-bound.cpp:66
unsigned int rows() const
Definition: constraint-bound.cpp:44
bool isEquality() const
Definition: constraint-bound.cpp:64
void resize(const unsigned int r, const unsigned int c)
Definition: constraint-bound.cpp:56
bool setLowerBound(ConstRefVector lb)
Definition: constraint-bound.cpp:77
Vector m_ub
Definition: constraint-bound.hpp:68
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: fwd.hpp:37
const Eigen::Ref< const Vector > ConstRefVector
Definition: fwd.hpp:50
Definition: constraint-bound.hpp:27