#include <BonQuadRow.hpp>
Collaboration diagram for Bonmin::QuadRow:

Public Member Functions | |
| QuadRow () | |
| Default constructor. | |
| QuadRow (const QuadRow &other) | |
| Copy constructor. | |
| QuadRow & | operator= (const QuadRow &rhs) |
| Assignment operator. | |
| QuadRow (const QuadCut &cut) | |
| Constructor from a quadratic cut. | |
| QuadRow & | operator= (const QuadCut &rhs) |
| Assignment form a quadrattic &cut. | |
| QuadRow (const OsiRowCut &cut) | |
| Constructor from a linear cut. | |
| QuadRow & | operator= (const OsiRowCut &rhs) |
| Assignment form a linear &cut. | |
| double | eval_f (const double *x, bool new_x) |
| Evaluate quadratic form. | |
| 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 | eval_grad (const int nnz, const double *x, bool new_x, double *values) |
| Evaluate gradiant of quadratic form. | |
| int | nnz_hessian () |
| number of non-zeroes in hessian. | |
| bool | isLinear () |
| Says if the constraint is linear. | |
| void | eval_hessian (double lambda, double *values) |
| Return hessian values (i.e. | |
| void | add_to_hessian (AdjustableMat &H, bool offset) |
| Add row to a bigger hessian. | |
| void | remove_from_hessian (AdjustableMat &H) |
| Remove row from a bigger hessian. | |
| void | print () |
| Print quadratic constraint. | |
Private Types | |
| typedef std::map< int, std::pair< double, double > > | gStore |
Private Member Functions | |
| void | initialize () |
| Initialize once quadratic form is know. | |
| void | internal_eval_grad (const double *x) |
| Does internal work to evaluate gradiant of this in x. | |
Private Attributes | |
| double | lb_ |
| lower bound. | |
| double | ub_ |
| upper bound. | |
| double | c_ |
| Constant term. | |
| CoinPackedVector | a_ |
| linear term in sparse storage. | |
| TMat | Q_ |
| Quadratic term. | |
| gStore | g_ |
| std::vector< gStore::iterator > | a_grad_idx_ |
| To have fast access to gradiant entries for a_. | |
| std::vector< gStore::iterator > | Q_row_grad_idx_ |
| To have fast access to gradient entries for rows Q_. | |
| std::vector< gStore::iterator > | Q_col_grad_idx_ |
| To have fast access to gradient entries for cols Q_. | |
| std::vector< AdjustableMat::iterator > | Q_hessian_idx_ |
| To have fast access to entries in full hessian of Q_. | |
| bool | grad_evaled_ |
| Flag indicating if gradiant has been evaluated. | |
Does computation usefull for nlp-solver. It can only be initialized from a QuadCut.
Definition at line 32 of file BonQuadRow.hpp.
typedef std::map<int, std::pair<double, double> > Bonmin::QuadRow::gStore [private] |
Definition at line 106 of file BonQuadRow.hpp.
| Bonmin::QuadRow::QuadRow | ( | ) |
| Bonmin::QuadRow::QuadRow | ( | const QuadRow & | other | ) |
| Bonmin::QuadRow::QuadRow | ( | const QuadCut & | cut | ) |
Constructor from a quadratic cut.
Definition at line 54 of file BonQuadRow.cpp.
References initialize().
| Bonmin::QuadRow::QuadRow | ( | const OsiRowCut & | cut | ) |
Constructor from a linear cut.
Definition at line 79 of file BonQuadRow.cpp.
References initialize().
Assignment operator.
Definition at line 37 of file BonQuadRow.cpp.
References a_, a_grad_idx_, c_, g_, grad_evaled_, initialize(), Q_, Q_col_grad_idx_, Q_hessian_idx_, and Q_row_grad_idx_.
Assignment form a quadrattic &cut.
Definition at line 63 of file BonQuadRow.cpp.
References a_, a_grad_idx_, Bonmin::QuadCut::c(), c_, g_, initialize(), Bonmin::TMat::make_upper_triangular(), Bonmin::QuadCut::Q(), Q_, Q_col_grad_idx_, Q_row_grad_idx_, and Bonmin::QuadCut::type().
| QuadRow & Bonmin::QuadRow::operator= | ( | const OsiRowCut & | rhs | ) |
Assignment form a linear &cut.
Definition at line 88 of file BonQuadRow.cpp.
References a_, a_grad_idx_, c_, g_, initialize(), Q_, Q_col_grad_idx_, and Q_row_grad_idx_.
| double Bonmin::QuadRow::eval_f | ( | const double * | x, | |
| bool | new_x | |||
| ) |
Evaluate quadratic form.
Definition at line 160 of file BonQuadRow.cpp.
References a_, c_, g_, internal_eval_grad(), and n.
| int Bonmin::QuadRow::nnz_grad | ( | ) |
Get number of non-zeroes in the gradiant.
Definition at line 184 of file BonQuadRow.cpp.
References g_.
| void Bonmin::QuadRow::gradiant_struct | ( | const int | nnz, | |
| int * | indices, | |||
| bool | offset | |||
| ) |
| void Bonmin::QuadRow::eval_grad | ( | const int | nnz, | |
| const double * | x, | |||
| bool | new_x, | |||
| double * | values | |||
| ) |
Evaluate gradiant of quadratic form.
Definition at line 199 of file BonQuadRow.cpp.
References DEBUG, g_, internal_eval_grad(), and n.
| int Bonmin::QuadRow::nnz_hessian | ( | ) | [inline] |
number of non-zeroes in hessian.
Definition at line 66 of file BonQuadRow.hpp.
References Bonmin::TMat::nnz_, and Q_.
| bool Bonmin::QuadRow::isLinear | ( | ) | [inline] |
Says if the constraint is linear.
Definition at line 70 of file BonQuadRow.hpp.
References Bonmin::TMat::nnz_, and Q_.
| void Bonmin::QuadRow::eval_hessian | ( | double | lambda, | |
| double * | values | |||
| ) |
Return hessian values (i.e.
Q_).
Definition at line 296 of file BonQuadRow.cpp.
References DEBUG, Bonmin::TMat::nnz_, Q_, Q_hessian_idx_, and Bonmin::TMat::value_.
| void Bonmin::QuadRow::add_to_hessian | ( | AdjustableMat & | H, | |
| bool | offset | |||
| ) |
Add row to a bigger hessian.
Definition at line 262 of file BonQuadRow.cpp.
References e, Bonmin::TMat::iRow_, Bonmin::TMat::jCol_, Bonmin::TMat::nnz_, Q_, and Q_hessian_idx_.
| void Bonmin::QuadRow::remove_from_hessian | ( | AdjustableMat & | H | ) |
Remove row from a bigger hessian.
Definition at line 283 of file BonQuadRow.cpp.
References Bonmin::TMat::nnz_, Q_, and Q_hessian_idx_.
| void Bonmin::QuadRow::print | ( | ) |
| void Bonmin::QuadRow::initialize | ( | ) | [private] |
Initialize once quadratic form is know.
Definition at line 103 of file BonQuadRow.cpp.
References a_, a_grad_idx_, g_, grad_evaled_, Bonmin::TMat::iRow_, Bonmin::TMat::jCol_, n, Bonmin::TMat::nnz_, Bonmin::TMat::nonEmptyCols(), Bonmin::TMat::nonEmptyRows(), Bonmin::TMat::numNonEmptyCols(), Bonmin::TMat::numNonEmptyRows(), Q_, Q_col_grad_idx_, and Q_row_grad_idx_.
Referenced by operator=(), and QuadRow().
| void Bonmin::QuadRow::internal_eval_grad | ( | const double * | x | ) | [private] |
Does internal work to evaluate gradiant of this in x.
Definition at line 223 of file BonQuadRow.cpp.
References Bonmin::TMat::columnOrdering_, g_, grad_evaled_, Bonmin::TMat::iRow_, Bonmin::TMat::jCol_, k, Bonmin::TMat::nonEmptyCols(), Bonmin::TMat::nonEmptyRows(), Q_, Q_col_grad_idx_, Q_row_grad_idx_, Bonmin::TMat::rowOrdering_, and Bonmin::TMat::value_.
Referenced by eval_f(), and eval_grad().
double Bonmin::QuadRow::lb_ [private] |
double Bonmin::QuadRow::ub_ [private] |
double Bonmin::QuadRow::c_ [private] |
Constant term.
Definition at line 96 of file BonQuadRow.hpp.
Referenced by eval_f(), operator=(), and print().
CoinPackedVector Bonmin::QuadRow::a_ [private] |
linear term in sparse storage.
Definition at line 98 of file BonQuadRow.hpp.
Referenced by eval_f(), initialize(), operator=(), and print().
TMat Bonmin::QuadRow::Q_ [private] |
Quadratic term.
Definition at line 100 of file BonQuadRow.hpp.
Referenced by add_to_hessian(), eval_hessian(), initialize(), internal_eval_grad(), isLinear(), nnz_hessian(), operator=(), and remove_from_hessian().
gStore Bonmin::QuadRow::g_ [private] |
Definition at line 109 of file BonQuadRow.hpp.
Referenced by eval_f(), eval_grad(), gradiant_struct(), initialize(), internal_eval_grad(), nnz_grad(), and operator=().
std::vector<gStore::iterator> Bonmin::QuadRow::a_grad_idx_ [private] |
To have fast access to gradiant entries for a_.
Definition at line 111 of file BonQuadRow.hpp.
Referenced by initialize(), and operator=().
std::vector<gStore::iterator> Bonmin::QuadRow::Q_row_grad_idx_ [private] |
To have fast access to gradient entries for rows Q_.
Definition at line 113 of file BonQuadRow.hpp.
Referenced by initialize(), internal_eval_grad(), and operator=().
std::vector<gStore::iterator> Bonmin::QuadRow::Q_col_grad_idx_ [private] |
To have fast access to gradient entries for cols Q_.
Definition at line 115 of file BonQuadRow.hpp.
Referenced by initialize(), internal_eval_grad(), and operator=().
std::vector<AdjustableMat::iterator> Bonmin::QuadRow::Q_hessian_idx_ [private] |
To have fast access to entries in full hessian of Q_.
Definition at line 117 of file BonQuadRow.hpp.
Referenced by add_to_hessian(), eval_hessian(), operator=(), and remove_from_hessian().
bool Bonmin::QuadRow::grad_evaled_ [private] |
Flag indicating if gradiant has been evaluated.
Definition at line 119 of file BonQuadRow.hpp.
Referenced by initialize(), internal_eval_grad(), and operator=().
1.4.7