35#ifndef _BLAZE_MATH_SHIMS_EQUAL_H_
36#define _BLAZE_MATH_SHIMS_EQUAL_H_
77 ,
typename = EnableIf_t< IsScalar_v<T1> && IsScalar_v<T2> > >
78constexpr bool equal(
const T1& a,
const T2& b )
103template< RelaxationFlag RF >
104inline bool equal(
float a,
float b )
107 const float acc(
static_cast<float>(
accuracy ) );
108 return ( std::fabs( a - b ) <=
max( acc, acc * std::fabs( a ) ) );
136template< RelaxationFlag RF >
137inline bool equal(
float a,
double b )
139 return equal<RF>( a,
static_cast<float>( b ) );
163template< RelaxationFlag RF >
164inline bool equal(
float a,
long double b )
166 return equal<RF>( a,
static_cast<float>( b ) );
186template< RelaxationFlag RF >
187inline bool equal(
double a,
float b )
189 return equal<RF>(
static_cast<float>( a ), b );
213template< RelaxationFlag RF >
214inline bool equal(
double a,
double b )
217 const double acc(
static_cast<double>(
accuracy ) );
218 return ( std::fabs( a - b ) <=
max( acc, acc * std::fabs( a ) ) );
246template< RelaxationFlag RF >
247inline bool equal(
double a,
long double b )
249 return equal<RF>( a,
static_cast<double>( b ) );
273template< RelaxationFlag RF >
274inline bool equal(
long double a,
float b )
276 return equal<RF>(
static_cast<float>( a ), b );
300template< RelaxationFlag RF >
301inline bool equal(
long double a,
double b )
303 return equal<RF>(
static_cast<double>( a ), b );
327template< RelaxationFlag RF >
328inline bool equal(
long double a,
long double b )
331 const long double acc(
static_cast<long double>(
accuracy ) );
332 return ( std::fabs( a - b ) <=
max( acc, acc * std::fabs( a ) ) );
360 return equal<RF>(
real( a ), b ) && equal<RF>(
imag( a ), T1() );
384 return equal<RF>( a,
real( b ) ) && equal<RF>(
imag( b ), T2() );
408 return equal<RF>(
real( a ),
real( b ) ) && equal<RF>(
imag( a ),
imag( b ) );
430constexpr bool equal(
const T1& a,
const T2& b )
432 return equal<relaxed>( a, b );
Computation accuracy for floating point data types.
Header file for the complex data type.
Header file for the EnableIf class template.
Header file for the IsScalar type trait.
Header file for the relaxation flag enumeration.
Complex data type of the Blaze library.
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:1375
decltype(auto) real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatMapExpr.h:1529
decltype(auto) imag(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the imaginary part of each single element of dm.
Definition: DMatMapExpr.h:1557
constexpr bool equal(const T1 &a, const T2 &b)
Generic equality check.
Definition: Equal.h:430
RelaxationFlag
Relaxation flag for strict or relaxed semantics.
Definition: RelaxationFlag.h:66
constexpr Accuracy accuracy
Global Accuracy instance.
Definition: Accuracy.h:907
@ relaxed
Flag for relaxed semantics.
Definition: RelaxationFlag.h:68
Header file for the generic max algorithm.