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

Renaming SparseMatrixRowViewIterator to MatrixRowViewIterator and fixing DenseMatrixElement.

parent 228a552b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ class DenseMatrixElement

      const IndexType& rowIdx;

      const IndexType& columnIdx;
      const IndexType columnIdx;
};

   } // namespace Matrices
+2 −2
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
#pragma once

#include <TNL/Cuda/CudaCallable.h>
#include <TNL/Matrices/SparseMatrixRowViewIterator.h>
#include <TNL/Matrices/MatrixRowViewIterator.h>
#include <TNL/Matrices/DenseMatrixElement.h>

namespace TNL {
@@ -84,7 +84,7 @@ class DenseMatrixRowView
      /**
       * \brief Type of iterator for the matrix row.
       */
      using IteratorType = SparseMatrixRowViewIterator< RowView >;
      using IteratorType = MatrixRowViewIterator< RowView >;

      /**
       * \brief Constructor with \e segmentView and \e values
+8 −8
Original line number Diff line number Diff line
 /***************************************************************************
                          SparseMatrixRowViewIterator.h -  description
                          MatrixRowViewIterator.h -  description
                             -------------------
    begin                : Mar 20, 2021
    copyright            : (C) 2021 by Tomas Oberhuber
@@ -19,7 +19,7 @@ namespace TNL {
namespace Matrices {

template< typename RowView >
class SparseMatrixRowViewIterator
class MatrixRowViewIterator
{

   public:
@@ -51,7 +51,7 @@ class SparseMatrixRowViewIterator
      static constexpr bool isBinary() { return RowViewType::isBinary(); };

      __cuda_callable__
      SparseMatrixRowViewIterator( RowViewType& rowView,
      MatrixRowViewIterator( RowViewType& rowView,
                                   const IndexType& localIdx );

      /**
@@ -61,7 +61,7 @@ class SparseMatrixRowViewIterator
       * \return \e true if both iterators points at the same point of the same matrix, \e false otherwise.
       */
      __cuda_callable__
      bool operator==( const SparseMatrixRowViewIterator& other ) const;
      bool operator==( const MatrixRowViewIterator& other ) const;

      /**
       * \brief Comparison of two matrix row iterators.
@@ -70,13 +70,13 @@ class SparseMatrixRowViewIterator
       * \return \e false if both iterators points at the same point of the same matrix, \e true otherwise.
       */
      __cuda_callable__
      bool operator!=( const SparseMatrixRowViewIterator& other ) const;
      bool operator!=( const MatrixRowViewIterator& other ) const;

      __cuda_callable__
      SparseMatrixRowViewIterator& operator++();
      MatrixRowViewIterator& operator++();

      __cuda_callable__
      SparseMatrixRowViewIterator& operator--();
      MatrixRowViewIterator& operator--();

      __cuda_callable__
      MatrixElementType operator*();
@@ -95,4 +95,4 @@ class SparseMatrixRowViewIterator
   } // namespace Matrices
} // namespace TNL

#include <TNL/Matrices/SparseMatrixRowViewIterator.hpp>
#include <TNL/Matrices/MatrixRowViewIterator.hpp>
+12 −12
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@ namespace Matrices {

template< typename RowView >
__cuda_callable__
SparseMatrixRowViewIterator< RowView >::
SparseMatrixRowViewIterator( RowViewType& rowView,
MatrixRowViewIterator< RowView >::
MatrixRowViewIterator( RowViewType& rowView,
                             const IndexType& localIdx )
: rowView( rowView ), localIdx( localIdx )
{
@@ -27,8 +27,8 @@ SparseMatrixRowViewIterator( RowViewType& rowView,

template< typename RowView >
__cuda_callable__ bool
SparseMatrixRowViewIterator< RowView >::
operator==( const SparseMatrixRowViewIterator& other ) const
MatrixRowViewIterator< RowView >::
operator==( const MatrixRowViewIterator& other ) const
{
   if( &this->rowView == &other.rowView &&
       localIdx == other.localIdx )
@@ -38,16 +38,16 @@ operator==( const SparseMatrixRowViewIterator& other ) const

template< typename RowView >
__cuda_callable__ bool
SparseMatrixRowViewIterator< RowView >::
operator!=( const SparseMatrixRowViewIterator& other ) const
MatrixRowViewIterator< RowView >::
operator!=( const MatrixRowViewIterator& other ) const
{
   return ! ( other == *this );
}

template< typename RowView >
__cuda_callable__
SparseMatrixRowViewIterator< RowView >&
SparseMatrixRowViewIterator< RowView >::
MatrixRowViewIterator< RowView >&
MatrixRowViewIterator< RowView >::
operator++()
{
   if( localIdx < rowView.getSize() )
@@ -57,8 +57,8 @@ operator++()

template< typename RowView >
__cuda_callable__
SparseMatrixRowViewIterator< RowView >&
SparseMatrixRowViewIterator< RowView >::
MatrixRowViewIterator< RowView >&
MatrixRowViewIterator< RowView >::
operator--()
{
   if( localIdx > 0 )
@@ -68,7 +68,7 @@ operator--()

template< typename RowView >
__cuda_callable__ auto
SparseMatrixRowViewIterator< RowView >::
MatrixRowViewIterator< RowView >::
operator*() -> MatrixElementType
{
   return MatrixElementType(
@@ -80,7 +80,7 @@ operator*() -> MatrixElementType

template< typename RowView >
__cuda_callable__ auto
SparseMatrixRowViewIterator< RowView >::
MatrixRowViewIterator< RowView >::
operator*() const -> const MatrixElementType
{
   return MatrixElementType(
+2 −2
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
#pragma once

#include <TNL/Matrices/MultidiagonalMatrixElement.h>
#include <TNL/Matrices/SparseMatrixRowViewIterator.h>
#include <TNL/Matrices/MatrixRowViewIterator.h>

namespace TNL {
namespace Matrices {
@@ -104,7 +104,7 @@ class MultidiagonalMatrixRowView
      /**
       * \brief Type of iterator for the matrix row.
       */
      using IteratorType = SparseMatrixRowViewIterator< RowView >;
      using IteratorType = MatrixRowViewIterator< RowView >;

      /**
       * \brief Constructor with all necessary data.
Loading