Returning empty noise model from QR and fix for backwards-compatibility in old code

release/4.3a0
Richard Roberts 2013-07-12 22:27:44 +00:00
parent 073679f831
commit 941cd93bf6
2 changed files with 6 additions and 1 deletions

View File

@ -476,6 +476,11 @@ namespace gtsam {
// Use in-place QR dense Ab appropriate to NoiseModel
gttic(QR);
SharedDiagonal noiseModel = model_->QR(matrix_);
// In the new unordered code, empty noise model indicates unit noise model, and I already
// modified QR to return an empty noise model. This just creates a unit noise model in that
// case because this old code does not handle empty noise models.
if(!noiseModel)
noiseModel = noiseModel::Unit::Create(std::min(matrix_.rows(), matrix_.cols() - 1));
gttoc(QR);
// Zero the lower-left triangle. todo: not all of these entries actually

View File

@ -131,7 +131,7 @@ SharedDiagonal Gaussian::QR(Matrix& Ab) const {
// TODO: necessary to isolate last column?
// householder(Ab, maxRank);
return Unit::Create(maxRank);
return SharedDiagonal();
}
void Gaussian::WhitenSystem(vector<Matrix>& A, Vector& b) const {