Blaze 3.9
Functions

Functions

template<typename T1 , typename T2 >
BLAZE_ALWAYS_INLINE constexpr decltype(auto) blaze::add (T1 &&lhs, T2 &&rhs) noexcept(noexcept(lhs+rhs))
 Addition of the two given arguments. More...
 
template<typename T , EnableIf_t< IsScalar_v< T >||IsSIMDPack_v< T > > * = nullptr>
BLAZE_ALWAYS_INLINE constexpr void blaze::clear (T &clearable)
 Clearing the given value/object to the default state. More...
 
template<typename T , EnableIf_t< IsNumeric_v< T > > * = nullptr>
BLAZE_ALWAYS_INLINE constexpr T blaze::conj (const T &a) noexcept
 Computing the conjugate of the given numeric value. More...
 
template<typename T >
BLAZE_ALWAYS_INLINE void blaze::conjugate (T &a) noexcept(IsNumeric_v< T >)
 In-place conjugation of the given value/object. More...
 
template<typename T >
BLAZE_ALWAYS_INLINE void blaze::cswap (T &a, T &b) noexcept(IsNumeric_v< T >)
 Swapping two conjugated values/objects. More...
 
template<typename T , EnableIf_t< IsIntegral_v< T > > * = nullptr>
constexpr size_t blaze::digits (T a) noexcept
 Returns the number of valid digits of an integral value. More...
 
template<typename T1 , typename T2 >
BLAZE_ALWAYS_INLINE constexpr decltype(auto) blaze::div (T1 &&lhs, T2 &&rhs) noexcept(noexcept(lhs/rhs))
 Division of the two given arguments. More...
 
template<RelaxationFlag RF, typename T1 , typename T2 , typename = EnableIf_t< IsScalar_v<T1> && IsScalar_v<T2> >>
constexpr bool blaze::equal (const T1 &a, const T2 &b)
 Generic equality comparison. More...
 
template<typename T1 , typename T2 >
constexpr bool blaze::equal (const T1 &a, const T2 &b)
 Generic equality check. More...
 
template<typename T >
BLAZE_ALWAYS_INLINE constexpr EnableIf_t< IsBuiltin_v< T >||IsComplex_v< T >, const T & > blaze::eval (const T &a) noexcept
 Formal evaluation of the given argument. More...
 
template<typename T , EnableIf_t< !HasCompositeType_v< T > &&!IsProxy_v< T > > * = nullptr>
constexpr T blaze::evaluate (const T &a) noexcept
 Formal evaluation of the given argument. More...
 
template<typename T , typename = EnableIf_t< IsBuiltin_v<T> >>
BLAZE_ALWAYS_INLINE decltype(auto) blaze::exp10 (const T &a) noexcept(noexcept(pow(T(10), a)))
 Returns the base-10 exponent of the given built-in value. More...
 
template<typename T1 , typename T2 >
BLAZE_ALWAYS_INLINE constexpr bool blaze::greater (const T1 &a, const T2 &b) noexcept(IsBuiltin_v< CommonType_t< T1, T2 > >)
 Generic greater-than comparison. More...
 
template<typename T , typename = EnableIf_t< IsBuiltin_v<T> >>
auto blaze::invcbrt (T a) noexcept -> decltype(inv(cbrt(a)))
 Returns the inverse cubic root of the given built-in value. More...
 
template<typename T , EnableIf_t< IsScalar_v< T > > * = nullptr>
BLAZE_ALWAYS_INLINE constexpr decltype(auto) blaze::inv (T a) noexcept(IsBuiltin_v< T >)
 Inverting the given value/object. More...
 
BLAZE_ALWAYS_INLINE constexpr complex< float > blaze::inv (const complex< float > &a) noexcept
 Inverting the given single precision complex number. More...
 
BLAZE_ALWAYS_INLINE constexpr complex< double > blaze::inv (const complex< double > &a) noexcept
 Inverting the given double precision complex number. More...
 
BLAZE_ALWAYS_INLINE constexpr complex< long double > blaze::inv (const complex< long double > &a) noexcept
 Inverting the given extended precision complex number. More...
 
BLAZE_ALWAYS_INLINE void blaze::invert (float &a) noexcept
 In-place inversion of the given single precision value. More...
 
BLAZE_ALWAYS_INLINE void blaze::invert (double &a) noexcept
 In-place inversion of the given double precision value. More...
 
BLAZE_ALWAYS_INLINE void blaze::invert (long double &a) noexcept
 In-place inversion of the given extended precision value. More...
 
BLAZE_ALWAYS_INLINE void blaze::invert (complex< float > &a) noexcept
 In-place inversion of the given single precision complex number. More...
 
BLAZE_ALWAYS_INLINE void blaze::invert (complex< double > &a) noexcept
 In-place inversion of the given double precision complex number. More...
 
BLAZE_ALWAYS_INLINE void blaze::invert (complex< long double > &a) noexcept
 In-place inversion of the given extended precision complex number. More...
 
template<typename T , typename = EnableIf_t< IsBuiltin_v<T> >>
auto blaze::invsqrt (T a) noexcept -> decltype(inv(sqrt(a)))
 Returns the inverse square root of the given built-in value. More...
 
template<typename T , typename = EnableIf_t< IsBuiltin_v<T> >>
auto blaze::invsqrt (const complex< T > &a) noexcept -> decltype(inv(sqrt(a)))
 Returns the inverse square root of the given complex number. More...
 
template<RelaxationFlag RF, typename Type , EnableIf_t< IsScalar_v< Type >||IsSIMDPack_v< Type > > * = nullptr>
BLAZE_ALWAYS_INLINE bool blaze::isDefault (const Type &v) noexcept(IsBuiltin_v< Type >)
 Returns whether the given value/object is in default state. More...
 
template<typename Type >
BLAZE_ALWAYS_INLINE bool blaze::isDefault (const Type &v) noexcept(IsBuiltin_v< Type >)
 Returns whether the given value/object is in default state. More...
 
template<typename Type , EnableIf_t< IsScalar_v< Type > > * = nullptr>
BLAZE_ALWAYS_INLINE bool blaze::isDivisor (const Type &v)
 Returns whether the given value/object is a valid divisor. More...
 
template<typename T , EnableIf_t< IsArithmetic_v< T > > * = nullptr>
bool blaze::isfinite (T a) noexcept
 Determines if the given floating point number has finite value. More...
 
template<typename T , EnableIf_t< IsArithmetic_v< T > > * = nullptr>
bool blaze::isinf (T a) noexcept
 Determines if the given floating point number is a positive or negative infinity. More...
 
template<typename T , EnableIf_t< IsNumeric_v< T > > * = nullptr>
BLAZE_ALWAYS_INLINE bool blaze::isnan (T a) noexcept
 Platform independent implementation of the C99 isnan function. More...
 
template<RelaxationFlag RF, typename Type , EnableIf_t< IsNumeric_v< Type > > * = nullptr>
BLAZE_ALWAYS_INLINE bool blaze::isOne (const Type &v) noexcept
 Returns whether the given value/object represents the numeric value 1. More...
 
template<typename Type >
BLAZE_ALWAYS_INLINE bool blaze::isOne (const Type &v)
 Returns whether the given value/object represents the numeric value 1. More...
 
template<RelaxationFlag RF, typename Type , EnableIf_t< IsScalar_v< Type > > * = nullptr>
BLAZE_ALWAYS_INLINE bool blaze::isReal (const Type &v) noexcept
 Returns whether the given value/object represents a real number. More...
 
template<typename Type >
BLAZE_ALWAYS_INLINE bool blaze::isReal (const Type &v) noexcept
 Returns whether the given value/object represents a real number. More...
 
template<RelaxationFlag RF, typename Type , EnableIf_t< IsScalar_v< Type > > * = nullptr>
BLAZE_ALWAYS_INLINE bool blaze::isZero (const Type &v) noexcept
 Returns whether the given value/object represents the numeric value 0. More...
 
template<typename Type >
BLAZE_ALWAYS_INLINE bool blaze::isZero (const Type &v) noexcept
 Returns whether the given value/object represents the numeric value 0. More...
 
template<typename T1 , typename T2 >
BLAZE_ALWAYS_INLINE constexpr bool blaze::less (const T1 &a, const T2 &b) noexcept(IsBuiltin_v< CommonType_t< T1, T2 > >)
 Generic less-than comparison. More...
 
template<typename T1 , typename T2 >
BLAZE_ALWAYS_INLINE constexpr decltype(auto) blaze::mult (T1 &&lhs, T2 &&rhs) noexcept(noexcept(lhs *rhs))
 Multiplication of the two given arguments. More...
 
template<typename T , EnableIf_t< IsScalar_v< T >||IsSIMDPack_v< T > > * = nullptr>
BLAZE_ALWAYS_INLINE constexpr decltype(auto) blaze::pow2 (const T &a) noexcept(noexcept(a *a))
 Squaring the given value/object. More...
 
template<typename T , EnableIf_t< IsScalar_v< T >||IsSIMDPack_v< T > > * = nullptr>
BLAZE_ALWAYS_INLINE constexpr decltype(auto) blaze::pow3 (const T &a) noexcept(noexcept(a *a *a))
 Cubing the given value/object. More...
 
template<typename T , EnableIf_t< IsScalar_v< T >||IsSIMDPack_v< T > > * = nullptr>
BLAZE_ALWAYS_INLINE constexpr decltype(auto) blaze::pow4 (const T &a) noexcept(noexcept(pow2(pow2(a))))
 Quadruple the given value/object. More...
 
template<typename T >
BLAZE_ALWAYS_INLINE decltype(auto) blaze::qdrt (const T &a)
 Computing the quad root (4th root) of the given value/object. More...
 
template<typename T , EnableIf_t< IsScalar_v< T >||IsSIMDPack_v< T > > * = nullptr>
BLAZE_ALWAYS_INLINE constexpr void blaze::reset (T &resettable)
 Resetting the given value/object to the default value. More...
 
template<typename T >
BLAZE_ALWAYS_INLINE constexpr EnableIf_t< IsBuiltin_v< T >||IsComplex_v< T >, const T & > blaze::serial (const T &a) noexcept
 Formal serialization of the evaluation of the given argument. More...
 
template<typename T , typename = EnableIf_t< IsIntegral_v<T> >>
constexpr T blaze::sign (T a) noexcept
 Evaluating the sign of the given value. More...
 
constexpr float blaze::sign (float a) noexcept
 Evaluating the sign of the given single precision value. More...
 
constexpr double blaze::sign (double a) noexcept
 Evaluating the sign of the given double precision value. More...
 
constexpr long double blaze::sign (long double a) noexcept
 Evaluating the sign of the given extended precision value. More...
 
template<typename T1 , typename T2 >
BLAZE_ALWAYS_INLINE constexpr decltype(auto) blaze::sub (T1 &&lhs, T2 &&rhs) noexcept(noexcept(lhs - rhs))
 Subtraction of the two given arguments. More...
 

Detailed Description

Function Documentation

◆ add()

template<typename T1 , typename T2 >
BLAZE_ALWAYS_INLINE constexpr decltype(auto) blaze::add ( T1 &&  lhs,
T2 &&  rhs 
)
constexprnoexcept

Addition of the two given arguments.

Parameters
lhsThe left-hand side operand for the addition.
rhsThe right-hand side operand for the addition.
Returns
The sum of the two operands.

The add() shim represents an abstract interface for the addition of two operands.

◆ clear()

