From 5ddd28ba188cdc0ba39548ce78085b10dcab537f Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Wed, 22 Aug 2012 22:40:20 +0000 Subject: [PATCH] Removed unused noise model cholesky --- gtsam/linear/NoiseModel.cpp | 23 ----------------------- gtsam/linear/NoiseModel.h | 6 ------ gtsam/linear/tests/testNoiseModel.cpp | 12 ------------ 3 files changed, 41 deletions(-) diff --git a/gtsam/linear/NoiseModel.cpp b/gtsam/linear/NoiseModel.cpp index db6fa096d..e493bddde 100644 --- a/gtsam/linear/NoiseModel.cpp +++ b/gtsam/linear/NoiseModel.cpp @@ -133,29 +133,6 @@ SharedDiagonal Gaussian::QR(Matrix& Ab) const { return Unit::Create(maxRank); } -/* ************************************************************************* */ -SharedDiagonal Gaussian::Cholesky(Matrix& Ab, size_t nFrontals) const { - // get size(A) and maxRank - // TODO: really no rank problems ? - - // pre-whiten everything (cheaply if possible) - WhitenInPlace(Ab); - - // Form A'*A (todo: this is probably less efficient than possible) - Ab = Ab.transpose() * Ab; - - // Use Cholesky to factor Ab - size_t maxrank = choleskyCareful(Ab).first; - - // Due to numerical error the rank could appear to be more than the number - // of variables. The important part is that it does not includes the - // augmented b column. - if(maxrank == (size_t) Ab.cols()) - -- maxrank; - - return Unit::Create(maxrank); -} - void Gaussian::WhitenSystem(vector& A, Vector& b) const { BOOST_FOREACH(Matrix& Aj, A) { WhitenInPlace(Aj); } whitenInPlace(b); diff --git a/gtsam/linear/NoiseModel.h b/gtsam/linear/NoiseModel.h index 36fe3cd26..2bb63c382 100644 --- a/gtsam/linear/NoiseModel.h +++ b/gtsam/linear/NoiseModel.h @@ -202,12 +202,6 @@ namespace gtsam { */ virtual boost::shared_ptr QR(Matrix& Ab) const; - /** - * Cholesky factorization - * FIXME: this is never used anywhere - */ - virtual boost::shared_ptr Cholesky(Matrix& Ab, size_t nFrontals) const; - /** * Return R itself, but note that Whiten(H) is cheaper than R*H */ diff --git a/gtsam/linear/tests/testNoiseModel.cpp b/gtsam/linear/tests/testNoiseModel.cpp index 9b53a3be1..224395051 100644 --- a/gtsam/linear/tests/testNoiseModel.cpp +++ b/gtsam/linear/tests/testNoiseModel.cpp @@ -247,18 +247,6 @@ TEST( NoiseModel, QR ) EXPECT(linear_dependent(expectedRd2,Ab2,1e-6)); // Ab was modified in place !!! } -/* ************************************************************************* */ -TEST(NoiseModel, Cholesky) -{ - SharedDiagonal expected = noiseModel::Unit::Create(4); - Matrix Ab = exampleQR::Ab; // otherwise overwritten ! - SharedDiagonal actual = exampleQR::diagonal->Cholesky(Ab, 4); - EXPECT(assert_equal(*expected,*actual)); - // Ab was modified in place !!! - Matrix actualRd = Ab.block(0, 0, actual->dim(), Ab.cols()).triangularView(); - EXPECT(linear_dependent(exampleQR::Rd,actualRd,1e-4)); -} - /* ************************************************************************* */ TEST(NoiseModel, QRNan ) {