From 01257d02896015c7c1d9e053c6edf442eb84ec57 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Sat, 11 Aug 2012 02:53:54 +0000 Subject: [PATCH] Added automatic conversion operator from LieScalar to double (simplifies syntax so that .value() is not needed) --- gtsam/base/LieScalar.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gtsam/base/LieScalar.h b/gtsam/base/LieScalar.h index 3b9c7037a..ce0ba93ca 100644 --- a/gtsam/base/LieScalar.h +++ b/gtsam/base/LieScalar.h @@ -36,6 +36,9 @@ namespace gtsam { /** access the underlying value */ double value() const { return d_; } + /** Automatic conversion to underlying value */ + operator double() const { return d_; } + /** print @param name optional string naming the object */ inline void print(const std::string& name="") const { std::cout << name << ": " << d_ << std::endl;