Quellcode durchsuchen

made list_to_matrix support empty inputs on matrices with static sizes

Michael Tao vor 6 Jahren
Ursprung
Commit
9bdb6a4554
1 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
  1. 5 1
      include/igl/list_to_matrix.cpp

+ 5 - 1
include/igl/list_to_matrix.cpp

@@ -22,7 +22,11 @@ IGL_INLINE bool igl::list_to_matrix(const std::vector<std::vector<T > > & V,Eige
   int m = V.size();
   if(m == 0)
   {
-    M.resize(0,0);
+    M.resize(
+            Derived::RowsAtCompileTime>=0?Derived::RowsAtCompileTime:0
+            ,
+            Derived::ColsAtCompileTime>=0?Derived::ColsAtCompileTime:0
+            );
     return true;
   }
   // number of columns