@Override public void computeUpdate(DMatrixRMaj step, double regionRadius) { if( positiveDefinite ) { // If the GN solution is inside the trust region it should use that solution if( distanceGN <= regionRadius ) { if( verbose != null ) verbose.println(" newton"); gaussNewtonStep(step); } else if( distanceCauchy >= regionRadius ) { if( verbose != null ) verbose.println(" cauchy"); // if the trust region comes before the Cauchy point then perform the cauchy step cauchyStep(regionRadius, step); } else { if( verbose != null ) verbose.println(" combined"); // the solution lies on the line connecting Cauchy and GN combinedStep(regionRadius, step); } } else { if( verbose != null ) verbose.println(" not positive-definite. gBg="+gBg); // Cauchy step for negative semi-definite systems stepLength = regionRadius; CommonOps_DDRM.scale(-stepLength, direction,step); predictedReduction = stepLength*owner.gradientNorm - 0.5*stepLength*stepLength*gBg; } }
@Override public void computeUpdate(DMatrixRMaj step, double regionRadius) { if( positiveDefinite ) { // If the GN solution is inside the trust region it should use that solution if( distanceGN <= regionRadius ) { if( verbose != null ) verbose.println(" newton"); gaussNewtonStep(step); } else if( distanceCauchy >= regionRadius ) { if( verbose != null ) verbose.println(" cauchy"); // if the trust region comes before the Cauchy point then perform the cauchy step cauchyStep(regionRadius, step); } else { if( verbose != null ) verbose.println(" combined"); // the solution lies on the line connecting Cauchy and GN combinedStep(regionRadius, step); } } else { if( verbose != null ) verbose.println(" not positive-definite. gBg="+gBg); // Cauchy step for negative semi-definite systems stepLength = regionRadius; CommonOps_DDRM.scale(-stepLength, direction,step); predictedReduction = stepLength*owner.gradientNorm - 0.5*stepLength*stepLength*gBg; } }