From 09db84611e35ce9fcc0cfd6e6fb09986dea46165 Mon Sep 17 00:00:00 2001
From: jcasals <jcasals@iri.upc.edu>
Date: Mon, 28 Oct 2019 14:59:24 +0100
Subject: [PATCH] Fixed bug with converter.h vectors (negative entries were not
 allowed) & fixed wolf cmake file

---
 cmake_modules/wolfConfig.cmake | 10 +++++++---
 include/core/utils/converter.h |  4 ++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/cmake_modules/wolfConfig.cmake b/cmake_modules/wolfConfig.cmake
index 90e622c1b..7556468eb 100644
--- a/cmake_modules/wolfConfig.cmake
+++ b/cmake_modules/wolfConfig.cmake
@@ -84,9 +84,13 @@ FIND_PACKAGE(YamlCpp REQUIRED)
 list(APPEND wolf_INCLUDE_DIRS ${YAMLCPP_INCLUDE_DIRS})
 list(APPEND wolf_LIBRARIES ${YAMLCPP_LIBRARY})
 
-if(NOT Eigen_FOUND)
+#Eigen
+# FIND_PACKAGE(Eigen3 REQUIRED)
+# list(APPEND wolf_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIRS})
+
+if(NOT Eigen3_FOUND)
   FIND_PACKAGE(Eigen3 REQUIRED)
-  list(APPEND wolf_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIRS})
 endif()
+list(APPEND wolf_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIRS})
 
-SET(CMAKE_MODULE_PATH ${BACKUP_MODULE_PATH})
\ No newline at end of file
+SET(CMAKE_MODULE_PATH ${BACKUP_MODULE_PATH})
diff --git a/include/core/utils/converter.h b/include/core/utils/converter.h
index dceaf3e01..5cfa3c980 100644
--- a/include/core/utils/converter.h
+++ b/include/core/utils/converter.h
@@ -59,8 +59,8 @@ namespace utils{
     * @return <b>{std::array<std::string, 2>}</b> pair ([N,M],[a1,a2,a3,...]) or just ([a1,a2,a3...])
     */
     static inline std::array<std::string,2> splitMatrixStringRepresentation(std::string matrix){
-        std::regex rgx("\\[\\[((?:[0-9]+,?)+)\\],((?:(?:[0-9]*\\.)?[0-9]+,?)+)\\]");
-        std::regex rgxStatic("\\[((?:(?:[0-9]*\\.)?[0-9]+,?)+)\\]");
+        std::regex rgx("\\[\\[((?:[0-9]+,?)+)\\],((?:-?[0-9]*(?:\\.[0-9]+)?,?)+)\\]");
+        std::regex rgxStatic("\\[((?:(?:-?[0-9]*)(?:\\.[0-9]+)?,?)+)\\]");
         std::smatch matches;
         std::smatch matchesStatic;
         std::array<std::string,2> values = {{"[]","[]"}};
-- 
GitLab