Removed unused noise model cholesky

release/4.3a0
Richard Roberts 2012-08-22 22:40:20 +00:00
parent f704dbe0c2
commit 5ddd28ba18
3 changed files with 0 additions and 41 deletions

View File

@ -133,29 +133,6 @@ SharedDiagonal Gaussian::QR(Matrix& Ab) const {
return Unit::Create(maxRank); 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<Matrix>& A, Vector& b) const { void Gaussian::WhitenSystem(vector<Matrix>& A, Vector& b) const {
BOOST_FOREACH(Matrix& Aj, A) { WhitenInPlace(Aj); } BOOST_FOREACH(Matrix& Aj, A) { WhitenInPlace(Aj); }
whitenInPlace(b); whitenInPlace(b);

View File

@ -202,12 +202,6 @@ namespace gtsam {
*/ */
virtual boost::shared_ptr<Diagonal> QR(Matrix& Ab) const; virtual boost::shared_ptr<Diagonal> QR(Matrix& Ab) const;
/**
* Cholesky factorization
* FIXME: this is never used anywhere
*/
virtual boost::shared_ptr<Diagonal> Cholesky(Matrix& Ab, size_t nFrontals) const;
/** /**
* Return R itself, but note that Whiten(H) is cheaper than R*H * Return R itself, but note that Whiten(H) is cheaper than R*H
*/ */

View File

@ -247,18 +247,6 @@ TEST( NoiseModel, QR )
EXPECT(linear_dependent(expectedRd2,Ab2,1e-6)); // Ab was modified in place !!! 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<Eigen::Upper>();
EXPECT(linear_dependent(exampleQR::Rd,actualRd,1e-4));
}
/* ************************************************************************* */ /* ************************************************************************* */
TEST(NoiseModel, QRNan ) TEST(NoiseModel, QRNan )
{ {