35 #ifndef _BLAZE_MATH_SHIMS_EQUAL_H_
36 #define _BLAZE_MATH_SHIMS_EQUAL_H_
73 inline bool equal(
const T1& a,
const T2& b )
98 inline bool equal(
float a,
float b )
100 const float acc( static_cast<float>(
accuracy ) );
101 return ( std::fabs( a - b ) <=
max( acc, acc * std::fabs( a ) ) );
125 inline bool equal(
float a,
double b )
127 return equal( a, static_cast<float>( b ) );
151 inline bool equal(
float a,
long double b )
153 return equal( a, static_cast<float>( b ) );
173 inline bool equal(
double a,
float b )
175 return equal( static_cast<float>( a ), b );
199 inline bool equal(
double a,
double b )
201 const double acc( static_cast<double>(
accuracy ) );
202 return ( std::fabs( a - b ) <=
max( acc, acc * std::fabs( a ) ) );
226 inline bool equal(
double a,
long double b )
228 return equal( a, static_cast<double>( b ) );
252 inline bool equal(
long double a,
float b )
254 return equal( static_cast<float>( a ), b );
278 inline bool equal(
long double a,
double b )
280 return equal( static_cast<double>( a ), b );
304 inline bool equal(
long double a,
long double b )
306 const long double acc( static_cast<long double>(
accuracy ) );
307 return ( std::fabs( a - b ) <=
max( acc, acc * std::fabs( a ) ) );
326 template<
typename T1
328 inline bool equal( complex<T1> a, T2 b )
349 template<
typename T1
351 inline bool equal( T1 a, complex<T2> b )
372 template<
typename T1
374 inline bool equal( complex<T1> a, complex<T2> b )
Computation accuracy for floating point data types.
Header file for mathematical functions.
const DMatForEachExpr< MT, Imag, SO > imag(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the imaginary part of each single element of dm.
Definition: DMatForEachExpr.h:1251
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1716
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
const DMatForEachExpr< MT, Real, SO > real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatForEachExpr.h:1223
bool equal(const T1 &a, const T2 &b)
Generic equality check.
Definition: Equal.h:73
const Accuracy accuracy
Global Accuracy instance.The blaze::accuracy instance can be used wherever a floating point data type...
Definition: Accuracy.h:901
Header file for the complex data type.