template<typename T , EnableIf_t< IsScalar_v< T >||IsSIMDPack_v< T > > * = nullptr>
BLAZE_ALWAYS_INLINE constexpr void blaze::clear ( T &  clearable)
constexpr

Clearing the given value/object to the default state.

Parameters
clearableThe value/object to be cleared.
Returns
void

The clear shim represents an abstract interface for clearing a value/object of any given data type to its default state. Values of built-in data type are reset to zero.

◆ conj()

template<typename T , EnableIf_t< IsNumeric_v< T > > * = nullptr>
BLAZE_ALWAYS_INLINE constexpr T blaze::conj ( const T &  a)
constexprnoexcept

Computing the conjugate of the given numeric value.

Parameters
aThe given numeric value.
Returns
The complex conjugate of the given value.

The conj shim represents an abstract interface for the computation of the complex conjugate of a numeric value. In case the given value is of complex type the function computes the complex conjugate by reversing the sign of the imaginary part:

const blaze::complex<double> a( 1.0, 2.0 );
const blaze::complex<double> b( conj( a ) ); // Results in ( 1, -2 )
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1464

Values of built-in data type are considered complex numbers with an imaginary part of 0. Thus the returned value corresponds to the given value. For more information on complex conjugates, see

https://en.wikipedia.org/wiki/Complex_conjugate

◆ conjugate()

template<typename T >
BLAZE_ALWAYS_INLINE void blaze::conjugate ( T &  a)
noexcept

In-place conjugation of the given value/object.

Parameters
aThe given value/object to be conjugated.
Returns
void

The conjugate shim represents an abstract interface for the in-place conjugation of any given value/object. In case the given value is of complex type the function computes the complex conjugate by reversing the sign of the imaginary part:

blaze::complex<double> a( 1.0, 2.0 );
conjugate( a ); // Results in ( 1, -2 )
BLAZE_ALWAYS_INLINE void conjugate(T &a) noexcept(IsNumeric_v< T >)
In-place conjugation of the given value/object.
Definition: Conjugate.h:118

Values of other data types, such as all built-in data types, are considered complex numbers with an imaginary part of 0. Thus the returned value corresponds to the given value. For more information on complex conjugates, see

https://en.wikipedia.org/wiki/Complex_conjugate

◆ cswap()

template<typename T >
BLAZE_ALWAYS_INLINE void blaze::cswap ( T &  a,
T &  b 
)
noexcept

Swapping two conjugated values/objects.

Parameters
aThe first value/object to be swapped and conjugated.
bThe second value/object to be swapped and conjugated.
Returns
void

The cswap shim implements the most efficient way to swap and conjugate two values/objects. Semantically cswap is equivalent to the following sequence of operations:

swap( a, b );
conjugate( a );
conjugate( b );
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:225

◆ digits()

template<typename T , EnableIf_t< IsIntegral_v< T > > * = nullptr>
constexpr size_t blaze::digits ( a)
constexprnoexcept

Returns the number of valid digits of an integral value.

Parameters
aThe integral value.
Returns
The number of valid digits.

This function counts the number of valid digits in the given integral value.

digits( 100 ); // Returns 3
digits( 12345 ); // Returns 5
digits( 0 ); // Returns 0
constexpr size_t digits(T a) noexcept
Returns the number of valid digits of an integral value.
Definition: Digits.h:76

The digits function only works for integral built-in data types. The attempt to use any other type will result in a compile time error.

◆ div()

template<typename T1 , typename T2 >
BLAZE_ALWAYS_INLINE constexpr decltype(auto) blaze::div ( T1 &&  lhs,
T2 &&  rhs 
)
constexprnoexcept

Division of the two given arguments.

Parameters
lhsThe left-hand side operand for the division.
rhsThe right-hand side operand for the division.
Returns
The quotient of the two operands.

The div() shim represents an abstract interface for the division of two operands.

◆ equal() [1/2]

template<RelaxationFlag RF, typename T1 , typename T2 , typename = EnableIf_t< IsScalar_v<T1> && IsScalar_v<T2> >>
constexpr bool blaze::equal ( const T1 &  a,
const T2 &  b 
)
constexpr

Generic equality comparison.

Parameters
aFirst value/object.
bSecond value/object.
Returns
true if the two values/objects are equal, false if not.

The equal shim represents an abstract interface for testing two values/objects for equality. Based on the setting of the relaxation flag RF, the function either performs a comparison via the equality operator (blaze::strict) or or a special comparison is selected that takes the limited machine accuracy into account (blaze::relaxed). In case the two values/objects are equal, the function returns true, otherwise it returns false.

◆ equal() [2/2]

template<typename T1 , typename T2 >
constexpr bool blaze::equal ( const T1 &  a,
const T2 &  b 
)
constexpr

Generic equality check.

Parameters
aFirst value/object.
bSecond value/object.
Returns
true if the two values/objects are equal, false if not.

The equal shim represents an abstract interface for testing two values/objects for equality. In case the two values/objects are equal, the function returns true, otherwise it returns false. Per default, the comparison of the two values/objects uses the equality operator operator==(). For built-in floating point data types a special comparison is selected that takes the limited machine accuracy into account.

◆ eval()

template<typename T >
BLAZE_ALWAYS_INLINE constexpr EnableIf_t< IsBuiltin_v< T >||IsComplex_v< T >, const T & > blaze::eval ( const T &  a)
constexprnoexcept

Formal evaluation of the given argument.

Parameters
aThe value/object to be evaluated.
Returns
The evaluated value/object.

The eval shim represents an abstract interface for enforcing the evaluation of a value/object of any given data type. For data types that don't require an evaluation, as for instance built-in data types, the default behavior is not changed.

◆ evaluate()

template<typename T , EnableIf_t< !HasCompositeType_v< T > &&!IsProxy_v< T > > * = nullptr>
constexpr T blaze::evaluate ( const T &  a)
constexprnoexcept

