diff --git a/gtsam/nonlinear/DoglegOptimizer.h b/gtsam/nonlinear/DoglegOptimizer.h index 010a51fe7..51b03201b 100644 --- a/gtsam/nonlinear/DoglegOptimizer.h +++ b/gtsam/nonlinear/DoglegOptimizer.h @@ -133,12 +133,18 @@ public: */ virtual void iterate(); - /** Access the parameters */ + /** Read-only access the parameters */ const DoglegParams& params() const { return params_; } - /** Access the last state */ + /** Read/write access the parameters. */ + DoglegParams& params() { return params_; } + + /** Read-only access the last state */ const DoglegState& state() const { return state_; } + /** Read/write access the last state. When modifying the state, the error, etc. must be consistent before calling iterate() */ + DoglegState& state() { return state_; } + /** Access the current trust region radius Delta */ double getDelta() const { return state_.Delta; } diff --git a/gtsam/nonlinear/GaussNewtonOptimizer.h b/gtsam/nonlinear/GaussNewtonOptimizer.h index 270182fbf..9c610b2b8 100644 --- a/gtsam/nonlinear/GaussNewtonOptimizer.h +++ b/gtsam/nonlinear/GaussNewtonOptimizer.h @@ -88,12 +88,18 @@ public: */ virtual void iterate(); - /** Access the parameters */ + /** Read-only access the parameters */ const GaussNewtonParams& params() const { return params_; } - /** Access the last state */ + /** Read/write access the parameters. */ + GaussNewtonParams& params() { return params_; } + + /** Read-only access the last state */ const GaussNewtonState& state() const { return state_; } + /** Read/write access the last state. When modifying the state, the error, etc. must be consistent before calling iterate() */ + GaussNewtonState& state() { return state_; } + /// @} protected: diff --git a/gtsam/nonlinear/LevenbergMarquardtOptimizer.h b/gtsam/nonlinear/LevenbergMarquardtOptimizer.h index 7f08db366..140bd247a 100644 --- a/gtsam/nonlinear/LevenbergMarquardtOptimizer.h +++ b/gtsam/nonlinear/LevenbergMarquardtOptimizer.h @@ -150,12 +150,18 @@ public: */ virtual void iterate(); - /** Access the parameters */ + /** Read-only access the parameters */ const LevenbergMarquardtParams& params() const { return params_; } - /** Access the last state */ + /** Read/write access the parameters */ + LevenbergMarquardtParams& params() { return params_; } + + /** Read-only access the last state */ const LevenbergMarquardtState& state() const { return state_; } + /** Read/write access the last state. When modifying the state, the error, etc. must be consistent before calling iterate() */ + LevenbergMarquardtState& state() { return state_; } + /// @} protected: