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 T >
93 template<
typename T1,
typename T2 >
95 noexcept( IsBuiltin< CommonType_<T1,T2> >::value );
110 template<
typename T >
111 inline constexpr
int sign( T a ) noexcept
116 ?( T(0) < a ) - ( a < T(0) )
140 template<
typename T >
169 template<
typename T1,
typename T2 >
173 return ( a < b )?( a ):( b );
191 template<
typename T1,
typename T2,
typename... Ts >
195 return min( a,
min( b, args... ) );
212 template<
typename T1,
typename T2 >
216 return ( a < b )?( b ):( a );
234 template<
typename T1,
typename T2,
typename... Ts >
238 return max( a,
max( b, args... ) );
257 template<
typename T >
262 return ( value > T(0) && factor > T(0) )
263 ?( value + ( factor - ( value % factor ) ) % factor )
280 template<
typename T >
282 noexcept( IsBuiltin<T>::value )
306 return ( b - a ) > 1E-8F;
328 return ( b - a ) > 1E-8;
348 BLAZE_ALWAYS_INLINE constexpr
bool lessThan_backend(
long double a,
long double b ) noexcept
350 return ( b - a ) > 1E-10;
368 template<
typename T1,
typename T2 >
372 return lessThan_backend< CommonType_<T1,T2> >( a, b );
Header file for basic type definitions.
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:1669
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1716
constexpr int sign(T a) noexcept
Sign function.
Definition: Functions.h:111
Compile time check for signed data types.This type trait tests whether or not the given template para...
Definition: IsSigned.h:77
#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:141
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
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.
BLAZE_ALWAYS_INLINE constexpr T nextMultiple(T value, T factor) noexcept
Rounds up an integral value to the next multiple of a given factor.
Definition: Functions.h:258
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.