From ae848b3a6a8076c57437aa792a8246b091b806d5 Mon Sep 17 00:00:00 2001
From: joanvallve <jvallve@iri.upc.edu>
Date: Fri, 5 Mar 2021 15:59:19 +0100
Subject: [PATCH] method for checking structure

---
 include/core/state_block/state_composite.h | 8 +-------
 src/state_block/state_composite.cpp        | 8 ++++++++
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/include/core/state_block/state_composite.h b/include/core/state_block/state_composite.h
index f820fc5ba..7989fd807 100644
--- a/include/core/state_block/state_composite.h
+++ b/include/core/state_block/state_composite.h
@@ -69,13 +69,7 @@ class VectorComposite : public std::unordered_map < char, Eigen::VectorXd >
         void set(const VectorXd& _v, const StateStructure& _structure, const std::list<int>& _sizes);
         void setZero();
 
-        bool includesStructure(const StateStructure& _structure)
-        {
-            for (auto key : _structure)
-                if (count(key) == 0)
-                    return false;
-            return true;
-        }
+        bool includesStructure(const StateStructure &_structure) const;
 
         friend std::ostream& operator <<(std::ostream &_os, const wolf::VectorComposite &_x);
         friend wolf::VectorComposite operator +(const wolf::VectorComposite &_x, const wolf::VectorComposite &_y);
diff --git a/src/state_block/state_composite.cpp b/src/state_block/state_composite.cpp
index 0f4efab6f..169bc82ca 100644
--- a/src/state_block/state_composite.cpp
+++ b/src/state_block/state_composite.cpp
@@ -81,6 +81,14 @@ Eigen::VectorXd VectorComposite::vector(const StateStructure &_structure) const
     return x;
 }
 
+bool VectorComposite::includesStructure(const StateStructure &_structure) const
+{
+    for (auto key : _structure)
+        if (count(key) == 0)
+            return false;
+    return true;
+}
+
 std::ostream& operator <<(std::ostream &_os, const wolf::VectorComposite &_x)
 {
     for (const auto &pair_key_vec : _x)
-- 
GitLab