Commit 2b51a9c7 authored by Libor Bakajsa's avatar Libor Bakajsa
Browse files

MTX reader fixed

parent 32ed06d9
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -268,7 +268,8 @@ bool tnlMatrixReader< Matrix >::computeRowLengthsFromMtxFile( std::istream& file
                                                              const int columns,
                                                              const int rows,
                                                              bool symmetricMatrix,
                                                              bool verbose )
                                                              bool verbose,
                                                              bool symReader )
{
   file.clear();
   file.seekg( 0,  ios::beg );
@@ -303,10 +304,14 @@ bool tnlMatrixReader< Matrix >::computeRowLengthsFromMtxFile( std::istream& file
         cerr << "There are more elements than the matrix columns at the row " << row << "." << endl;
         return false;
      }
      if( symmetricMatrix && row != column )
      if( symmetricMatrix && row != column && symReader )
      {
         continue;
      }
      else if( symmetricMatrix && row != column )
      {
          rowLengths[ column - 1 ]++;
      }
   }
   file.clear();
   long int fileSize = file.tellg();
+2 −1
Original line number Diff line number Diff line
@@ -76,7 +76,8 @@ class tnlMatrixReader
                                             const int columns,
                                             const int rows,
                                             bool symmetricMatrix,
                                             bool verbose );
                                             bool verbose,
                                             bool symReader = false );

   static bool readMatrixElementsFromMtxFile( std::istream& file,
                                              Matrix& matrix,