diff --git a/gtsam/base/SymmetricBlockMatrix.h b/gtsam/base/SymmetricBlockMatrix.h index 378e91144..f6d4fa9c2 100644 --- a/gtsam/base/SymmetricBlockMatrix.h +++ b/gtsam/base/SymmetricBlockMatrix.h @@ -256,11 +256,16 @@ namespace gtsam { full().triangularView() = xpr.template triangularView(); } - /// Set the entire active matrix zero. + /// Set the entire *active* matrix zero. void setZero() { full().triangularView().setZero(); } + /// Set entire matrix zero. + void setAllZero() { + matrix_.setZero(); + } + /// Negate the entire active matrix. void negate(); diff --git a/gtsam/linear/HessianFactor.cpp b/gtsam/linear/HessianFactor.cpp index 701e79f41..f2130f068 100644 --- a/gtsam/linear/HessianFactor.cpp +++ b/gtsam/linear/HessianFactor.cpp @@ -245,7 +245,7 @@ HessianFactor::HessianFactor(const GaussianFactorGraph& factors, // Form A' * A gttic(update); - info_.setZero(); + info_.setAllZero(); for(const auto& factor: factors) if (factor) factor->updateHessian(keys_, &info_);