Merge pull request #1309 from mtao/master

made list_to_matrix support empty inputs on matrices with static sizes
This commit is contained in:
Alec Jacobson
2019-10-10 12:16:57 -04:00
committed by GitHub
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ namespace igl
// Inputs:
// F #F by dim list of mesh simplices
// Outputs:
// A max(F) by max(F) cotangent matrix, each row i corresponding to V(i,:)
// A max(F) by max(F) adjacency matrix, each row i corresponding to V(i,:)
//
// Example:
// // Mesh in (V,F)
+5 -1
View File
@@ -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