13 #include "CoinPackedVector.hpp"
24 typedef std::has_map<matEntry, matIdx, std::hash< matEntry> >
AdjustableMat;
56 double eval_f(
const double *
x,
bool new_x);
63 void eval_grad(
const int nnz,
const double * x,
bool new_x,
double *
values);
104 typedef std::has_map<int, std::pair<double, double >, std::hash<int> >
gStore;
106 typedef std::map<int, std::pair<double, double> >
gStore;
std::pair< int, int > matIdx
Store the number of times entry is used and its index in the matrix.
CoinPackedVector a_
linear term in sparse storage.
bool isLinear()
Says if the constraint is linear.
void internal_eval_grad(const double *x)
Does internal work to evaluate gradiant of this in x.
std::vector< AdjustableMat::iterator > Q_hessian_idx_
To have fast access to entries in full hessian of Q_.
std::vector< gStore::iterator > a_grad_idx_
To have fast access to gradiant entries for a_.
std::vector< gStore::iterator > Q_col_grad_idx_
To have fast access to gradient entries for cols Q_.
void eval_grad(const int nnz, const double *x, bool new_x, double *values)
Evaluate gradiant of quadratic form.
void remove_from_hessian(AdjustableMat &H)
Remove row from a bigger hessian.
double eval_f(const double *x, bool new_x)
Evaluate quadratic form.
void add_to_hessian(AdjustableMat &H, bool offset)
Add row to a bigger hessian.
QuadRow()
Default constructor.
std::vector< gStore::iterator > Q_row_grad_idx_
To have fast access to gradient entries for rows Q_.
Stores a quadratic row of the form l < c + ax + x^T Q x < u.
QuadRow & operator=(const QuadRow &rhs)
Assignment operator.
std::pair< int, int > matEntry
Store column and row of the entry.
int nnz_grad()
Get number of non-zeroes in the gradiant.
void gradiant_struct(const int nnz, int *indices, bool offset)
Get structure of gradiant.
void initialize()
Initialize once quadratic form is know.
bool grad_evaled_
Flag indicating if gradiant has been evaluated.
void eval_hessian(double lambda, double *values)
Return hessian value (i.e.
std::map< int, std::pair< double, double > > gStore
std::map< matEntry, matIdx > AdjustableMat
int nnz_hessian()
number of non-zeroes in hessian.
void print()
Print quadratic constraint.
int nnz
ATTENTION: Filter expect the jacobian to be ordered by row.
void fint fint fint real fint real * x