if (aResult == GCS::Failed) {
// DogLeg solver failed without conflicting constraints, try to use Levenberg-Marquardt solver
+ diagnose(GCS::LevenbergMarquardt);
aResult = (GCS::SolveStatus)myEquationSystem->solve(myParameters, true,
GCS::LevenbergMarquardt);
+ if (aResult == GCS::Failed) {
+ diagnose(GCS::BFGS);
+ aResult = (GCS::SolveStatus)myEquationSystem->solve(myParameters, true, GCS::BFGS);
+ }
}
Events_LongOp::end(this);
return myDOF;
}
-void PlaneGCSSolver_Solver::diagnose()
+void PlaneGCSSolver_Solver::diagnose(const GCS::Algorithm& theAlgo)
{
myEquationSystem->declareUnknowns(myParameters);
- myDOF = myEquationSystem->diagnose();
+ myDOF = myEquationSystem->diagnose(theAlgo);
myDiagnoseBeforeSolve = false;
}
bool isConflicting(const ConstraintID& theConstraint) const;
/// \brief Check conflicting/redundant constraints and DoF
- void diagnose();
+ void diagnose(const GCS::Algorithm& theAlgo = GCS::DogLeg);
/// \brief Degrees of freedom
int dof();