improved equals method for NonlinearOptimizerParams
parent
cb226633c5
commit
48b270efc5
|
|
@ -115,14 +115,22 @@ public:
|
|||
virtual void print(const std::string& str = "") const;
|
||||
|
||||
bool equals(const NonlinearOptimizerParams& other, double tol = 1e-9) const {
|
||||
return maxIterations == other.getMaxIterations()
|
||||
&& std::abs(relativeErrorTol - other.getRelativeErrorTol()) <= tol
|
||||
&& std::abs(absoluteErrorTol - other.getAbsoluteErrorTol()) <= tol
|
||||
&& std::abs(errorTol - other.getErrorTol()) <= tol
|
||||
&& verbosityTranslator(verbosity) == other.getVerbosity();
|
||||
// && orderingType.equals(other.getOrderingType()_;
|
||||
// && linearSolverType == other.getLinearSolverType();
|
||||
// TODO: check ordering, iterativeParams, and iterationsHook
|
||||
// Check for equality of shared ptrs
|
||||
bool iterative_params_equal = false;
|
||||
if (iterativeParams == other.iterativeParams) {
|
||||
iterative_params_equal = true;
|
||||
}
|
||||
if (iterativeParams && other.iterativeParams) {
|
||||
iterative_params_equal = iterativeParams->equals(*other.iterativeParams);
|
||||
}
|
||||
|
||||
return maxIterations == other.getMaxIterations() &&
|
||||
std::abs(relativeErrorTol - other.getRelativeErrorTol()) <= tol &&
|
||||
std::abs(absoluteErrorTol - other.getAbsoluteErrorTol()) <= tol &&
|
||||
std::abs(errorTol - other.getErrorTol()) <= tol &&
|
||||
verbosityTranslator(verbosity) == other.getVerbosity() &&
|
||||
orderingType == other.orderingType && ordering == other.ordering &&
|
||||
linearSolverType == other.linearSolverType && iterative_params_equal;
|
||||
}
|
||||
|
||||
inline bool isMultifrontal() const {
|
||||
|
|
|
|||
Loading…
Reference in New Issue