Browse Source

fixed bug in writeDMAT, also added templates for read/writeDMAT

Former-commit-id: d92baa6544efda89a24e0cef589c0171d941ff95
Alec Jacobson (jalec 12 years ago
parent
commit
98d73ddd0e
2 changed files with 4 additions and 2 deletions
  1. 1 0
      include/igl/readDMAT.cpp
  2. 3 2
      include/igl/writeDMAT.cpp

+ 1 - 0
include/igl/readDMAT.cpp

@@ -164,4 +164,5 @@ IGL_INLINE bool igl::readDMAT(
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
 template bool igl::readDMAT<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
+template bool igl::readDMAT<double>(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&);
 #endif

+ 3 - 2
include/igl/writeDMAT.cpp

@@ -46,8 +46,8 @@ IGL_INLINE bool igl::writeDMAT(
   {
     num_cols = W[0].size();
   }
-  // first line contains number of rows and number of columns
-  fprintf(fp,"%d %d\n",num_rows,num_cols);
+  // first line contains number of columns and number of rows
+  fprintf(fp,"%d %d\n",num_cols,num_rows);
   // Loop over columns slowly
   for(int j = 0;j < num_cols;j++)
   {
@@ -67,4 +67,5 @@ IGL_INLINE bool igl::writeDMAT(
 // Explicit template specialization
 // generated by autoexplicit.sh
 template bool igl::writeDMAT<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::Matrix<double, -1, -1, 0, -1, -1> const&);
+template bool igl::writeDMAT<double>(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >);
 #endif