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