# Interface HessianMath

All Known Subinterfaces:
`HessianBFGS`, `HessianLeastSquares<S>`, `HessianSchurComplement<S>`
All Known Implementing Classes:
`HessianBFGS_DDRM`, `HessianLeastSquares_DDRM`, `HessianLeastSquares_DSCC`, `HessianMath_DDRM`, `HessianMath_DSCC`, `HessianSchurComplement_Base`, `HessianSchurComplement_DDRM`, `HessianSchurComplement_DSCC`

public interface HessianMath
Abstraction layer for operations related to hessian matrix. This allows different internal representations of the Hessian matrix to be used by the same code.
• ## Method Summary

Modifier and Type
Method
Description
`void`
`divideRowsCols(DMatrixRMaj scaling)`
Applies row and column division using the scaling vector.
`void`
`extractDiagonals(DMatrixRMaj diag)`
Extracts diagonal elements from the hessian and stores them in the vector diag
`void`
`init(int numParameters)`
Initialize Hessian to be in its initial state with the specified dimensions
`boolean`
`initializeSolver()`
Initializes the solver
`double`
`innerVectorHessian(DMatrixRMaj v)`
Returns v^T*M*v
`void`
`setDiagonals(DMatrixRMaj diag)`
Sets the diagonal elements in the Hessian to the provided vector
`boolean`
```solve(DMatrixRMaj Y, DMatrixRMaj step)```
Solves the system step = inv(B)*Y
• ## Method Details

• ### init

void init(int numParameters)
Initialize Hessian to be in its initial state with the specified dimensions
Parameters:
`numParameters` - Number of optimization parameters. Hessian will be N by N
• ### innerVectorHessian

double innerVectorHessian(DMatrixRMaj v)
Returns v^T*M*v
Parameters:
`v` - vector
• ### extractDiagonals

void extractDiagonals(DMatrixRMaj diag)
Extracts diagonal elements from the hessian and stores them in the vector diag
Parameters:
`diag` - vector
• ### setDiagonals

void setDiagonals(DMatrixRMaj diag)
Sets the diagonal elements in the Hessian to the provided vector
Parameters:
`diag` - vector
• ### divideRowsCols

void divideRowsCols(DMatrixRMaj scaling)
Applies row and column division using the scaling vector. B = inv(diag(s))*B*inv(diag(s))
Parameters:
`scaling` -
• ### initializeSolver

boolean initializeSolver()
Initializes the solver
Returns:
true if successful
• ### solve

boolean solve(DMatrixRMaj Y, DMatrixRMaj step)
Solves the system step = inv(B)*Y
Parameters:
`Y` - (Input) vector
`step` - (output) vector