From 379ad8b3d2488e4a6d88d555cc1ccf861ead8e3f Mon Sep 17 00:00:00 2001 From: Alex Hagiopol Date: Mon, 11 Apr 2016 15:25:08 -0400 Subject: [PATCH] Fixed incorrect replacement of Vector.h's ones(n) with Matrix::Ones(m,n). --- gtsam/linear/tests/testGaussianFactorGraph.cpp | 4 ++-- gtsam/linear/tests/testSerializationLinear.cpp | 2 +- tests/smallExample.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gtsam/linear/tests/testGaussianFactorGraph.cpp b/gtsam/linear/tests/testGaussianFactorGraph.cpp index 26e6b1925..8f9016209 100644 --- a/gtsam/linear/tests/testGaussianFactorGraph.cpp +++ b/gtsam/linear/tests/testGaussianFactorGraph.cpp @@ -47,7 +47,7 @@ TEST(GaussianFactorGraph, initialization) { SharedDiagonal unit2 = noiseModel::Unit::Create(2); fg += - JacobianFactor(0, 10*I_2x2, -1.0*Matrix::Ones(2,2), unit2), + JacobianFactor(0, 10*I_2x2, -1.0*ones(2), unit2), JacobianFactor(0, -10*I_2x2,1, 10*I_2x2, Vector2(2.0, -1.0), unit2), JacobianFactor(0, -5*I_2x2, 2, 5*I_2x2, Vector2(0.0, 1.0), unit2), JacobianFactor(1, -5*I_2x2, 2, 5*I_2x2, Vector2(-1.0, 1.5), unit2); @@ -166,7 +166,7 @@ static GaussianFactorGraph createSimpleGaussianFactorGraph() { GaussianFactorGraph fg; SharedDiagonal unit2 = noiseModel::Unit::Create(2); // linearized prior on x1: c[_x1_]+x1=0 i.e. x1=-c[_x1_] - fg += JacobianFactor(2, 10*I_2x2, -1.0*Matrix::Ones(2,2), unit2); + fg += JacobianFactor(2, 10*I_2x2, -1.0*ones(2), unit2); // odometry between x1 and x2: x2-x1=[0.2;-0.1] fg += JacobianFactor(0, 10*I_2x2, 2, -10*I_2x2, Vector2(2.0, -1.0), unit2); // measurement between x1 and l1: l1-x1=[0.0;0.2] diff --git a/gtsam/linear/tests/testSerializationLinear.cpp b/gtsam/linear/tests/testSerializationLinear.cpp index 669aa30e8..f31fd41e6 100644 --- a/gtsam/linear/tests/testSerializationLinear.cpp +++ b/gtsam/linear/tests/testSerializationLinear.cpp @@ -186,7 +186,7 @@ TEST (Serialization, gaussian_factor_graph) { { Key i1 = 4, i2 = 7; Matrix A1 = I_3x3, A2 = -1.0 * I_3x3; - Vector b = Matrix::Ones(3,3); + Vector b = ones(3); SharedDiagonal model = noiseModel::Diagonal::Sigmas(Vector3(1.0, 2.0, 3.0)); JacobianFactor jacobianfactor(i1, A1, i2, A2, b, model); HessianFactor hessianfactor(jacobianfactor); diff --git a/tests/smallExample.h b/tests/smallExample.h index 33f42da7f..b2a2102e1 100644 --- a/tests/smallExample.h +++ b/tests/smallExample.h @@ -274,7 +274,7 @@ inline GaussianFactorGraph createGaussianFactorGraph() { GaussianFactorGraph fg; // linearized prior on x1: c[_x1_]+x1=0 i.e. x1=-c[_x1_] - fg += JacobianFactor(X(1), 10*I_2x2, -1.0*Matrix::Ones(2,2)); + fg += JacobianFactor(X(1), 10*I_2x2, -1.0*ones(2)); // odometry between x1 and x2: x2-x1=[0.2;-0.1] fg += JacobianFactor(X(1), -10*I_2x2, X(2), 10*I_2x2, Vector2(2.0, -1.0));