-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconstraint-inequality.h
52 lines (36 loc) · 1.2 KB
/
constraint-inequality.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef __HQP__Constraint__INEQUALITY__
#define __HQP__Constraint__INEQUALITY__
#include "constraint-base.h"
#include <string>
namespace HQP {
namespace constraint {
class ConstraintInequality : public ConstraintBase
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
ConstraintInequality(const std::string & name);
ConstraintInequality(const std::string & name, const unsigned int rows, const unsigned int cols);
ConstraintInequality(const std::string & name, Cref_matrixXd A, Cref_vectorXd lb, Cref_vectorXd ub);
unsigned int rows() const;
unsigned int cols() const;
void resize(const unsigned int r, const unsigned int c);
bool isEquality() const;
bool isInequality() const;
bool isBound() const;
const VectorXd & vector() const;
const VectorXd & lowerBound() const;
const VectorXd & upperBound() const;
VectorXd & vector();
VectorXd & lowerBound();
VectorXd & upperBound();
bool setVector(Cref_vectorXd b);
bool setLowerBound(Cref_vectorXd lb);
bool setUpperBound(Cref_vectorXd ub);
bool checkConstraint(Cref_vectorXd x, double tol = 1e-6) const;
protected:
VectorXd m_lb;
VectorXd m_ub;
};
}
}
#endif // __HQP__Constraint__INEQUALITY__