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

I

parent 16f3e12a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -225,8 +225,9 @@ segmentsReduction( IndexType first, IndexType last, Fetch& fetch, Reduction& red
      const IndexType end = offsetsView[ i + 1 ];
      RealType aux( zero );
      bool compute( true );
      IndexType localIdx( 0 );
      for( IndexType j = begin; j < end && compute; j++  )
         reduction( aux, fetch( i, j, compute, args... ) );
         reduction( aux, fetch( i, localIdx++, j, compute, args... ) );
      keeper( i, aux );
   };
   Algorithms::ParallelFor< Device >::exec( first, last, l, args... );
+4 −2
Original line number Diff line number Diff line
@@ -354,8 +354,9 @@ segmentsReduction( IndexType first, IndexType last, Fetch& fetch, Reduction& red
         const IndexType end = begin + segmentSize;
         RealType aux( zero );
         bool compute( true );
         IndexType localIdx( 0 );
         for( IndexType globalIdx = begin; globalIdx< end; globalIdx++  )
            reduction( aux, fetch( segmentIdx, globalIdx, compute, args... ) );
            reduction( aux, fetch( segmentIdx, localIdx++, globalIdx, compute, args... ) );
         keeper( segmentIdx, aux );
      };
      Algorithms::ParallelFor< Device >::exec( first, last, l, args... );
@@ -370,8 +371,9 @@ segmentsReduction( IndexType first, IndexType last, Fetch& fetch, Reduction& red
         const IndexType end = sliceOffsets_view[ sliceIdx + 1 ];
         RealType aux( zero );
         bool compute( true );
         IndexType localIdx( 0 );
         for( IndexType globalIdx = begin; globalIdx < end; globalIdx += SliceSize  )
            reduction( aux, fetch( segmentIdx, globalIdx, compute, args... ) );
            reduction( aux, fetch( segmentIdx, localIdx++, globalIdx, compute, args... ) );
         keeper( segmentIdx, aux );
      };
      Algorithms::ParallelFor< Device >::exec( first, last, l, args... );
+6 −0
Original line number Diff line number Diff line
@@ -183,6 +183,12 @@ class Dense : public Matrix< Real, Device, Index >
                typename = typename Enabler< Device2 >::type >
      Dense& operator=( const Dense< Real2, Device2, Index2 >& matrix );

      template< typename Real_, typename Device_, typename Index_, typename RealAllocator_ >
      bool operator==( const Dense< Real_, Device_, Index_, RowMajorOrder >& matrix ) const;

      template< typename Real_, typename Device_, typename Index_, typename RealAllocator_ >
      bool operator!=( const Dense< Real_, Device_, Index_, RowMajorOrder >& matrix ) const;
      
      void save( const String& fileName ) const;

      void load( const String& fileName );
+27 −0
Original line number Diff line number Diff line
@@ -994,6 +994,33 @@ Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::operator=( const Den
   throw Exceptions::NotImplementedError("Cross-device assignment for the Dense format is not implemented yet.");
}

template< typename Real,
          typename Device,
          typename Index,
          bool RowMajorOrder,
          typename RealAllocator >
   template< typename Real_, typename Device_, typename Index_, typename RealAllocator_ >
bool
Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::
operator==( const Dense< Real_, Device_, Index_, RowMajorOrder >& matrix ) const
{
   return( this->getRows() == matrix.getRows() &&
           this->getColumns() == matrix.getColumns() &&
           this->getValues() == matrix.getValues() );
}

template< typename Real,
          typename Device,
          typename Index,
          bool RowMajorOrder,
          typename RealAllocator >
   template< typename Real_, typename Device_, typename Index_, typename RealAllocator_ >
bool
Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::
operator!=( const Dense< Real_, Device_, Index_, RowMajorOrder >& matrix ) const
{
   return ! ( *this == matrix );
}

template< typename Real,
          typename Device,
+7 −0
Original line number Diff line number Diff line
@@ -175,6 +175,13 @@ class SparseMatrix : public Matrix< Real, Device, Index, RealAllocator >
       */
      SparseMatrix& operator=( const SparseMatrix& matrix );

      /**
       * \brief Assignment of dense matrix
       */
      template< typename Real_, typename Device_, typename Index_, bool RowMajorOrder, typename RealAllocator_ >
      SparseMatrix& operator=( const Dense< Real_, Device_, Index_, RowMajorOrder, RealAllocator_ >& matrix );
      
      
      /**
       * \brief Assignment of any other matrix type.
       * @param matrix
Loading