Formal evaluation of the given argument.

Parameters
aThe value/object to be evaluated.
Returns
The evaluated value/object.

The evaluate shim represents an abstract interface for enforcing the evaluation of a given value/object of any data type and deducing the correct result type of an operation. For data types that don't require an evaluation, as for instance built-in or complex data types, the default behavior is not changed.

◆ exp10()

template<typename T , typename = EnableIf_t< IsBuiltin_v<T> >>
BLAZE_ALWAYS_INLINE decltype(auto) blaze::exp10 ( const T &  a)
noexcept

Returns the base-10 exponent of the given built-in value.

Parameters
aThe given built-in value.
Returns
The base-10 exponent of the given value.

◆ greater()

template<typename T1 , typename T2 >
BLAZE_ALWAYS_INLINE constexpr bool blaze::greater ( const T1 &  a,
const T2 &  b 
)
constexprnoexcept

Generic greater-than comparison.

Parameters
aFirst value.
bSecond value.
Returns
true if the first value is greater than the second, false if not.

Generic greater-than comparison between to numeric values. Depending on the types of the two arguments, a special comparison for floating point values is selected that takes the limited machine accuracy into account.

◆ inv() [1/4]

BLAZE_ALWAYS_INLINE constexpr complex< double > blaze::inv ( const complex< double > &  a)
constexprnoexcept

Inverting the given double precision complex number.

Parameters
aThe double precision complex number to be inverted.
Returns
The inverse of the given value.

The inv shim represents an abstract interface for inverting a value/object of any given data type. For a double precision floating point complex number $ z = x + yi $ this results in $ \frac{\overline{z}}{x^2+y^2} $.

Note
A division by zero is only checked by an user assert.

◆ inv() [2/4]

BLAZE_ALWAYS_INLINE constexpr complex< float > blaze::inv ( const complex< float > &  a)
constexprnoexcept

Inverting the given single precision complex number.

Parameters
aThe single precision complex number to be inverted.
Returns
The inverse of the given value.

The inv shim represents an abstract interface for inverting a value/object of any given data type. For a single precision floating point complex number $ z = x + yi $ this results in $ \frac{\overline{z}}{x^2+y^2} $.

Note
A division by zero is only checked by an user assert.

◆ inv() [3/4]

BLAZE_ALWAYS_INLINE constexpr complex< long double > blaze::inv ( const complex< long double > &  a)
constexprnoexcept

Inverting the given extended precision complex number.

Parameters
aThe extended precision complex number to be inverted.
Returns
The inverse of the given value.

The inv shim represents an abstract interface for inverting a value/object of any given data type. For an extended precision floating point complex number $ z = x + yi $ this results in $ \frac{\overline{z}}{x^2+y^2} $.

Note
A division by zero is only checked by an user assert.

◆ inv() [4/4]

template<typename T , EnableIf_t< IsScalar_v< T > > * = nullptr>
BLAZE_ALWAYS_INLINE constexpr decltype(auto) blaze::inv ( a)
constexprnoexcept

Inverting the given value/object.

Parameters
aThe value/object to be inverted.
Returns
The inverse of the given value/object.

The inv shim represents an abstract interface for inverting a value/object of any given data type. For integral values this results in $ \frac{1}{a} $.

Note
A division by zero is only checked by an user assert.

◆ invcbrt()

template<typename T , typename = EnableIf_t< IsBuiltin_v<T> >>
auto blaze::invcbrt ( a) -> decltype( inv( cbrt( a ) ) )
inlinenoexcept

Returns the inverse cubic root of the given built-in value.

Parameters
aThe given built-in value $[0..\infty)$.
Returns
The inverse cubic root of the given value.
Note
The given value must be in the range $[0..\infty)$. The validity of the value is only checked by an user assert.

◆ invert() [1/6]

BLAZE_ALWAYS_INLINE void blaze::invert ( complex< double > &  a)
noexcept

In-place inversion of the given double precision complex number.

Parameters
aThe double precision complex number to be inverted.
Returns
The inverse of the given value.

The invert shim represents an abstract interface for inverting a value/object of any given data type in-place. For a double precision floating point complex number $ z = x + yi $ this results in $ \frac{\overline{z}}{x^2+y^2} $.

Note
A division by zero is only checked by an user assert.

◆ invert() [2/6]

BLAZE_ALWAYS_INLINE void blaze::invert ( complex< float > &  a)
noexcept

In-place inversion of the given single precision complex number.

Parameters
aThe single precision complex number to be inverted.
Returns
The inverse of the given value.

The invert shim represents an abstract interface for inverting a value/object of any given data type in-place. For a single precision floating point complex number $ z = x + yi $ this results in $ \frac{\overline{z}}{x^2+y^2} $.

Note
A division by zero is only checked by an user assert.

◆ invert() [3/6]

BLAZE_ALWAYS_INLINE void blaze::invert ( complex< long double > &  a)
noexcept

In-place inversion of the given extended precision complex number.

Parameters
aThe extended precision complex number to be inverted.
Returns
The inverse of the given value.

The invert shim represents an abstract interface for inverting a value/object of any given data type in-place. For an extended precision floating point complex number $ z = x + yi $ this results in $ \frac{\overline{z}}{x^2+y^2} $.

Note
A division by zero is only checked by an user assert.

◆ invert() [4/6]

BLAZE_ALWAYS_INLINE void blaze::invert ( double &  a)
noexcept

In-place inversion of the given double precision value.

Parameters
aThe double precision value to be inverted.
Returns
The inverse of the given value.

The invert shim represents an abstract interface for inverting a value/object of any given data type in-place. For double precision floating point values this results in $ \frac{1}{a} $.

Note
A division by zero is only checked by an user assert.

◆ invert() [5/6]

BLAZE_ALWAYS_INLINE void blaze::invert ( float &  a)
noexcept

