list_to_matrix.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include <test_common.h>
  2. #include <igl/list_to_matrix.h>
  3. #include <igl/STR.h>
  4. #include <tuple>
  5. // namespace list_to_matrix
  6. // {
  7. // typedef std::tuple<int/*n*/,int/*m*/> NM;
  8. // inline std::string NM_test_name(
  9. // const ::testing::TestParamInfo<NM>& info)
  10. // {
  11. // return STR(
  12. // std::get<0>(info.param)<<"x"<<
  13. // std::get<1>(info.param)<<"_");
  14. // };
  15. // }
  16. // class ListToMatrixTest : public ::testing::TestWithParam<list_to_matrix::NM> {};
  17. // TEST_P(ListToMatrixTest,matrix)
  18. // {
  19. // const int n = std::get<0>(GetParam());
  20. // const int m = std::get<1>(GetParam());
  21. // std::vector<std::vector<double> > vX(n,std::vector<double>(m));
  22. // for(int i = 0;i<n;i++)
  23. // {
  24. // for(int j = 0;j<m;j++)
  25. // {
  26. // vX[i][j] = i+j*n;
  27. // }
  28. // }
  29. // Eigen::MatrixXd mX;
  30. // igl::list_to_matrix(vX,mX);
  31. // for(int i = 0;i<n;i++)
  32. // {
  33. // for(int j = 0;j<m;j++)
  34. // {
  35. // REQUIRE (mX(i,j) == vX[i][j]);
  36. // }
  37. // }
  38. // }
  39. // INSTANTIATE_TEST_CASE_P
  40. // (
  41. // suite,
  42. // ListToMatrixTest,
  43. // ::testing::ValuesIn<std::vector<list_to_matrix::NM> >(
  44. // std::vector<list_to_matrix::NM>{
  45. // list_to_matrix::NM{100,4},
  46. // list_to_matrix::NM{4,100},
  47. // list_to_matrix::NM{100,1},
  48. // list_to_matrix::NM{1,100},
  49. // }),
  50. // list_to_matrix::NM_test_name
  51. // );