Browse Source

Fix crouzeix_raviart_massmatrix and per_edhe_normals for more dtypes binding

KarlLeell 6 years ago
parent
commit
302073a5f6
2 changed files with 5 additions and 5 deletions
  1. 1 1
      include/igl/crouzeix_raviart_massmatrix.cpp
  2. 4 4
      include/igl/per_edge_normals.cpp

+ 1 - 1
include/igl/crouzeix_raviart_massmatrix.cpp

@@ -69,7 +69,7 @@ void igl::crouzeix_raviart_massmatrix(
   {
     for(int c = 0;c<ss;c++)
     {
-      MIJV[f+m*c] = Triplet<MT>(EMAP(f+m*c),EMAP(f+m*c),TA(f)/(double)(ss));
+      MIJV[f+m*c] = Triplet<MT>(EMAP(f+m*c, 0),EMAP(f+m*c, 0),TA(f)/(double)(ss));
     }
   }
   M.resize(E.rows(),E.rows());

+ 4 - 4
include/igl/per_edge_normals.cpp

@@ -36,10 +36,10 @@ IGL_INLINE void igl::per_edge_normals(
   // number of faces
   const int m = F.rows();
   // All occurrences of directed edges
-  MatrixXi allE;
+  Matrix<typename DerivedF::Scalar, Dynamic, Dynamic> allE;
   oriented_facets(F,allE);
   // Find unique undirected edges and mapping
-  VectorXi _;
+  Matrix<typename DerivedF::Scalar, Dynamic, 1> _;
   unique_simplices(allE,E,_,EMAP);
   // now sort(allE,2) == E(EMAP,:), that is, if EMAP(i) = j, then E.row(j) is
   // the undirected edge corresponding to the directed edge allE.row(i).
@@ -67,10 +67,10 @@ IGL_INLINE void igl::per_edge_normals(
     {
       if(weighting == PER_EDGE_NORMALS_WEIGHTING_TYPE_UNIFORM)
       {
-        N.row(EMAP(f+c*m)) += FN.row(f);
+        N.row(EMAP(f+c*m, 0)) += FN.row(f);
       }else
       {
-        N.row(EMAP(f+c*m)) += W(f) * FN.row(f);
+        N.row(EMAP(f+c*m, 0)) += W(f) * FN.row(f);
       }
     }
   }