return immediately if maxIterations is zero

release/4.3a0
Kai Ni 2010-04-28 21:35:01 +00:00
parent 66caac3c1c
commit 5f7b2ef2ee
1 changed files with 2 additions and 0 deletions

View File

@ -229,6 +229,8 @@ namespace gtsam {
double relativeThreshold, double absoluteThreshold,
verbosityLevel verbosity, int maxIterations, double lambdaFactor, LambdaMode lambdaMode) const {
if (maxIterations <= 0) return *this;
// check if we're already close enough
if (error_ < absoluteThreshold) {
if (verbosity >= ERROR) cout << "Exiting, as error = " << error_