GCC Code Coverage Report


Directory: ./
File: include/tsid/math/constraint-bound.hpp
Date: 2024-11-10 01:12:44
Exec Total Coverage
Lines: 1 1 100.0%
Branches: 0 0 -%

Line Branch Exec Source
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
21 #include "tsid/math/constraint-base.hpp"
22
23 namespace tsid {
24 namespace math {
25
26 class ConstraintBound : public ConstraintBase {
27 public:
28 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
29
30 ConstraintBound(const std::string& name);
31
32 ConstraintBound(const std::string& name, const unsigned int size);
33
34 ConstraintBound(const std::string& name, ConstRefVector lb,
35 ConstRefVector ub);
36 4 virtual ~ConstraintBound() {}
37
38 unsigned int rows() const;
39 unsigned int cols() const;
40 void resize(const unsigned int r, const unsigned int c);
41
42 bool isEquality() const;
43 bool isInequality() const;
44 bool isBound() const;
45
46 const Vector& vector() const;
47 const Vector& lowerBound() const;
48 const Vector& upperBound() const;
49
50 Vector& vector();
51 Vector& lowerBound();
52 Vector& upperBound();
53
54 bool setVector(ConstRefVector b);
55 bool setLowerBound(ConstRefVector lb);
56 bool setUpperBound(ConstRefVector ub);
57
58 bool checkConstraint(ConstRefVector x, double tol = 1e-6) const;
59
60 protected:
61 Vector m_lb;
62 Vector m_ub;
63 };
64
65 } // namespace math
66 } // namespace tsid
67
68 #endif // ifndef __invdyn_math_constraint_bound_hpp__
69