From 5a8363a775ef0d3feb668cf16353594f76bbf327 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Wed, 3 Apr 2019 20:17:18 -0400 Subject: [PATCH] Removed Ordering again -> templated vector method simply works --- gtsam/linear/VectorValues.cpp | 16 ++++------------ gtsam/linear/VectorValues.h | 2 +- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/gtsam/linear/VectorValues.cpp b/gtsam/linear/VectorValues.cpp index 7ff773bd5..ca95313cf 100644 --- a/gtsam/linear/VectorValues.cpp +++ b/gtsam/linear/VectorValues.cpp @@ -142,7 +142,7 @@ namespace gtsam { } /* ************************************************************************* */ - Vector VectorValues::vector(boost::optional ordering) const { + Vector VectorValues::vector() const { // Count dimensions DenseIndex totalDim = 0; for (const Vector& v : *this | map_values) totalDim += v.size(); @@ -150,17 +150,9 @@ namespace gtsam { // Copy vectors Vector result(totalDim); DenseIndex pos = 0; - if (ordering) { - for (const auto& key : *ordering) { - const auto& v = (*this)[key]; - result.segment(pos, v.size()) = v; - pos += v.size(); - } - } else { - for (const Vector& v : *this | map_values) { - result.segment(pos, v.size()) = v; - pos += v.size(); - } + for (const Vector& v : *this | map_values) { + result.segment(pos, v.size()) = v; + pos += v.size(); } return result; diff --git a/gtsam/linear/VectorValues.h b/gtsam/linear/VectorValues.h index 5360edeff..39abe1b56 100644 --- a/gtsam/linear/VectorValues.h +++ b/gtsam/linear/VectorValues.h @@ -244,7 +244,7 @@ namespace gtsam { /// @{ /** Retrieve the entire solution as a single vector */ - Vector vector(boost::optional ordering = boost::none) const; + Vector vector() const; /** Access a vector that is a subset of relevant keys. */ template