Browse Source

rm load_matrix

Alec Jacobson 6 years ago
parent
commit
46a8dd2fd4

+ 3 - 3
tests/include/igl/copyleft/cgal/order_facets_around_edges.cpp

@@ -54,7 +54,7 @@ void assert_order(
         Eigen::MatrixXd N;
         //igl::per_face_normals_stable(V, F, N);
         //igl::per_face_normals(V, F, N);
-        test_common::load_matrix(normal, N);
+        igl:readDMAT(test_common::data_path(normal), N);
         igl::copyleft::cgal::order_facets_around_edges(
           V, F, N, uE, uE2E, uE2oE, uE2C);
     } else {
@@ -192,9 +192,9 @@ TEST_CASE("copyleft_cgal_order_facets_around_edges: NormalSensitivity", "[igl/co
     // results in very different ordering of facets.
 
     Eigen::MatrixXd V;
-    test_common::load_matrix("duplicated_faces_V.dmat", V);
+    igl:readDMAT(test_common::data_path("duplicated_faces_V.dmat"), V);
     Eigen::MatrixXi F;
-    test_common::load_matrix("duplicated_faces_F.dmat", F);
+    igl:readDMAT(test_common::data_path("duplicated_faces_F.dmat"), F);
 
     assert_order(V, F, 223, 224, {2, 0, 3, 1}, "duplicated_faces_N1.dmat");
     assert_order(V, F, 223, 224, {0, 3, 2, 1}, "duplicated_faces_N2.dmat");

+ 2 - 2
tests/include/igl/readDMAT.cpp

@@ -3,8 +3,8 @@
 TEST_CASE("readDMAT: Comp", "[igl]")
 {
     Eigen::MatrixXd N1, N2;
-    test_common::load_matrix("duplicated_faces_N1.dmat", N1);
-    test_common::load_matrix("duplicated_faces_N2.dmat", N2);
+    igl::readDMAT(test_common::data_path("duplicated_faces_N1.dmat"), N1);
+    igl::readDMAT(test_common::data_path("duplicated_faces_N2.dmat"), N2);
 
     REQUIRE (N2.rows() == N1.rows());
     REQUIRE (N2.cols() == N1.cols());

+ 4 - 12
tests/test_common.h

@@ -1,10 +1,13 @@
 #pragma once
 
 
+// These are not directly used but would otherwise be included in most files.
+// Leaving them included here. 
 #include <igl/read_triangle_mesh.h>
-#include <igl/find.h>
 #include <igl/readDMAT.h>
 
+#include <igl/find.h>
+
 #include <Eigen/Core>
 #include <catch2/catch.hpp>
 
@@ -87,17 +90,6 @@ namespace test_common
     return std::string(LIBIGL_DATA_DIR) + "/" + s;
   };
 
-  // TODO: this seems like a pointless indirection. Should just find and
-  // replace test_common::load_matrix(X,...) with
-  // igl::readDMAT(test_common::data_path(X),...)
-  template<typename Derived>
-  void load_matrix(
-    const std::string& filename,
-    Eigen::PlainObjectBase<Derived>& M)
-  {
-    igl::readDMAT(data_path(filename), M);
-  }
-
   template <typename DerivedA, typename DerivedB>
   void assert_eq(
     const Eigen::MatrixBase<DerivedA> & A,