In-place inversion of the given single precision value.

Parameters
aThe single precision value to be inverted.
Returns
The inverse of the given value.

The invert shim represents an abstract interface for inverting a value/object of any given data type in-place. For single precision floating point values this results in $ \frac{1}{a} $.

Note
A division by zero is only checked by an user assert.

◆ invert() [6/6]

BLAZE_ALWAYS_INLINE void blaze::invert ( long double &  a)
noexcept

In-place inversion of the given extended precision value.

Parameters
aThe extended precision value to be inverted.
Returns
The inverse of the given value.

The invert shim represents an abstract interface for inverting a value/object of any given data type in-place. For extended precision floating point values this results in $ \frac{1}{a} $.

Note
A division by zero is only checked by an user assert.

◆ invsqrt() [1/2]

template<typename T , typename = EnableIf_t< IsBuiltin_v<T> >>
auto blaze::invsqrt ( const complex< T > &  a) -> decltype( inv( sqrt( a ) ) )
inlinenoexcept

Returns the inverse square root of the given complex number.

Parameters
aThe given complex number.
Returns
The inverse square root of the given complex number.
Note
The given complex number must not be zero. The validity of the value is only checked by an user assert.

◆ invsqrt() [2/2]

template<typename T , typename = EnableIf_t< IsBuiltin_v<T> >>
auto blaze::invsqrt ( a) -> decltype( inv( sqrt( a ) ) )
inlinenoexcept

Returns the inverse square root of the given built-in value.

Parameters
aThe given built-in value $[0..\infty)$.
Returns
The inverse square root of the given value.
Note
The given value must be in the range $[0..\infty)$. The validity of the value is only checked by an user assert.

◆ isDefault() [1/2]

template<RelaxationFlag RF, typename Type , EnableIf_t< IsScalar_v< Type >||IsSIMDPack_v< Type > > * = nullptr>
BLAZE_ALWAYS_INLINE bool blaze::isDefault ( const Type &  v)
noexcept

Returns whether the given value/object is in default state.

Parameters
vThe value/object to be tested for its default state.
Returns
true in case the given value/object is in its default state, false otherwise.

The isDefault shim represents an abstract interface for testing a value/object whether it is in its default state or not. In case the value/object is in its default state, the function returns true, otherwise it returns false. For integral built-in data types, the function returns true in case the current value is zero:

int i1 = 0; // isDefault( i1 ) returns true
int i2 = 1; // isDefault( i2 ) returns false

For floating point built-in data types, the function by default uses relaxed semantics and returns true in case the current value is close to zero within a certain accuracy:

double d1 = 0.0; // isDefault( d1 ) returns true
double d2 = 1E-9; // isDefault( d2 ) returns true since d2 is below 1E-8
double d3 = 1.0; // isDefault( d3 ) returns false

Optionally, it is possible to switch between relaxed semantics (blaze::relaxed) and strict semantics (blaze::strict). In case of strict semantics, for floating point built-in data types the function returns true in case the current value is exactly zero:

// isDefault<strict>( ... ) | isDefault<relaxed>( ... )
double d1 = 0.0; // true | true
double d2 = 1E-9; // false (not 0.0) | true (below 1E-8)
double d3 = 1.0; // false | false

◆ isDefault() [2/2]

template<typename Type >
BLAZE_ALWAYS_INLINE bool blaze::isDefault ( const Type &  v)
noexcept

Returns whether the given value/object is in default state.

Parameters
vThe value/object to be tested for its default state.
Returns
true in case the given value/object is in its default state, false otherwise.

The isDefault shim represents an abstract interface for testing a value/object whether it is in its default state or not. In case the value/object is in its default state, the function returns true, otherwise it returns false. For integral built-in data types, the function returns true in case the current value is zero:

int i1 = 0; // isDefault( i1 ) returns true
int i2 = 1; // isDefault( i2 ) returns false

For floating point built-in data types, the function by default uses relaxed semantics and returns true in case the current value is close to zero within a certain accuracy:

double d1 = 0.0; // isDefault( d1 ) returns true
double d2 = 1E-9; // isDefault( d2 ) returns true since d2 is below 1E-8
double d3 = 1.0; // isDefault( d3 ) returns false

Optionally, it is possible to switch between relaxed semantics (blaze::relaxed) and strict semantics (blaze::strict). In case of strict semantics, for floating point built-in data types the function returns true in case the current value is exactly zero:

// isDefault<strict>( ... ) | isDefault<relaxed>( ... )
double d1 = 0.0; // true | true
double d2 = 1E-9; // false (not 0.0) | true (below 1E-8)
double d3 = 1.0; // false | false

◆ isDivisor()

template<typename Type , EnableIf_t< IsScalar_v< Type > > * = nullptr>
BLAZE_ALWAYS_INLINE bool blaze::isDivisor ( const Type &  v)

Returns whether the given value/object is a valid divisor.

Parameters
vThe value to be tested.
Returns
true in case the given value is a valid divisor, false otherwise.

The isDivisor shim provides an abstract interface for testing a value/object of any type whether it represents a valid divisor. In case the value/object can be used as divisor, the function returns true, otherwise it returns false.

const int i1 = 1; // isDivisor( i1 ) returns true
double d1 = 0.1; // isDivisor( d1 ) returns true
complex<double> c1( 0.2, -0.1 ); // isDivisor( c1 ) returns true
const int i2 = 0; // isDivisor( i2 ) returns false
double d2 = 0.0; // isDivisor( d2 ) returns false
complex<double> c2( 0.0, 0.0 ); // isDivisor( c2 ) returns false

◆ isfinite()

template<typename T , EnableIf_t< IsArithmetic_v< T > > * = nullptr>
bool blaze::isfinite ( a)
inlinenoexcept

Determines if the given floating point number has finite value.

