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