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

Fixed RealType definition in SparseMatrixView - removing const.

parent 7e4b0a46
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;

@@ -934,7 +934,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,14 +862,12 @@ 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 );
   };
   return Algorithms::Reduction< DeviceType >::reduce( 0, this->getRows(), fetch, std::logical_and<>{}, true );
   return Algorithms::Reduction< DeviceType >::reduce( ( IndexType ) 0, this->getRows(), fetch, std::logical_and<>{}, true );
}

template< typename Real,
@@ -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 );
}