Parameters
aThe floating point number to be checked.
Returns
true in case the given floating point number is finite, false otherwise.

This function determines if the given floating point number has finite value (i.e. it is normal, subnormal or zero, but not infinite or NaN).

◆ isinf()

template<typename T , EnableIf_t< IsArithmetic_v< T > > * = nullptr>
bool blaze::isinf ( a)
inlinenoexcept

Determines if the given floating point number is a positive or negative infinity.

Parameters
aThe floating point number to be checked.
Returns
true in case the given floating point number is infinity, false otherwise.

◆ isnan()

template<typename T , EnableIf_t< IsNumeric_v< T > > * = nullptr>
BLAZE_ALWAYS_INLINE bool blaze::isnan ( a)
noexcept

Platform independent implementation of the C99 isnan function.

Parameters
aValue to be checked.
Returns
true if a is not a number (NaN), false otherwise.

This function provides a platform independent check for NaN values. In contrast to the isnan function from the C standard, which is only supporting all floating point types, this function can be used for all numeric data types (i.e. all integral, floating point, and complex data types). The function returns true in case the given value is not a number (NaN). In all other cases the function returns false.

◆ isOne() [1/2]

template<typename Type >
BLAZE_ALWAYS_INLINE bool blaze::isOne ( const Type &  v)

Returns whether the given value/object represents the numeric value 1.

Parameters
vThe value to be tested.
Returns
true in case the given value is 1, false otherwise.

The isOne shim provides an abstract interface for testing a value/object of any type whether it represents the numeric value 1. In case the value/object is 1, the function returns true, otherwise it returns false:

int i1 = 0; // isZero( i1 ) returns false
int i2 = 1; // isZero( i2 ) returns true

For floating point built-in data types, the function by default uses relaxed semantics and returns true in case the current value is close to 1 within a certain accuracy:

double d1 = 0.0; // isZero( d1 ) returns false
double d2 = 1.0 + 1E-9; // isZero( d2 ) returns true
double d3 = 1.0; // isZero( d3 ) returns true
complex<double> c1( 0.0, 0.0 ); // isZero( c1 ) returns false
complex<double> c2( 1.0+1E-9, 0.0 ); // isZero( c2 ) returns true
complex<double> c3( 1.0, 0.0 ); // isZero( c3 ) returns true
complex<double> c4( 0.0, 1.0 ); // isZero( c4 ) returns false

Optionally, it is possible to switch between relaxed semantics (blaze::relaxed) and strict semantics (blaze::strict). In case of strict semantics, for floating point built-in data types the function returns true in case the current value is exactly 1:

// isOne<strict>( ... ) | isOne<relaxed>( ... )
double d1 = 0.0; // false | false
double d2 = 1.0 + 1E-9; // false (not 1.0) | true
double d3 = 1.0; // true | true
complex<double> c1( 0.0, 0.0 ); // false | false
complex<double> c2( 1.0+1E-9, 0.0 ); // false | true
complex<double> c3( 1.0, 0.0 ); // true | true
complex<double> c4( 0.0, 1.0 ); // false | false

◆ isOne() [2/2]

template<RelaxationFlag RF, typename Type , EnableIf_t< IsNumeric_v< Type > > * = nullptr>
BLAZE_ALWAYS_INLINE bool blaze::isOne ( const Type &  v)
noexcept

Returns whether the given value/object represents the numeric value 1.

Parameters
vThe value to be tested.
Returns
true in case the given value is 1, false otherwise.

The isOne shim provides an abstract interface for testing a value/object of any type whether it represents the numeric value 1. In case the value/object is 1, the function returns true, otherwise it returns false:

int i1 = 0; // isZero( i1 ) returns false
int i2 = 1; // isZero( i2 ) returns true

For floating point built-in data types, the function by default uses relaxed semantics and returns true in case the current value is close to 1 within a certain accuracy:

double d1 = 0.0; // isZero( d1 ) returns false
double d2 = 1.0 + 1E-9; // isZero( d2 ) returns true
double d3 = 1.0; // isZero( d3 ) returns true
complex<double> c1( 0.0, 0.0 ); // isZero( c1 ) returns false
complex<double> c2( 1.0+1E-9, 0.0 ); // isZero( c2 ) returns true
complex<double> c3( 1.0, 0.0 ); // isZero( c3 ) returns true
complex<double> c4( 0.0, 1.0 ); // isZero( c4 ) returns false

Optionally, it is possible to switch between relaxed semantics (blaze::relaxed) and strict semantics (blaze::strict). In case of strict semantics, for floating point built-in data types the function returns true in case the current value is exactly 1:

// isOne<strict>( ... ) | isOne<relaxed>( ... )
double d1 = 0.0; // false | false
double d2 = 1.0 + 1E-9; // false (not 1.0) | true
double d3 = 1.0; // true | true
complex<double> c1( 0.0, 0.0 ); // false | false
complex<double> c2( 1.0+1E-9, 0.0 ); // false | true
complex<double> c3( 1.0, 0.0 ); // true | true
complex<double> c4( 0.0, 1.0 ); // false | false

◆ isReal() [1/2]

template<RelaxationFlag RF, typename Type , EnableIf_t< IsScalar_v< Type > > * = nullptr>
BLAZE_ALWAYS_INLINE bool blaze::isReal ( const Type &  v)
noexcept

Returns whether the given value/object represents a real number.

Parameters
vThe value to be tested.
Returns
true in case the given value represents a real number, false otherwise.

The isReal shim provides an abstract interface for testing a value/object of any type whether it represents the a real number. In case the value/object is of built-in type, the function returns true:

int i = 1; // isReal( i ) returns true
double d = 1.0; // isReal( d ) returns true

In case the value/object is of complex type, the function returns true if the imaginary part is close to 0 (relaxed semantics):

complex<double> c1( 1.0, 0.0 ); // isReal( c1 ) returns true
complex<double> c2( 0.0, 1.0 ); // isReal( c2 ) returns false

