1 |
#ifndef _NONLINEARCONS_H_
|
2 |
#define _NONLINEARCONS_H_
|
3 |
|
4 |
#include "Constraint.hpp"
|
5 |
#include "NLModel.hpp"
|
6 |
|
7 |
/**
|
8 |
* Linear Constraint for nonlinear optimization problem
|
9 |
* boundType is used to identify whether it is linear equation constraint or linear inequality
|
10 |
* constraint. If it is nonlinear inequality constraint
|
11 |
*/
|
12 |
|
13 |
class NonlinearCons : public ConstraintBase{
|
14 |
|
15 |
public:
|
16 |
NonlinearCons(vector<int>& theIndex, NLModel* theModel , double b, BoundType bType);
|
17 |
NonlinearCons(int dim, vector<int>& theIndex, NLModel* theModel , double b, BoundType bType);
|
18 |
|
19 |
void setDim(int dim);
|
20 |
|
21 |
virtual double calcResidual(vector<double>& x);
|
22 |
virtual vector<double> calcConsGrad(vector<double>& x);
|
23 |
virtual SymMatrix calcConsHessian(vector<double>& x);
|
24 |
|
25 |
protected:
|
26 |
|
27 |
vector<int> index;
|
28 |
NLModel* model;
|
29 |
|
30 |
};
|
31 |
#endif
|