diff --git a/gtsam.h b/gtsam.h index 3222cd2d1..9d7d7a7a6 100644 --- a/gtsam.h +++ b/gtsam.h @@ -1090,13 +1090,13 @@ class LevenbergMarquardtParams { LevenbergMarquardtParams(); void print(string s) const; - double getMaxIterations() const; + size_t getMaxIterations() const; double getRelativeErrorTol() const; double getAbsoluteErrorTol() const; double getErrorTol() const; string getVerbosity() const; - void setMaxIterations(double value); + void setMaxIterations(size_t value); void setRelativeErrorTol(double value); void setAbsoluteErrorTol(double value); void setErrorTol(double value); diff --git a/gtsam/linear/VectorValues.h b/gtsam/linear/VectorValues.h index aa9c1aa6d..9fad99223 100644 --- a/gtsam/linear/VectorValues.h +++ b/gtsam/linear/VectorValues.h @@ -419,7 +419,7 @@ namespace gtsam { maps_.reserve(maps_.size() + dimensions.size()); BOOST_FOREACH(size_t dim, dimensions) { maps_.push_back(values_.segment(varStart, dim)); - varStart += dim; // varStart is continued from first for loop + varStart += (int)dim; // varStart is continued from first for loop } } diff --git a/gtsam/nonlinear/NonlinearOptimizer.h b/gtsam/nonlinear/NonlinearOptimizer.h index 44b352938..1c071faef 100644 --- a/gtsam/nonlinear/NonlinearOptimizer.h +++ b/gtsam/nonlinear/NonlinearOptimizer.h @@ -45,23 +45,23 @@ public: Verbosity verbosity; ///< The printing verbosity during optimization (default SILENT) NonlinearOptimizerParams() : - maxIterations(100.0), relativeErrorTol(1e-5), absoluteErrorTol(1e-5), + maxIterations(100), relativeErrorTol(1e-5), absoluteErrorTol(1e-5), errorTol(0.0), verbosity(SILENT) {} virtual ~NonlinearOptimizerParams() {} virtual void print(const std::string& str = "") const ; - inline double getMaxIterations() const { return maxIterations; } - inline double getRelativeErrorTol() const { return relativeErrorTol; } - inline double getAbsoluteErrorTol() const { return absoluteErrorTol; } - inline double getErrorTol() const { return errorTol; } - inline std::string getVerbosity() const { return verbosityTranslator(verbosity); } + size_t getMaxIterations() const { return maxIterations; } + double getRelativeErrorTol() const { return relativeErrorTol; } + double getAbsoluteErrorTol() const { return absoluteErrorTol; } + double getErrorTol() const { return errorTol; } + std::string getVerbosity() const { return verbosityTranslator(verbosity); } - inline void setMaxIterations(double value) { maxIterations = value; } - inline void setRelativeErrorTol(double value) { relativeErrorTol = value; } - inline void setAbsoluteErrorTol(double value) { absoluteErrorTol = value; } - inline void setErrorTol(double value) { errorTol = value ; } - inline void setVerbosity(const std::string &src) { verbosity = verbosityTranslator(src); } + void setMaxIterations(size_t value) { maxIterations = value; } + void setRelativeErrorTol(double value) { relativeErrorTol = value; } + void setAbsoluteErrorTol(double value) { absoluteErrorTol = value; } + void setErrorTol(double value) { errorTol = value ; } + void setVerbosity(const std::string &src) { verbosity = verbosityTranslator(src); } Verbosity verbosityTranslator(const std::string &s) const; std::string verbosityTranslator(Verbosity value) const; diff --git a/gtsam/nonlinear/Ordering.h b/gtsam/nonlinear/Ordering.h index c2bac18f8..c6881fbde 100644 --- a/gtsam/nonlinear/Ordering.h +++ b/gtsam/nonlinear/Ordering.h @@ -155,7 +155,7 @@ public: iterator end() { return order_.end(); } /// Test if the key exists in the ordering. - bool exists(Key key) const { return order_.count(key); } + bool exists(Key key) const { return order_.count(key) > 0; } ///TODO: comment std::pair tryInsert(Key key, Index order) { return tryInsert(std::make_pair(key,order)); }