diff --git a/gtsam/linear/NoiseModel.cpp b/gtsam/linear/NoiseModel.cpp index 3218d9ebb..641b47640 100644 --- a/gtsam/linear/NoiseModel.cpp +++ b/gtsam/linear/NoiseModel.cpp @@ -370,6 +370,8 @@ SharedDiagonal Constrained::QR(Matrix& Ab) const { list Rd; Vector pseudo(m); // allocate storage for pseudo-inverse + Vector invsigmas = reciprocal(sigmas_); + Vector weights = emul(invsigmas,invsigmas); // calculate weights once // We loop over all columns, because the columns that can be eliminated // are not necessarily contiguous. For each one, estimate the corresponding @@ -381,7 +383,7 @@ SharedDiagonal Constrained::QR(Matrix& Ab) const { // Calculate weighted pseudo-inverse and corresponding precision gttic(constrained_QR_weightedPseudoinverse); - double precision = weightedPseudoinverse(a, precisions_, pseudo); + double precision = weightedPseudoinverse(a, weights, pseudo); gttoc(constrained_QR_weightedPseudoinverse); // If precision is zero, no information on this column