diff --git a/gtsam/base/SymmetricBlockMatrix.h b/gtsam/base/SymmetricBlockMatrix.h index 53a8912f67..1ec9a5ad36 100644 --- a/gtsam/base/SymmetricBlockMatrix.h +++ b/gtsam/base/SymmetricBlockMatrix.h @@ -76,7 +76,7 @@ namespace gtsam { blockStart_(0) { fillOffsets(dimensions.begin(), dimensions.end(), appendOneDimension); - matrix_.resize(variableColOffsets_.back(), variableColOffsets_.back()); + matrix_.setZero(variableColOffsets_.back(), variableColOffsets_.back()); assertInvariants(); } @@ -86,7 +86,7 @@ namespace gtsam { blockStart_(0) { fillOffsets(firstBlockDim, lastBlockDim, appendOneDimension); - matrix_.resize(variableColOffsets_.back(), variableColOffsets_.back()); + matrix_.setZero(variableColOffsets_.back(), variableColOffsets_.back()); assertInvariants(); } @@ -95,7 +95,7 @@ namespace gtsam { SymmetricBlockMatrix(const CONTAINER& dimensions, const Matrix& matrix, bool appendOneDimension = false) : blockStart_(0) { - matrix_.resize(matrix.rows(), matrix.cols()); + matrix_.setZero(matrix.rows(), matrix.cols()); matrix_.triangularView() = matrix.triangularView(); fillOffsets(dimensions.begin(), dimensions.end(), appendOneDimension); if(matrix_.rows() != matrix_.cols()) diff --git a/gtsam/geometry/tests/testLine3.cpp b/gtsam/geometry/tests/testLine3.cpp index 9812c0c2d3..9ed12aef7d 100644 --- a/gtsam/geometry/tests/testLine3.cpp +++ b/gtsam/geometry/tests/testLine3.cpp @@ -2,10 +2,10 @@ #include #include #include -#include -#include #include #include +#include +#include using namespace gtsam; @@ -146,7 +146,7 @@ TEST(Line3, projection) { SharedNoiseModel model = noiseModel::Isotropic::Sigma(2, 0.1); Unit3_ projected_(wL_, &Line3::project); ExpressionFactor f(model, expected, projected_); - EXPECT_CORRECT_FACTOR_JACOBIANS(f, val, 1e-5, 1e-7); + EXPECT_CORRECT_FACTOR_JACOBIANS(f, val, 1e-5, 1e-5); } int main() { diff --git a/gtsam/navigation/tests/testAHRSFactor.cpp b/gtsam/navigation/tests/testAHRSFactor.cpp index dd216ce342..74acf69da2 100644 --- a/gtsam/navigation/tests/testAHRSFactor.cpp +++ b/gtsam/navigation/tests/testAHRSFactor.cpp @@ -342,7 +342,7 @@ TEST( AHRSFactor, fistOrderExponential ) { //****************************************************************************** TEST( AHRSFactor, FirstOrderPreIntegratedMeasurements ) { // Linearization point - Vector3 bias; ///< Current estimate of rotation rate bias + Vector3 bias = Vector3::Zero(); ///< Current estimate of rotation rate bias Pose3 body_P_sensor(Rot3::Expmap(Vector3(0, 0.1, 0.1)), Point3(1, 0, 1));