Optionally, it is possible to switch between relaxed semantics (blaze::relaxed) and strict semantics (blaze::strict). In case of strict semantics, for complex types the function returns true in case the imaginary part is exactly zero:

// isReal<strict>( ... ) | isReal<relaxed>( ... )
complex<double> c1( 1.0, 0.0 ); // true | true
complex<double> c2( 1.0, 1E-9 ); // false | true (below 1E-8)
complex<double> c3( 0.0, 1.0 ); // false | false

For all other types the function returns false.

◆ isReal() [2/2]

template<typename Type >
BLAZE_ALWAYS_INLINE bool blaze::isReal ( const Type &  v)
noexcept

Returns whether the given value/object represents a real number.

Parameters
vThe value to be tested.
Returns
true in case the given value represents a real number, false otherwise.

The isReal shim provides an abstract interface for testing a value/object of any type whether it represents the a real number. In case the value/object is of built-in type, the function returns true. In case the value/object is of complex type, the function returns true if the imaginary part is equal to 0. Otherwise it returns false.

int i = 1; // isReal( i ) returns true
double d = 1.0; // isReal( d ) returns true
complex<double> c1( 1.0, 0.0 ); // isReal( c1 ) returns true
complex<double> c2( 0.0, 1.0 ); // isReal( c2 ) returns false
blaze::DynamicVector<int> vec; // isReal( vec ) returns false
blaze::DynamicMatrix<double> mat; // isReal( mat ) returns false
Efficient implementation of a dynamic matrix.
Definition: DynamicMatrix.h:242
Efficient implementation of an arbitrary sized vector.
Definition: DynamicVector.h:223

◆ isZero() [1/2]

template<RelaxationFlag RF, typename Type , EnableIf_t< IsScalar_v< Type > > * = nullptr>
BLAZE_ALWAYS_INLINE bool blaze::isZero ( const Type &  v)
noexcept

Returns whether the given value/object represents the numeric value 0.

Parameters
vThe value to be tested.
Returns
true in case the given value is 0, false otherwise.

The isZero shim provides an abstract interface for testing a value/object of any type whether it represents the numeric value 0. In case the value/object is 0, the function returns true, otherwise it returns false:

int i1 = 0; // isZero( i1 ) returns true
int i2 = 1; // isZero( i2 ) returns false

For floating point built-in data types, the function by default uses relaxed semantics and returns true in case the current value is close to zero within a certain accuracy:

double d1 = 0.0; // isZero( d1 ) returns true
double d2 = 1E-9; // isZero( d2 ) returns true since d2 is below 1E-8
double d3 = 1.0; // isZero( d3 ) returns false
complex<double> c1( 0.0, 0.0 ); // isZero( c1 ) returns true
complex<double> c2( 0.0, 1E-9 ); // isZero( c2 ) returns true since imag(c2) is below 1E-8
complex<double> c3( 1.0, 0.0 ); // isZero( c3 ) returns false

Optionally, it is possible to switch between relaxed semantics (blaze::relaxed) and strict semantics (blaze::strict). In case of strict semantics, for floating point built-in data types the function returns true in case the current value is exactly zero:

// isZero<strict>( ... ) | isZero<relaxed>( ... )
double d1 = 0.0; // true | true
double d2 = 1E-9; // false (not 0.0) | true (below 1E-8)
double d3 = 1.0; // false | false
complex<double> c1( 0.0, 0.0 ); // true | true
complex<double> c2( 0.0, 1E-9 ); // false | true (below 1E-8)
complex<double> c3( 1.0, 0.0 ); // false | false

◆ isZero() [2/2]

template<typename Type >
BLAZE_ALWAYS_INLINE bool blaze::isZero ( const Type &  v)
noexcept

Returns whether the given value/object represents the numeric value 0.

Parameters
vThe value to be tested.
Returns
true in case the given value is 0, false otherwise.

The isZero shim provides an abstract interface for testing a value/object of any type whether it represents the numeric value 0. In case the value/object is 0, the function returns true, otherwise it returns false:

int i1 = 0; // isZero( i1 ) returns true
int i2 = 1; // isZero( i2 ) returns false

For floating point built-in data types, the function by default uses relaxed semantics and returns true in case the current value is close to zero within a certain accuracy:

double d1 = 0.0; // isZero( d1 ) returns true
double d2 = 1E-9; // isZero( d2 ) returns true since d2 is below 1E-8
double d3 = 1.0; // isZero( d3 ) returns false
complex<double> c1( 0.0, 0.0 ); // isZero( c1 ) returns true
complex<double> c2( 0.0, 1E-9 ); // isZero( c2 ) returns true since imag(c2) is below 1E-8
complex<double> c3( 1.0, 0.0 ); // isZero( c3 ) returns false

Optionally, it is possible to switch between relaxed semantics (blaze::relaxed) and strict semantics (blaze::strict). In case of strict semantics, for floating point built-in data types the function returns true in case the current value is exactly zero:

// isZero<strict>( ... ) | isZero<relaxed>( ... )
double d1 = 0.0; // true | true
double d2 = 1E-9; // false (not 0.0) | true (below 1E-8)
double d3 = 1.0; // false | false
complex<double> c1( 0.0, 0.0 ); // true | true
complex<double> c2( 0.0, 1E-9 ); // false | true (below 1E-8)
complex<double> c3( 1.0, 0.0 ); // false | false

◆ less()

template<typename T1 , typename T2 >
BLAZE_ALWAYS_INLINE constexpr bool blaze::less ( const T1 &  a,
const T2 &  b 
)
constexprnoexcept

Generic less-than comparison.

Parameters
aFirst value.
bSecond value.
Returns
true if the first value is less than the second, false if not.

