35 #ifndef _BLAZE_MATH_SHIMS_EQUAL_H_ 36 #define _BLAZE_MATH_SHIMS_EQUAL_H_ 78 ,
typename = EnableIf_t< ( IsSigned_v<T1> && IsSigned_v<T2> ) ||
79 ( IsUnsigned_v<T1> && IsUnsigned_v<T2> ) > >
80 inline constexpr
bool equal(
const T1& a,
const T2& b )
106 inline bool equal(
float a,
float b )
109 const float acc( static_cast<float>(
accuracy ) );
110 return ( std::fabs( a - b ) <=
max( acc, acc * std::fabs( a ) ) );
139 inline bool equal(
float a,
double b )
141 return equal<RF>( a,
static_cast<float>( b ) );
166 inline bool equal(
float a,
long double b )
168 return equal<RF>( a,
static_cast<float>( b ) );
189 inline bool equal(
double a,
float b )
191 return equal<RF>(
static_cast<float>( a ), b );
216 inline bool equal(
double a,
double b )
219 const double acc( static_cast<double>(
accuracy ) );
220 return ( std::fabs( a - b ) <=
max( acc, acc * std::fabs( a ) ) );
249 inline bool equal(
double a,
long double b )
251 return equal<RF>( a,
static_cast<double>( b ) );
276 inline bool equal(
long double a,
float b )
278 return equal<RF>(
static_cast<float>( a ), b );
303 inline bool equal(
long double a,
double b )
305 return equal<RF>(
static_cast<double>( a ), b );
330 inline bool equal(
long double a,
long double b )
333 const long double acc( static_cast<long double>(
accuracy ) );
334 return ( std::fabs( a - b ) <=
max( acc, acc * std::fabs( a ) ) );
360 inline bool equal( complex<T1> a, T2 b )
362 return equal<RF>(
real( a ), b ) && equal<RF>(
imag( a ), T1() );
384 inline bool equal( T1 a, complex<T2> b )
386 return equal<RF>( a,
real( b ) ) && equal<RF>(
imag( b ), T2() );
408 inline bool equal( complex<T1> a, complex<T2> b )
410 return equal<RF>(
real( a ),
real( b ) ) && equal<RF>(
imag( a ),
imag( b ) );
430 template<
typename T1
432 inline constexpr
bool equal(
const T1& a,
const T2& b )
434 return equal<relaxed>( a, b );
Computation accuracy for floating point data types.
decltype(auto) real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatMapExpr.h:1392
Headerfile for the generic max algorithm.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1179
Header file for the EnableIf class template.
Header file for the relaxation flag types.
constexpr bool relaxed
Relaxation flag for relaxed semantics.
Definition: RelaxationFlag.h:85
Header file for the IsSigned type trait.
Header file for the IsUnsigned type trait.
Header file for the complex data type.
constexpr Accuracy accuracy
Global Accuracy instance.The blaze::accuracy instance can be used wherever a floating point data type...
Definition: Accuracy.h:907
decltype(auto) imag(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the imaginary part of each single element of dm.
Definition: DMatMapExpr.h:1421
bool equal(const SharedValue< T1 > &lhs, const SharedValue< T2 > &rhs)
Equality check for a two shared values.
Definition: SharedValue.h:342