Commit ec89ae36 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed operator!= for Vector and VectorView

parent e8d8f773
Loading
Loading
Loading
Loading
+3 −24
Original line number Diff line number Diff line
@@ -295,42 +295,21 @@ template< typename Real1, typename Real2, typename Device1, typename Device2, ty
bool
operator!=( const Vector< Real1, Device1, Index, Allocator >& a, const Vector< Real2, Device2, Index, Allocator >& b )
{
   if( a.getSize() != b.getSize() )
      return false;
   if( a.getSize() == 0 )
      return true;
   return !Algorithms::ArrayOperations< Device1, Device2 >::
            compare( a.getData(),
                     b.getData(),
                     a.getSize() );
   return ! (a == b);
}

template< typename Real1, typename Real2, typename Device1, typename Device2, typename Index, typename Allocator >
bool
operator!=( const VectorView< Real1, Device1, Index >& a, const Vector< Real2, Device2, Index, Allocator >& b )
{
   if( a.getSize() != b.getSize() )
      return false;
   if( a.getSize() == 0 )
      return true;
   return !Algorithms::ArrayOperations< Device1, Device2 >::
            compare( a.getData(),
                     b.getData(),
                     a.getSize() );
   return ! (a == b);
}

template< typename Real1, typename Real2, typename Device1, typename Device2, typename Index, typename Allocator >
bool
operator!=( const Vector< Real1, Device1, Index, Allocator >& a, const VectorView< Real2, Device2, Index >& b )
{
   if( a.getSize() != b.getSize() )
      return false;
   if( a.getSize() == 0 )
      return true;
   return !Algorithms::ArrayOperations< Device1, Device2 >::
            compare( a.getData(),
                     b.getData(),
                     a.getSize() );
   return ! (a == b);
}

////
+1 −8
Original line number Diff line number Diff line
@@ -175,14 +175,7 @@ template< typename Real1, typename Real2, typename Device1, typename Device2, ty
bool
operator!=( const VectorView< Real1, Device1, Index >& a, const VectorView< Real2, Device2, Index >& b )
{
   if( a.getSize() != b.getSize() )
      return false;
   if( a.getSize() == 0 )
      return true;
   return !Algorithms::ArrayOperations< Device1, Device2 >::
            compare( a.getData(),
                     b.getData(),
                     a.getSize() );
   return ! (a == b);
}

////