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
FieldsModifier and TypeFieldDescriptionprotected DMatrixRMajprotected LinearSolver<DMatrixRMaj,DMatrixRMaj> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddivideRowsCols(DMatrixRMaj scaling) Applies row and column division using the scaling vector.voidextractDiagonals(DMatrixRMaj diag) Extracts diagonal elements from the hessian and stores them in the vector diagvoidinit(int numParameters) Initialize Hessian to be in its initial state with the specified dimensionsbooleanInitializes the solverdoubleReturns v^T*M*vvoidsetDiagonals(DMatrixRMaj diag) Sets the diagonal elements in the Hessian to the provided vectorbooleansolve(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:HessianMathInitialize Hessian to be in its initial state with the specified dimensions- Specified by:
initin interfaceHessianMath- Parameters:
numParameters- Number of optimization parameters. Hessian will be N by N
-
innerVectorHessian
Description copied from interface:HessianMathReturns v^T*M*v- Specified by:
innerVectorHessianin interfaceHessianMath- Parameters:
v- vector
-
extractDiagonals
Description copied from interface:HessianMathExtracts diagonal elements from the hessian and stores them in the vector diag- Specified by:
extractDiagonalsin interfaceHessianMath- Parameters:
diag- vector
-
setDiagonals
Description copied from interface:HessianMathSets the diagonal elements in the Hessian to the provided vector- Specified by:
setDiagonalsin interfaceHessianMath- Parameters:
diag- vector
-
divideRowsCols
Description copied from interface:HessianMathApplies row and column division using the scaling vector. B = inv(diag(s))*B*inv(diag(s))- Specified by:
divideRowsColsin interfaceHessianMath
-
initializeSolver
public boolean initializeSolver()Description copied from interface:HessianMathInitializes the solver- Specified by:
initializeSolverin interfaceHessianMath- Returns:
- true if successful
-
solve
Description copied from interface:HessianMathSolves the system step = inv(B)*Y- Specified by:
solvein interfaceHessianMath- Parameters:
Y- (Input) vectorstep- (output) vector
-
getHessian
-