35#ifndef _BLAZE_MATH_SHIMS_EQUAL_H_
36#define _BLAZE_MATH_SHIMS_EQUAL_H_
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 ) ) );
358inline bool equal( complex<T1> a, T2 b )
382inline bool equal( T1 a, complex<T2> b )
406inline bool equal( complex<T1> a, complex<T2> b )
430constexpr bool equal(
const T1& a,
const T2& 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.
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 IsScalar_v
Auxiliary variable template for the IsScalar type trait.
Definition IsScalar.h:104
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
bool equal(const SharedValue< T1 > &lhs, const SharedValue< T2 > &rhs)
Equality check for a two shared values.
Definition SharedValue.h:343
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:138
Header file for the generic max algorithm.