Commit c67f1184 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber Committed by Jakub Klinkovský
Browse files

Fixed RealType definition in SparseMatrixView - removing const.

parent debacf8f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ class SparseMatrixView : public MatrixView< Real, Device, Index >
      /**
       * \brief The type of matrix elements.
       */
      using RealType = Real;
      using RealType = std::remove_const_t< Real >;

      using ComputeRealType = ComputeReal;

@@ -942,7 +942,7 @@ class SparseMatrixView : public MatrixView< Real, Device, Index >
      }
};

} // namespace Conatiners
   } // namespace Matrices
} // namespace TNL

#include <TNL/Matrices/SparseMatrixView.hpp>
+5 −7
Original line number Diff line number Diff line
@@ -80,8 +80,8 @@ getConstView() const -> ConstViewType
   return ConstViewType( this->getRows(),
                         this->getColumns(),
                         this->getValues().getConstView(),
                         this->getColumnsIndexes().getConstView(),
                         this->segments.getConstView() );
                         this->getColumnIndexes().getConstView(),
                         const_cast< SparseMatrixView* >( this )->segments.getView() );
}

template< typename Real,
@@ -862,9 +862,7 @@ SparseMatrixView< Real, Device, Index, MatrixType, SegmentsView, ComputeReal >::
operator==( const Matrix& m ) const
{
   const auto& view1 = *this;
   // FIXME: getConstView does not work
   //const auto view2 = m.getConstView();
   const auto view2 = m.getView();
   const auto view2 = m.getConstView();
   auto fetch = [=] __cuda_callable__ ( const IndexType i ) -> bool
   {
      return view1.getRow( i ) == view2.getRow( i );
@@ -896,7 +894,7 @@ void
SparseMatrixView< Real, Device, Index, MatrixType, SegmentsView, ComputeReal >::
save( File& file ) const
{
   MatrixView< RealType, DeviceType, IndexType >::save( file );
   MatrixView< Real, Device, Index >::save( file );
   file << this->columnIndexes;
   this->segments.save( file );
}