immediately returns when the maximum iteration number is 0

release/4.3a0
Kai Ni 2011-03-11 05:28:53 +00:00
parent 8768fb0d29
commit cc3db4f918
1 changed files with 4 additions and 0 deletions

View File

@ -241,7 +241,11 @@ namespace gtsam {
return *this;
}
// for the case that maxIterations_ = 0
iterations_ = 1;
if (iterations_ >= parameters_->maxIterations_)
return *this;
while (true) {
double previous_error = error_;
// do one iteration of LM