From a2138084db5a02f370c7a11bed9331ab7958fe10 Mon Sep 17 00:00:00 2001 From: Duy-Nguyen Ta Date: Thu, 10 Oct 2013 22:01:48 +0000 Subject: [PATCH] move print to cpp to wrap properly in matlab --- gtsam/base/LieMatrix.cpp | 29 +++++++++++++++++------------ gtsam/base/LieMatrix.h | 4 +--- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/gtsam/base/LieMatrix.cpp b/gtsam/base/LieMatrix.cpp index 332401689..9e88607cc 100644 --- a/gtsam/base/LieMatrix.cpp +++ b/gtsam/base/LieMatrix.cpp @@ -19,18 +19,23 @@ 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; - } +/* ************************************************************************* */ +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); } + va_end(ap); +} -} \ No newline at end of file +/* ************************************************************************* */ +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 498866589..0b3f00f7f 100644 --- a/gtsam/base/LieMatrix.h +++ b/gtsam/base/LieMatrix.h @@ -56,9 +56,7 @@ struct LieMatrix : public Matrix, public DerivedValue { /// @{ /** print @param s optional string naming the object */ - inline void print(const std::string& name="") const { - gtsam::print(matrix(), name); - } + void print(const std::string& name="") const; /** equality up to tolerance */ inline bool equals(const LieMatrix& expected, double tol=1e-5) const {