Generic less-than comparison between to numeric values. Depending on the types of the two arguments, a special comparison for floating point values is selected that takes the limited machine accuracy into account.

◆ mult()

template<typename T1 , typename T2 >
BLAZE_ALWAYS_INLINE constexpr decltype(auto) blaze::mult ( T1 &&  lhs,
T2 &&  rhs 
)
constexprnoexcept

Multiplication of the two given arguments.

Parameters
lhsThe left-hand side operand for the multiplication.
rhsThe right-hand side operand for the multiplication.
Returns
The product of the two operands.

The mult() shim represents an abstract interface for the multiplication of two operands.

◆ pow2()

template<typename T , EnableIf_t< IsScalar_v< T >||IsSIMDPack_v< T > > * = nullptr>
BLAZE_ALWAYS_INLINE constexpr decltype(auto) blaze::pow2 ( const T &  a)
constexprnoexcept

Squaring the given value/object.

Parameters
aThe value/object to be squared.
Returns
The result of the square operation.

The pow2 shim represents an abstract interface for squaring a value/object of any given data type. For values of built-in data type this results in a plain multiplication.

◆ pow3()

template<typename T , EnableIf_t< IsScalar_v< T >||IsSIMDPack_v< T > > * = nullptr>
BLAZE_ALWAYS_INLINE constexpr decltype(auto) blaze::pow3 ( const T &  a)
constexprnoexcept

Cubing the given value/object.

Parameters
aThe value/object to be cubed.
Returns
The result of the cube operation.

The pow3 shim represents an abstract interface for cubing a value/object of any given data type. For values of built-in data type this results in a plain multiplication.

◆ pow4()

template<typename T , EnableIf_t< IsScalar_v< T >||IsSIMDPack_v< T > > * = nullptr>
BLAZE_ALWAYS_INLINE constexpr decltype(auto) blaze::pow4 ( const T &  a)
constexprnoexcept

Quadruple the given value/object.

Parameters
aThe value/object to be quadrupled.
Returns
The result of the quadruple operation.

The pow4 shim represents an abstract interface for quadrupling a value/object of any given data type. For values of built-in data type this results in a plain multiplication.

◆ qdrt()

template<typename T >
BLAZE_ALWAYS_INLINE decltype(auto) blaze::qdrt ( const T &  a)

Computing the quad root (4th root) of the given value/object.

Parameters
aThe value/object for the computation.
Returns
The quad root (4th root) of the given value/object.

The qdrt shim represents an abstract interface for computing the quad root (i.e. 4th root) of a value/object of any given data type.

◆ reset()

template<typename T , EnableIf_t< IsScalar_v< T >||IsSIMDPack_v< T > > * = nullptr>
BLAZE_ALWAYS_INLINE constexpr void blaze::reset ( T &  resettable)
constexpr

Resetting the given value/object to the default value.

Parameters
resettableThe value/object to be resetted.
Returns
void

The reset shim represents an abstract interface for the resetting of a value/object of any given data type to its default value. Values of built-in data type are reset to zero.

◆ serial()

template<typename T >
BLAZE_ALWAYS_INLINE constexpr EnableIf_t< IsBuiltin_v< T >||IsComplex_v< T >, const T & > blaze::serial ( const T &  a)
constexprnoexcept

Formal serialization of the evaluation of the given argument.

Parameters
aThe value/object to be evaluated serially.
Returns
The serialized operation.

The serial shim represents an abstract interface for the serialization of the evaluation of a value/object of any given data type. For data types that are per default evaluated serially, as for instance built-in data types, the default behavior is not changed.

◆ sign() [1/4]

constexpr double blaze::sign ( double  a)
constexprnoexcept

Evaluating the sign of the given double precision value.

Parameters
aThe given double precision value.
Returns
1 if the value is greater than zero, 0 if it is zero, and -1 if it is less than zero.

The sign function evaluates the sign of the given double precision value a. It returns 1.0 if a is greater than zero, 0.0 if a is zero, -1.0 if a is less than zero, and NaN if a is NaN.

◆ sign() [2/4]

constexpr float blaze::sign ( float  a)
constexprnoexcept

Evaluating the sign of the given single precision value.

Parameters
aThe given single precision value.
Returns
1 if the value is greater than zero, 0 if it is zero, and -1 if it is less than zero.

The sign function evaluates the sign of the given single precision value a. It returns 1.0 if a is greater than zero, 0.0 if a is zero, -1.0 if a is less than zero, and NaN if a is NaN.

◆ sign() [3/4]

constexpr long double blaze::sign ( long double  a)
constexprnoexcept

Evaluating the sign of the given extended precision value.

Parameters
aThe given extended precision value.
Returns
1 if the value is greater than zero, 0 if it is zero, and -1 if it is less than zero.

The sign function evaluates the sign of the given extended precision value a. It returns 1.0 if a is greater than zero, 0.0 if a is zero, -1.0 if a is less than zero, and NaN if a is NaN.

◆ sign() [4/4]

template<typename T , typename = EnableIf_t< IsIntegral_v<T> >>
constexpr T blaze::sign ( a)
constexprnoexcept

Evaluating the sign of the given value.

Parameters
aThe given value.
Returns
1 if the value is greater than zero, 0 if it is zero, and -1 if it is less than zero.

The sign function evaluates the sign of the given value a of the built-in data type T. It returns 1 if a is greater than zero, 0 if a is zero, and -1 if a is less than zero.

◆ sub()

template<typename T1 , typename T2 >
BLAZE_ALWAYS_INLINE constexpr decltype(auto) blaze::sub ( T1 &&  lhs,
T2 &&  rhs 
)
constexprnoexcept

Subtraction of the two given arguments.

Parameters
lhsThe left-hand side operand for the subtraction.
rhsThe right-hand side operand for the subtraction.
Returns
The difference of the two operands.

The sub() shim represents an abstract interface for the subtraction of two operands.