GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: include/tsid/math/constraint-equality.hpp Lines: 2 2 100.0 %
Date: 2024-05-10 01:36:27 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_equality_hpp__
19
#define __invdyn_math_constraint_equality_hpp__
20
21
#include "tsid/math/constraint-base.hpp"
22
23
namespace tsid {
24
namespace math {
25
26
class ConstraintEquality : public ConstraintBase {
27
 public:
28
1
  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
29
30
  ConstraintEquality(const std::string& name);
31
32
  ConstraintEquality(const std::string& name, const unsigned int rows,
33
                     const unsigned int cols);
34
35
  ConstraintEquality(const std::string& name, ConstRefMatrix A,
36
                     ConstRefVector b);
37
20058
  virtual ~ConstraintEquality() {}
38
39
  unsigned int rows() const;
40
  unsigned int cols() const;
41
  void resize(const unsigned int r, const unsigned int c);
42
43
  bool isEquality() const;
44
  bool isInequality() const;
45
  bool isBound() const;
46
47
  const Vector& vector() const;
48
  const Vector& lowerBound() const;
49
  const Vector& upperBound() const;
50
51
  Vector& vector();
52
  Vector& lowerBound();
53
  Vector& upperBound();
54
55
  bool setVector(ConstRefVector b);
56
  bool setLowerBound(ConstRefVector lb);
57
  bool setUpperBound(ConstRefVector ub);
58
59
  bool checkConstraint(ConstRefVector x, double tol = 1e-6) const;
60
61
 protected:
62
  Vector m_b;
63
};
64
65
}  // namespace math
66
}  // namespace tsid
67
68
#endif  // ifndef __invdyn_math_constraint_equality_hpp__