Commit e841b7d7 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixed save and load in sparse and dense matrix.

parent 49f09e5f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1128,6 +1128,8 @@ template< typename Real,
void Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::load( File& file )
{
   Matrix< Real, Device, Index >::load( file );
   this->segments.load( file );
   this->view = this->getView();
}

template< typename Real,
+1 −0
Original line number Diff line number Diff line
@@ -920,6 +920,7 @@ template< typename Real,
void DenseMatrixView< Real, Device, Index, RowMajorOrder >::save( File& file ) const
{
   MatrixView< Real, Device, Index >::save( file );
   this->segments.save( file );
}

template< typename Real,
+1 −0
Original line number Diff line number Diff line
@@ -858,6 +858,7 @@ load( File& file )
   Matrix< RealType, DeviceType, IndexType >::load( file );
   file >> this->columnIndexes;
   this->segments.load( file );
   this->view = this->getView();
}

template< typename Real,
+1 −1
Original line number Diff line number Diff line
@@ -1234,7 +1234,7 @@ void test_SaveAndLoad()

    ASSERT_NO_THROW( savedMatrix.save( TEST_FILE_NAME ) );

    Matrix loadedMatrix( rows, cols );
    Matrix loadedMatrix;

    ASSERT_NO_THROW( loadedMatrix.load( TEST_FILE_NAME ) );

+4 −6
Original line number Diff line number Diff line
@@ -1297,9 +1297,7 @@ void test_SaveAndLoad( const char* filename )

   ASSERT_NO_THROW( savedMatrix.save( filename ) );

   Matrix loadedMatrix( m_rows, m_cols );
   typename Matrix::CompressedRowLengthsVector rowLengths2( m_rows, 3 );
   loadedMatrix.setCompressedRowLengths( rowLengths2 );
   Matrix loadedMatrix;

   ASSERT_NO_THROW( loadedMatrix.load( filename ) );