Package org.ddogleg.optimization.math
Class HessianMath_DDRM
java.lang.Object
org.ddogleg.optimization.math.HessianMath_DDRM
- All Implemented Interfaces:
HessianMath
- Direct Known Subclasses:
HessianBFGS_DDRM
,HessianLeastSquares_DDRM
Hessian is represented as a dense matrix. Any dense linear solver can be used.
-
Field Summary
Modifier and TypeFieldDescriptionprotected DMatrixRMaj
protected LinearSolver<DMatrixRMaj,
DMatrixRMaj> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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 diagvoid
init
(int numParameters) Initialize Hessian to be in its initial state with the specified dimensionsboolean
Initializes the solverdouble
Returns v^T*M*vvoid
setDiagonals
(DMatrixRMaj diag) Sets the diagonal elements in the Hessian to the provided vectorboolean
solve
(DMatrixRMaj Y, DMatrixRMaj step) Solves the system step = inv(B)*Y
-
Field Details
-
solver
-
hessian
-
-
Constructor Details
-
HessianMath_DDRM
public HessianMath_DDRM() -
HessianMath_DDRM
-
-
Method Details
-
init
public void init(int numParameters) Description copied from interface:HessianMath
Initialize Hessian to be in its initial state with the specified dimensions- Specified by:
init
in interfaceHessianMath
- Parameters:
numParameters
- Number of optimization parameters. Hessian will be N by N
-
innerVectorHessian
Description copied from interface:HessianMath
Returns v^T*M*v- Specified by:
innerVectorHessian
in interfaceHessianMath
- Parameters:
v
- vector
-
extractDiagonals
Description copied from interface:HessianMath
Extracts diagonal elements from the hessian and stores them in the vector diag- Specified by:
extractDiagonals
in interfaceHessianMath
- Parameters:
diag
- vector
-
setDiagonals
Description copied from interface:HessianMath
Sets the diagonal elements in the Hessian to the provided vector- Specified by:
setDiagonals
in interfaceHessianMath
- Parameters:
diag
- vector
-
divideRowsCols
Description copied from interface:HessianMath
Applies row and column division using the scaling vector. B = inv(diag(s))*B*inv(diag(s))- Specified by:
divideRowsCols
in interfaceHessianMath
-
initializeSolver
public boolean initializeSolver()Description copied from interface:HessianMath
Initializes the solver- Specified by:
initializeSolver
in interfaceHessianMath
- Returns:
- true if successful
-
solve
Description copied from interface:HessianMath
Solves the system step = inv(B)*Y- Specified by:
solve
in interfaceHessianMath
- Parameters:
Y
- (Input) vectorstep
- (output) vector
-
getHessian
-