diff --git a/gtsam/base/LieMatrix.cpp b/gtsam/base/LieMatrix.cpp index 9e88607cc..69054fc1c 100644 --- a/gtsam/base/LieMatrix.cpp +++ b/gtsam/base/LieMatrix.cpp @@ -19,20 +19,6 @@ namespace gtsam { -/* ************************************************************************* */ -LieMatrix::LieMatrix(size_t m, size_t n, ...) -: Matrix(m,n) { - va_list ap; - va_start(ap, n); - for(size_t i = 0; i < m; ++i) { - for(size_t j = 0; j < n; ++j) { - double value = va_arg(ap, double); - (*this)(i,j) = value; - } - } - va_end(ap); -} - /* ************************************************************************* */ void LieMatrix::print(const std::string& name) const { gtsam::print(matrix(), name); diff --git a/gtsam/base/LieMatrix.h b/gtsam/base/LieMatrix.h index 0a27eff69..8d43dd6ea 100644 --- a/gtsam/base/LieMatrix.h +++ b/gtsam/base/LieMatrix.h @@ -48,9 +48,6 @@ struct LieMatrix : public Matrix, public DerivedValue { LieMatrix(size_t m, size_t n, const double* const data) : Matrix(Eigen::Map(data, m, n)) {} - /** Specify arguments directly, as in Matrix_() - always force these to be doubles */ - GTSAM_EXPORT LieMatrix(size_t m, size_t n, ...); - /// @} /// @name Testable interface /// @{ diff --git a/gtsam/base/tests/testLieMatrix.cpp b/gtsam/base/tests/testLieMatrix.cpp index 88bae697a..ee8fe14d9 100644 --- a/gtsam/base/tests/testLieMatrix.cpp +++ b/gtsam/base/tests/testLieMatrix.cpp @@ -39,20 +39,17 @@ TEST( LieMatrix, construction ) { TEST( LieMatrix, other_constructors ) { Matrix init = (Matrix(2,2) << 10.0,20.0, 30.0,40.0); LieMatrix exp(init); - LieMatrix a(2,2,10.0,20.0,30.0,40.0); double data[] = {10,30,20,40}; LieMatrix b(2,2,data); - EXPECT(assert_equal(exp, a)); EXPECT(assert_equal(exp, b)); - EXPECT(assert_equal(b, a)); } /* ************************************************************************* */ TEST(LieMatrix, retract) { - LieMatrix init(2,2, 1.0,2.0,3.0,4.0); + LieMatrix init((Matrix(2,2) << 1.0,2.0,3.0,4.0)); Vector update = (Vector(4) << 3.0, 4.0, 6.0, 7.0); - LieMatrix expected(2,2, 4.0, 6.0, 9.0, 11.0); + LieMatrix expected((Matrix(2,2) << 4.0, 6.0, 9.0, 11.0)); LieMatrix actual = init.retract(update); EXPECT(assert_equal(expected, actual)); @@ -63,7 +60,7 @@ TEST(LieMatrix, retract) { EXPECT(assert_equal(expectedUpdate, actualUpdate)); Vector expectedLogmap = (Vector(4) << 1, 2, 3, 4); - Vector actualLogmap = LieMatrix::Logmap(LieMatrix(2,2, 1.0, 2.0, 3.0, 4.0)); + Vector actualLogmap = LieMatrix::Logmap(LieMatrix((Matrix(2,2) << 1.0, 2.0, 3.0, 4.0))); EXPECT(assert_equal(expectedLogmap, actualLogmap)); } diff --git a/tests/testSerializationSLAM.cpp b/tests/testSerializationSLAM.cpp index ecf82d1bd..c9f434da2 100644 --- a/tests/testSerializationSLAM.cpp +++ b/tests/testSerializationSLAM.cpp @@ -287,8 +287,8 @@ TEST (testSerializationSLAM, smallExample_nonlinear) { /* ************************************************************************* */ TEST (testSerializationSLAM, factors) { - LieVector lieVector(4, 1.0, 2.0, 3.0, 4.0); - LieMatrix lieMatrix(2, 3, 1.0, 2.0, 3.0, 4.0, 5.0 ,6.0); + LieVector lieVector((Vector(4) << 1.0, 2.0, 3.0, 4.0)); + LieMatrix lieMatrix((Matrix(2, 3) << 1.0, 2.0, 3.0, 4.0, 5.0 ,6.0)); Point2 point2(1.0, 2.0); StereoPoint2 stereoPoint2(1.0, 2.0, 3.0); Point3 point3(1.0, 2.0, 3.0);