Fixed some signed/unsigned issues
parent
b1949966e9
commit
0af87e7298
|
|
@ -156,7 +156,7 @@ boost::tuple<V, int> nonlinearConjugateGradient(const S &system,
|
||||||
|
|
||||||
// GTSAM_CONCEPT_MANIFOLD_TYPE(V);
|
// GTSAM_CONCEPT_MANIFOLD_TYPE(V);
|
||||||
|
|
||||||
int iteration = 0;
|
size_t iteration = 0;
|
||||||
|
|
||||||
// check if we're already close enough
|
// check if we're already close enough
|
||||||
double currentError = system.error(initial);
|
double currentError = system.error(initial);
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public:
|
||||||
double error;
|
double error;
|
||||||
|
|
||||||
/** The number of optimization iterations performed. */
|
/** The number of optimization iterations performed. */
|
||||||
int iterations;
|
size_t iterations;
|
||||||
|
|
||||||
NonlinearOptimizerState() {}
|
NonlinearOptimizerState() {}
|
||||||
|
|
||||||
|
|
@ -50,7 +50,7 @@ public:
|
||||||
virtual ~NonlinearOptimizerState() {}
|
virtual ~NonlinearOptimizerState() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
NonlinearOptimizerState(const NonlinearFactorGraph& graph, const Values& values, unsigned int iterations = 0) :
|
NonlinearOptimizerState(const NonlinearFactorGraph& graph, const Values& values, size_t iterations = 0) :
|
||||||
values(values), error(graph.error(values)), iterations(iterations) {}
|
values(values), error(graph.error(values)), iterations(iterations) {}
|
||||||
|
|
||||||
NonlinearOptimizerState(const Values& values, double error, unsigned int iterations) :
|
NonlinearOptimizerState(const Values& values, double error, unsigned int iterations) :
|
||||||
|
|
@ -166,7 +166,7 @@ public:
|
||||||
double error() const { return _state().error; }
|
double error() const { return _state().error; }
|
||||||
|
|
||||||
/// return number of iterations
|
/// return number of iterations
|
||||||
int iterations() const { return _state().iterations; }
|
size_t iterations() const { return _state().iterations; }
|
||||||
|
|
||||||
/// return values
|
/// return values
|
||||||
const Values& values() const { return _state().values; }
|
const Values& values() const { return _state().values; }
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ public:
|
||||||
SILENT, TERMINATION, ERROR, VALUES, DELTA, LINEAR
|
SILENT, TERMINATION, ERROR, VALUES, DELTA, LINEAR
|
||||||
};
|
};
|
||||||
|
|
||||||
int maxIterations; ///< The maximum iterations to stop iterating (default 100)
|
size_t maxIterations; ///< The maximum iterations to stop iterating (default 100)
|
||||||
double relativeErrorTol; ///< The maximum relative error decrease to stop iterating (default 1e-5)
|
double relativeErrorTol; ///< The maximum relative error decrease to stop iterating (default 1e-5)
|
||||||
double absoluteErrorTol; ///< The maximum absolute error decrease to stop iterating (default 1e-5)
|
double absoluteErrorTol; ///< The maximum absolute error decrease to stop iterating (default 1e-5)
|
||||||
double errorTol; ///< The maximum total error to stop iterating (default 0.0)
|
double errorTol; ///< The maximum total error to stop iterating (default 0.0)
|
||||||
|
|
@ -54,7 +54,7 @@ public:
|
||||||
}
|
}
|
||||||
virtual void print(const std::string& str = "") const;
|
virtual void print(const std::string& str = "") const;
|
||||||
|
|
||||||
int getMaxIterations() const {
|
size_t getMaxIterations() const {
|
||||||
return maxIterations;
|
return maxIterations;
|
||||||
}
|
}
|
||||||
double getRelativeErrorTol() const {
|
double getRelativeErrorTol() const {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue