Minotaur 0.4.1
Docs for developers
|
#include <HessianOfLag.h>
Public Member Functions | |
HessianOfLag () | |
Default constructor. | |
HessianOfLag (Problem *p) | |
virtual | ~HessianOfLag () |
Destroy. More... | |
virtual UInt | getNumNz () const |
virtual void | fillRowColIndices (UInt *irow, UInt *jcol) |
virtual void | fillRowColValues (const double *x, double obj_mult, const double *con_mult, double *values, int *error) |
virtual void | negateObj () |
Ugly hack to solve maximization problem. TODO: delete it. More... | |
virtual void | setupRowCol () |
virtual void | write (std::ostream &out) const |
Given a function f(x), the hessian of f(x) is defined as the matrix whose element is: d^2f/dx_idx_j], i=0,1,...,n-1, j=0,1,...,n-1. Hessian is thus a square symmetric matrix. We store only the lower-triangular part of the matrix, i.e., i=0,1,...,n-1, j=0,...,i
Thus each function can have an associated Hessian. NLP solvers do not usually require hessian of the objective function or a function from a single constraint. They usually need hessian of the lagrangean function. This function is defined as:
This class provides methods for building and managing hessian of the lagrangean by calling the methods of the Functions in objective and constraints.
|
virtual |
Destroy.
Construct Hessian of Lagrangean from an objective, obj, and a vector of constraints cons. 'n' is the number of variables and is also the size of square matrix.
Given arrays iRow and jCol of size getNumNz(), fill the values of rows and columns that have non-zeros.
e.g. if f(x) = x0^2 + x1^3x2 + x1
then getNumNz() = 3 iRow = [0, 1, 2] jCol = [0, 1, 1]
Reimplemented in MINOTAUR_AMPL::AMPLHessian.
|
virtual |
Given arrays iRow and jCol of size getNumNz(), fill the values of hessian matrix at a given point 'x', into the array 'values'. for the above example, values = [2, 6x1x2, 3x1^2]
Reimplemented in MINOTAUR_AMPL::AMPLHessian.
|
virtual |
Return the number of non-zero elements in the lower-triangular part of the hessian, including the diagonal).
Reimplemented in MINOTAUR_AMPL::AMPLHessian.
|
inlinevirtual |
Ugly hack to solve maximization problem. TODO: delete it.
Reimplemented in MINOTAUR_AMPL::AMPLHessian.