Minotaur 0.4.1
Docs for developers
Public Member Functions | List of all members
Minotaur::HessianOfLag Class Reference

#include <HessianOfLag.h>

Inheritance diagram for Minotaur::HessianOfLag:
Inheritance graph
[legend]

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
 

Detailed Description

Given a function f(x), the hessian of f(x) is defined as the matrix whose element $(i,j)$ 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:

\[ l = \lambda_0f + \sum_{i=1}^m\lambda_ig_i \]

This class provides methods for building and managing hessian of the lagrangean by calling the methods of the Functions in objective and constraints.

Constructor & Destructor Documentation

◆ ~HessianOfLag()

HessianOfLag::~HessianOfLag ( )
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.

Member Function Documentation

◆ fillRowColIndices()

void HessianOfLag::fillRowColIndices ( UInt irow,
UInt jcol 
)
virtual

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.

◆ fillRowColValues()

void HessianOfLag::fillRowColValues ( const double *  x,
double  obj_mult,
const double *  con_mult,
double *  values,
int *  error 
)
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.

◆ getNumNz()

UInt HessianOfLag::getNumNz ( ) const
virtual

Return the number of non-zero elements in the lower-triangular part of the hessian, including the diagonal).

Reimplemented in MINOTAUR_AMPL::AMPLHessian.

◆ negateObj()

virtual void Minotaur::HessianOfLag::negateObj ( )
inlinevirtual

Ugly hack to solve maximization problem. TODO: delete it.

Reimplemented in MINOTAUR_AMPL::AMPLHessian.


The documentation for this class was generated from the following files:

Minotaur source code documented by Doxygen 1.9.4 on Sat May 17 2025