35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECDVECEQUALEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_DVECDVECEQUALEXPR_H_ 70 template<
typename VT1
72 struct DVecDVecEqualExprHelper
76 using CT1 = RemoveReference_t< CompositeType_t<VT1> >;
79 using CT2 = RemoveReference_t< CompositeType_t<VT2> >;
83 static constexpr
bool value =
84 ( useOptimizedKernels &&
87 HasSIMDEqual_v< ElementType_t<CT1>, ElementType_t<CT2> > );
120 inline auto equal(
const DenseVector<VT1,TF1>& lhs,
const DenseVector<VT2,TF2>& rhs )
121 -> DisableIf_t< DVecDVecEqualExprHelper<VT1,VT2>::value,
bool >
123 using CT1 = CompositeType_t<VT1>;
124 using CT2 = CompositeType_t<VT2>;
127 if( (~lhs).
size() != (~rhs).
size() )
return false;
135 for(
size_t i=0UL; i<a.size(); ++i )
136 if( !equal<RF>( a[i], b[i] ) )
return false;
161 inline auto equal(
const DenseVector<VT1,TF1>& lhs,
const DenseVector<VT2,TF2>& rhs )
162 -> EnableIf_t< DVecDVecEqualExprHelper<VT1,VT2>::value,
bool >
164 using CT1 = CompositeType_t<VT1>;
165 using CT2 = CompositeType_t<VT2>;
166 using XT1 = RemoveReference_t<CT1>;
167 using XT2 = RemoveReference_t<CT2>;
170 if( (~lhs).
size() != (~rhs).
size() )
return false;
176 constexpr
size_t SIMDSIZE = SIMDTrait< ElementType_t<VT1> >
::size;
177 constexpr
bool remainder( !usePadding || !IsPadded_v<XT1> || !IsPadded_v<XT2> );
179 const size_t N( a.size() );
181 const size_t ipos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
186 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
187 if( !equal<RF>( a.load(i ), b.load(i ) ) )
return false;
188 if( !equal<RF>( a.load(i+SIMDSIZE ), b.load(i+SIMDSIZE ) ) )
return false;
189 if( !equal<RF>( a.load(i+SIMDSIZE*2UL), b.load(i+SIMDSIZE*2UL) ) )
return false;
190 if( !equal<RF>( a.load(i+SIMDSIZE*3UL), b.load(i+SIMDSIZE*3UL) ) )
return false;
192 for( ; (i+SIMDSIZE) < ipos; i+=SIMDSIZE*2UL ) {
193 if( !equal<RF>( a.load(i ), b.load(i ) ) )
return false;
194 if( !equal<RF>( a.load(i+SIMDSIZE), b.load(i+SIMDSIZE) ) )
return false;
196 for( ; i<ipos; i+=SIMDSIZE ) {
197 if( !equal<RF>( a.load(i), b.load(i) ) )
return false;
199 for( ; remainder && i<N; ++i ) {
200 if( !equal<RF>( a[i], b[i] ) )
return false;
217 template<
typename VT1
223 return equal<relaxed>( lhs, rhs );
236 template<
typename VT1
242 return !equal<relaxed>( lhs, rhs );
Header file for auxiliary alias declarations.
Header file for basic type definitions.
Header file for the DenseVector base class.
System settings for performance optimizations.
Header file for the DisableIf class template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:253
Header file for all SIMD functionality.
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
Header file for the equal shim.
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
Header file for the EnableIf class template.
Header file for the IsPadded type trait.
Header file for the relaxation flag types.
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
Header file for the RemoveReference type trait.
Header file for the HasSIMDEqual type trait.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
Definition: Assert.h:101
bool equal(const SharedValue< T1 > &lhs, const SharedValue< T2 > &rhs)
Equality check for a two shared values.
Definition: SharedValue.h:342