35 #ifndef _BLAZE_MATH_FUNCTIONS_H_ 36 #define _BLAZE_MATH_FUNCTIONS_H_ 68 template<
typename T >
69 inline constexpr
int sign( T a ) noexcept;
71 template<
typename T >
72 inline size_t digits( T a ) noexcept;
74 template<
typename T1,
typename T2 >
76 min(
const T1& a,
const T2& b ) noexcept( All<IsNumeric,T1,T2>::value );
78 template<
typename T1,
typename T2,
typename... Ts >
80 min(
const T1& a,
const T2& b,
const Ts&... args ) noexcept( All<IsNumeric,T1,T2,Ts...>::value );
82 template<
typename T1,
typename T2 >
84 max(
const T1& a,
const T2& b ) noexcept( All<IsNumeric,T1,T2>::value );
86 template<
typename T1,
typename T2,
typename... Ts >
88 max(
const T1& a,
const T2& b,
const Ts&... args ) noexcept( All<IsNumeric,T1,T2,Ts...>::value );
90 template<
typename T1,
typename T2 >
93 template<
typename T1,
typename T2 >
95 noexcept( IsBuiltin< CommonType_<T1,T2> >::value );
97 template<
typename T1,
typename T2 >
99 noexcept( IsBuiltin< CommonType_<T1,T2> >::value );
114 template<
typename T >
115 inline constexpr
int sign( T a ) noexcept
120 ?( T(0) < a ) - ( a < T(0) )
144 template<
typename T >
173 template<
typename T1,
typename T2 >
177 return ( a < b )?( a ):( b );
195 template<
typename T1,
typename T2,
typename... Ts >
199 return min( a,
min( b, args... ) );
216 template<
typename T1,
typename T2 >
220 return ( a < b )?( b ):( a );
238 template<
typename T1,
typename T2,
typename... Ts >
242 return max( a,
max( b, args... ) );
260 template<
typename T1,
typename T2 >
263 return ( value + ( factor - ( value % factor ) ) % factor );
279 template<
typename T >
305 return ( b - a ) > 1E-8F;
327 return ( b - a ) > 1E-8;
349 return ( b - a ) > 1E-10;
367 template<
typename T1,
typename T2 >
371 return less_backend< CommonType_<T1,T2> >( a, b );
387 template<
typename T >
413 return ( b - a ) > 1E-8F;
435 return ( b - a ) > 1E-8;
455 BLAZE_ALWAYS_INLINE constexpr
bool greater_backend(
long double a,
long double b ) noexcept
457 return ( b - a ) > 1E-10;
475 template<
typename T1,
typename T2 >
479 return greater_backend< CommonType_<T1,T2> >( a, b );
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE constexpr bool less(const T1 &a, const T2 &b) noexcept(IsBuiltin< CommonType_< T1, T2 > >::value)
Generic less-than comparison.
Definition: Functions.h:368
Header file for the And class template.
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1755
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1802
constexpr int sign(T a) noexcept
Sign function.
Definition: Functions.h:115
Compile time check for signed data types.This type trait tests whether or not the given template para...
Definition: IsSigned.h:77
BLAZE_ALWAYS_INLINE constexpr bool greater(const T1 &a, const T2 &b) noexcept(IsBuiltin< CommonType_< T1, T2 > >::value)
Generic greater-than comparison.
Definition: Functions.h:476
#define BLAZE_CONSTRAINT_MUST_BE_INTEGRAL_TYPE(T)
Constraint on the data type.In case the given data type T is not an integral data type...
Definition: Integral.h:60
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the IsFloatingPoint type trait.
size_t digits(T a) noexcept
Returns the number of valid digits of an integral value.
Definition: Functions.h:145
Compile time check for floating point data types.This type trait tests whether or not the given templ...
Definition: IsFloatingPoint.h:75
Constraint on the data type.
Header file for the IsNumeric type trait.
Header file for the CommonType type trait.
Compile time type check.This type trait determines whether the given type trait TypeTrait evaluates t...
Definition: All.h:80
BLAZE_ALWAYS_INLINE constexpr auto nextMultiple(T1 value, T2 factor) noexcept
Rounds up an integral value to the next multiple of a given factor.
Definition: Functions.h:261
Compile time check for built-in data types.This type trait tests whether or not the given template pa...
Definition: IsBuiltin.h:75
Header file for the IsSigned type trait.
#define BLAZE_CONSTRAINT_MUST_BE_BUILTIN_TYPE(T)
Constraint on the data type.In case the given data type T is not a built-in data type, a compilation error is created.
Definition: Builtin.h:60
Header file for the All type trait.
Header file for the IsBuiltin type trait.
typename CommonType< T... >::Type CommonType_
Auxiliary alias declaration for the CommonType type trait.The CommonType_ alias declaration provides ...
Definition: CommonType.h:95
System settings for the inline keywords.
Constraint on the data type.