diff --git a/gtsam/base/Matrix.cpp b/gtsam/base/Matrix.cpp index 6248ad77d..ebff37a7d 100644 --- a/gtsam/base/Matrix.cpp +++ b/gtsam/base/Matrix.cpp @@ -639,7 +639,7 @@ void inplace_QR(Matrix& A){ Eigen::internal::householder_qr_inplace_blocked::run(A, hCoeffs, 48, temp.data()); #endif - zeroBelowDiagonal(A); + A.triangularView().setZero(); } } // namespace gtsam diff --git a/gtsam/base/Matrix.h b/gtsam/base/Matrix.h index 2b177e3d7..1cbc6e469 100644 --- a/gtsam/base/Matrix.h +++ b/gtsam/base/Matrix.h @@ -216,19 +216,6 @@ const typename MATRIX::ConstRowXpr row(const MATRIX& A, size_t j) { return A.row(j); } -/** - * Zeros all of the elements below the diagonal of a matrix, in place - * @param A is a matrix, to be modified in place - * @param cols is the number of columns to zero, use zero for all columns - */ -template -void zeroBelowDiagonal(MATRIX& A, size_t cols=0) { - const size_t m = A.rows(), n = A.cols(); - const size_t k = (cols) ? std::min(cols, std::min(m,n)) : std::min(m,n); - for (size_t j=0; j().setZero(); EXPECT(assert_equal(expected, actual, 1e-3));