From 3299127e6a24ed9a0fc2bbe0ee65cd2a3e6de2c5 Mon Sep 17 00:00:00 2001 From: dellaert Date: Sun, 3 May 2015 18:21:11 -0700 Subject: [PATCH] Optional point --- gtsam.h | 5 +++++ gtsam/geometry/Point3.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/gtsam.h b/gtsam.h index 282a55a7d..ebc308ff8 100644 --- a/gtsam.h +++ b/gtsam.h @@ -383,6 +383,11 @@ class Point3 { void serialize() const; }; +class OptionalPoint3 { + bool is_initialized() const; + gtsam::Point3 value(); +}; + class Rot2 { // Standard Constructors and Named Constructors Rot2(); diff --git a/gtsam/geometry/Point3.h b/gtsam/geometry/Point3.h index 883e5fb62..db6fa4b6e 100644 --- a/gtsam/geometry/Point3.h +++ b/gtsam/geometry/Point3.h @@ -194,6 +194,9 @@ namespace gtsam { /// Syntactic sugar for multiplying coordinates by a scalar s*p inline Point3 operator*(double s, const Point3& p) { return p*s;} +// For MATLAB wrapper +typedef boost::optional OptionalPoint3; + template<> struct traits : public internal::VectorSpace {};