Blaze 3.9
Modules | Classes | Macros | Typedefs | Functions
Utility module

Modules

 Algorithms
 
 Assertions
 
 Compile time constraints
 
 Meta-Programming Language
 
 Random number generation
 
 Serialization
 
 Singleton
 
 Thread parallelization
 
 Time measurement
 
 Type lists
 
 Type traits
 
 Value traits
 

Classes

class  blaze::AlignedAllocator< T >
 Allocator for type-specific aligned memory. More...
 
class  blaze::AlignedArray< Type, N, Alignment >
 Implementation of a static array with a fixed alignment. More...
 
struct  blaze::EmptyType
 Empty data type for utility purposes. More...
 
struct  blaze::EnableIf< Condition, T >
 Substitution Failure Is Not An Error (SFINAE) class. More...
 
class  blaze::FunctionTrace
 RAII object for function tracing. More...
 
struct  blaze::IntegralConstant< T, N >
 Generic wrapper for a compile time constant integral value. More...
 
struct  blaze::Limits< Type >
 Numerical limits of built-in data types. More...
 
class  blaze::MemoryPool< Type, Blocksize >
 Memory pool for small objects. More...
 
class  blaze::NonCopyable
 Base class for non-copyable class instances. More...
 
class  blaze::NonCreatable
 Base class for non-creatable (static) classes. More...
 
class  blaze::NullAllocator< T >
 Allocator returning nullptr. More...
 
class  blaze::NullType
 Utility type for generic codes. More...
 
struct  blaze::ArrayDelete
 Array-delete policy class. More...
 
struct  blaze::Deallocate
 Deallocate policy class. More...
 
struct  blaze::DefaultDelete< Type >
 Default C++ deletion policy class. More...
 
struct  blaze::NoDelete
 No-delete policy class. More...
 
struct  blaze::PtrDelete
 Pointer-delete policy class. More...
 
class  blaze::SmallArray< T, N, A >
 Implementation of a dynamic array with small array optimization. More...
 
struct  blaze::fortran_complex8
 Type of single precision complex numbers within a Fortran forward declaration. More...
 
struct  blaze::fortran_complex16
 Type of double precision complex numbers within a Fortran forward declaration. More...
 
class  blaze::UnsignedValue< T >
 Implementation of a wrapper for built-in unsigned integral values. More...
 
class  complex
 Complex data type of the Blaze library. More...
 
class  initializer_list
 Initializer list type of the Blaze library. More...
 
class  integer_sequence
 Integer sequence type of the Blaze library. More...
 
class  index_sequence
 Index sequence type of the Blaze library. More...
 
class  make_integer_sequence
 Import of the std::make_integer_sequence alias template into the Blaze namespace. More...
 
class  make_index_sequence
 Import of the std::make_index_sequence alias template into the Blaze namespace. More...
 
class  size_t
 Size type of the Blaze library. More...
 
class  ptrdiff_t
 Pointer difference type of the Blaze library. More...
 
class  int8_t
 8-bit signed integer type of the Blaze library. More...
 
class  uint8_t
 8-bit unsigned integer type of the Blaze library. More...
 
class  int16_t
 16-bit signed integer type of the Blaze library. More...
 
class  uint16_t
 16-bit unsigned integer type of the Blaze library. More...
 
class  int32_t
 32-bit signed integer type of the Blaze library. More...
 
class  uint32_t
 32-bit unsigned integer type of the Blaze library. More...
 
class  int64_t
 64-bit signed integer type of the Blaze library. More...
 
class  uint64_t
 64-bit unsigned integer type of the Blaze library. More...
 

Macros

#define BLAZE_THROW(EXCEPTION)   throw EXCEPTION
 Macro for the error reporting mechanism of the Blaze library. More...
 
#define BLAZE_THROW_BAD_ALLOC   BLAZE_THROW( std::bad_alloc() )
 Macro for the emission of a std::bad_alloc exception. More...
 
#define BLAZE_THROW_LOGIC_ERROR(MESSAGE)   BLAZE_THROW( std::logic_error( MESSAGE ) )
 Macro for the emission of a std::logic_error exception. More...
 
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)   BLAZE_THROW( std::invalid_argument( MESSAGE ) )
 Macro for the emission of a std::invalid_argument exception. More...
 
#define BLAZE_THROW_LENGTH_ERROR(MESSAGE)   BLAZE_THROW( std::length_error( MESSAGE ) )
 Macro for the emission of a std::length_error exception. More...
 
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)   BLAZE_THROW( std::out_of_range( MESSAGE ) )
 Macro for the emission of a std::out_of_range exception. More...
 
#define BLAZE_THROW_RUNTIME_ERROR(MESSAGE)   BLAZE_THROW( std::runtime_error( MESSAGE ) )
 Macro for the emission of a std::runtime_error exception. More...
 
#define BLAZE_THROW_OVERFLOW_ERROR(MESSAGE)   BLAZE_THROW( std::overflow_error( MESSAGE ) )
 Macro for the emission of a std::overflow_error exception. More...
 
#define BLAZE_THROW_UNDERFLOW_ERROR(MESSAGE)   BLAZE_THROW( std::underflow_error( MESSAGE ) )
 Macro for the emission of a std::underflow_error exception. More...
 
#define BLAZE_FUNCTION_TRACE
 Function trace macro. More...
 

Typedefs

template<bool Condition, typename T = void>
using blaze::EnableIf_t = typename EnableIf< Condition, T >::Type
 Auxiliary type for the EnableIf class template. More...
 
template<bool Condition, typename T = void>
using blaze::DisableIf = EnableIf<!Condition, T >
 Auxiliary type for the EnableIf class template. More...
 
template<bool Condition, typename T = void>
using blaze::DisableIf_t = typename EnableIf<!Condition, T >::Type
 Auxiliary type for the EnableIf class template. More...
 
template<size_t Offset, size_t N>
using blaze::make_shifted_index_sequence = decltype(shift< Offset >(make_index_sequence< N >()))
 Auxiliary alias declaration for the setup of shifted index sequences. More...
 
template<size_t Offset, size_t N, size_t ... Is>
using blaze::make_shifted_index_subsequence = decltype(subsequence< Is... >(shift< Offset >(make_index_sequence< N >())))
 Auxiliary alias declaration for the setup of shifted index subsequences. More...
 
template<bool B>
using blaze::BoolConstant = IntegralConstant< bool, B >
 Generic wrapper for a compile time constant boolean value. More...
 
using blaze::FalseType = BoolConstant< false >
 Type/value traits base class. More...
 
using blaze::TrueType = BoolConstant< true >
 Type traits base class. More...
 
template<bool B>
using blaze::Bool_t = IntegralConstant< bool, B >
 Compile time integral constant wrapper for bool. More...
 
template<char N>
using blaze::Char_t = IntegralConstant< char, N >
 Compile time integral constant wrapper for char. More...
 
template<int N>
using blaze::Int_t = IntegralConstant< int, N >
 Compile time integral constant wrapper for int. More...
 
template<long N>
using blaze::Long_t = IntegralConstant< long, N >
 Compile time integral constant wrapper for long. More...
 
template<ptrdiff_t N>
using blaze::Ptrdiff_t = IntegralConstant< ptrdiff_t, N >
 Compile time integral constant wrapper for ptrdiff_t. More...
 
template<size_t N>
using blaze::Size_t = IntegralConstant< size_t, N >
 Compile time integral constant wrapper for size_t. More...
 
template<bool Condition, typename T1 , typename T2 >
using blaze::If_t = typename If< Condition >::template Type< T1, T2 >
 Auxiliary alias template for the If class template. More...
 
using blaze::byte_t = unsigned char
 Byte data type of the Blaze library. More...
 
using blaze::large_t = int64_t
 The largest available signed integer data type.
 
using blaze::ularge_t = uint64_t
 The largest available unsigned integer data type.
 
using blaze::id_t = ularge_t
 Unsigned integer data type for integral IDs.
 
using blaze::fortran_charlen_t = size_t
 Type of the hidden arguments of character type within a Fortran forward declaration.
 

Functions

template<typename T >
BLAZE_ALWAYS_INLINE bool blaze::checkAlignment (const T *address)
 Checks the alignment of the given address. More...
 
template<typename T >
constexpr AddConst_t< T > & blaze::as_const (T &v) noexcept
 Adding 'const' to the given lvalue. More...
 
template<typename T >
void blaze::as_const (const T &&)=delete
 Overload of the as_const() function for rvalues. More...
 
template<typename T , size_t N>
constexpr size_t blaze::dimensionof (T(&a)[N])
 Static evaluation of array dimensions. More...
 
template<size_t... I1s, size_t... I2s>
constexpr bool blaze::operator== (index_sequence< I1s... > lhs, index_sequence< I2s... > rhs) noexcept
 Equality operator for the comparison of two index sequences. More...
 
template<size_t... I1s, size_t... I2s>
constexpr bool blaze::operator!= (index_sequence< I1s... > lhs, index_sequence< I2s... > rhs) noexcept
 Inequality operator for the comparison of two index sequences. More...
 
template<bool B>
constexpr BoolConstant<!B > blaze::operator! (BoolConstant< B >) noexcept
 Logical NOT of a boolean constant. More...
 
template<bool B1, bool B2>
constexpr BoolConstant< B1 &&B2 > blaze::operator&& (BoolConstant< B1 >, BoolConstant< B2 >) noexcept
 Logical AND of two boolean constants. More...
 
template<bool B1, bool B2>
constexpr BoolConstant< B1||B2 > blaze::operator|| (BoolConstant< B1 >, BoolConstant< B2 >) noexcept
 Logical OR of two boolean constants. More...
 
template<typename... Args>
constexpr void blaze::MAYBE_UNUSED (const Args &...)
 Suppression of unused parameter warnings. More...
 
byte_tblaze::alignedAllocate (size_t size, size_t alignment)
 Aligned array allocation. More...
 
void blaze::alignedDeallocate (const void *address) noexcept
 Deallocation of aligned memory. More...
 
template<typename T , EnableIf_t< IsBuiltin_v< T > > * = nullptr>
T * blaze::allocate (size_t size)
 Aligned array allocation for built-in data types. More...
 
template<typename T , EnableIf_t< IsBuiltin_v< T > > * = nullptr>
void blaze::deallocate (T *address) noexcept
 Deallocation of memory for built-in data types. More...
 
template<typename T >
BLAZE_ALWAYS_INLINE size_t blaze::misalignment (const T *address)
 Computes the misalignment of the given address. More...
 

Checked delete operations

template<typename T >
void blaze::checkedDelete (T *ptr)
 Type-checked delete operation. More...
 
template<typename T >
void blaze::checkedArrayDelete (T *ptr)
 Type-checked delete[] operation. More...
 

Numeric cast operators

template<typename To , typename From >
To blaze::numeric_cast (From from)
 Checked conversion of values of numeric type. More...
 

Pointer cast operators

template<typename To , typename From >
To * blaze::static_pointer_cast (From *ptr)
 Static cast for pointer types. More...
 
template<typename To , typename From >
To * blaze::dynamic_pointer_cast (From *ptr)
 Dynamic cast for pointer types. More...
 
template<typename To , typename From >
To * blaze::const_pointer_cast (From *ptr)
 Const cast for pointer types. More...
 
template<typename To , typename From >
To * blaze::reinterpret_pointer_cast (From *ptr)
 Reinterpret cast for pointer types. More...
 

Smart pointer cast operators

template<typename To , template< typename > class S, typename From >
S< To > blaze::static_pointer_cast (S< From > ptr)
 Static cast for smart pointers. More...
 
template<typename To , template< typename > class S, typename From >
S< To > blaze::dynamic_pointer_cast (S< From > ptr)
 Dynamic cast for smart pointers. More...
 
template<typename To , template< typename > class S, typename From >
S< To > blaze::const_pointer_cast (S< From > ptr)
 Const cast for smart pointers. More...
 
template<typename To , template< typename > class S, typename From >
S< To > blaze::reinterpret_pointer_cast (S< From > ptr)
 Reinterpret cast for smart pointers. More...
 

SmallArray operators

template<typename T1 , size_t N1, typename A1 , typename T2 , size_t N2, typename A2 >
bool blaze::operator== (const SmallArray< T1, N1, A1 > &lhs, const SmallArray< T2, N2, A2 > &rhs)
 Equality operator for the comparison of two dense arrays. More...
 
template<typename T1 , size_t N1, typename A1 , typename T2 , size_t N2, typename A2 >
bool blaze::operator!= (const SmallArray< T1, N1, A1 > &lhs, const SmallArray< T2, N2, A2 > &rhs)
 Inequality operator for the comparison of two dense arrays. More...
 
template<typename T , size_t N, typename A >
SmallArray< T, N, A >::Iterator blaze::begin (SmallArray< T, N, A > &sa)
 Returns an iterator to the first element of the given small array. More...
 
template<typename T , size_t N, typename A >
SmallArray< T, N, A >::ConstIterator blaze::begin (const SmallArray< T, N, A > &sa)
 Returns an iterator to the first element of the given small array. More...
 
template<typename T , size_t N, typename A >
SmallArray< T, N, A >::ConstIterator blaze::cbegin (const SmallArray< T, N, A > &sa)
 Returns an iterator to the first element of the given small array. More...
 
template<typename T , size_t N, typename A >
SmallArray< T, N, A >::Iterator blaze::end (SmallArray< T, N, A > &sa)
 Returns an iterator just past the last element of the given small array. More...
 
template<typename T , size_t N, typename A >
SmallArray< T, N, A >::ConstIterator blaze::end (const SmallArray< T, N, A > &sa)
 Returns an iterator just past the last element of the given small array. More...
 
template<typename T , size_t N, typename A >
SmallArray< T, N, A >::ConstIterator blaze::cend (const SmallArray< T, N, A > &sa)
 Returns an iterator just past the last element of the given small array. More...
 
template<typename T , size_t N, typename A >
void blaze::clear (SmallArray< T, N, A > &sa)
 Clearing the given small array. More...
 
template<typename T , size_t N, typename A >
void blaze::swap (SmallArray< T, N, A > &a, SmallArray< T, N, A > &b) noexcept(IsNothrowMoveConstructible_v< T >)
 Swapping the contents of two small arrays. More...
 

Time functions

std::string blaze::getDate ()
 Creating a formated date string in the form YYYY-MM-DD. More...
 
std::string blaze::getTime ()
 Creating a formated time and date string. More...
 
double blaze::getWcTime ()
 Returns the current wall clock time in seconds. More...
 
double blaze::getCpuTime ()
 Returns the current CPU time in seconds. More...
 

Detailed Description

Macro Definition Documentation

◆ BLAZE_FUNCTION_TRACE

#define BLAZE_FUNCTION_TRACE

Function trace macro.

This macro can be used to reliably trace function calls. In case function tracing is activated, function traces are written to the console via std::cerr. The following short example demonstrates how the function trace macro is used:

int main( int argc, char** argv )
{
// ...
}
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition: FunctionTrace.h:94

The macro should be used as the very first statement inside the function in order to guarantee that writing the function trace is the very first and last action of the function call.
Function tracing can be enabled or disabled via the BLAZE_USE_FUNCTION_TRACES macro. If function tracing is activated, trace information of the following form will be written to std::cerr:

+ [Thread 0] Entering function 'int main()' in file 'TraceDemo.cpp'
- [Thread 0] Leaving function 'int main()' in file 'TraceDemo.cpp'

In case function tracing is deactivated, all function trace functionality is completely removed from the code, i.e. no function traces are logged and no overhead results from the BLAZE_FUNCTION_TRACE macro.

◆ BLAZE_THROW

#define BLAZE_THROW (   EXCEPTION)    throw EXCEPTION

Macro for the error reporting mechanism of the Blaze library.

This macro encapsulates the default, general way of the Blaze library to report errors of any kind by throwing an exception. Also, since under certain conditions and environments it may be desirable to replace exceptions by a different error reporting mechanism this macro provides an opportunity to customize the error reporting approach.

The macro excepts a single argument, which specifies the exception to be thrown:

#define BLAZE_THROW( EXCEPTION ) \
throw EXCEPTION

In order to customize the error reporing mechanism all that needs to be done is to define the macro prior to including any Blaze header file. This will cause the Blaze specific mechanism to be overridden. The following example demonstrates this by replacing exceptions by a call to a log() function and a direct call to abort:

#define BLAZE_THROW( EXCEPTION ) \
log( "..." ); \
abort()
#include <blaze/Blaze.h>
Primary include file of the Blaze library.
Note
It is possible to execute several statements instead of executing a single statement to throw an exception. Also note that it is recommended to define the macro such that a subsequent semicolon is required!
Warning
This macro is provided with the intention to assist in adapting Blaze to special conditions and environments. However, the customization of the error reporting mechanism via this macro can have a significant effect on the library. Thus be advised to use the macro with due care!

◆ BLAZE_THROW_BAD_ALLOC

#define BLAZE_THROW_BAD_ALLOC   BLAZE_THROW( std::bad_alloc() )

Macro for the emission of a std::bad_alloc exception.

This macro encapsulates the default way of Blaze to throw a std::bad_alloc exception. Also, since it may be desirable to replace the type of exception by a custom exception type this macro provides an opportunity to customize the behavior.

#define BLAZE_THROW_BAD_ALLOC \
BLAZE_THROW( std::bad_alloc() )

In order to customize the type of exception all that needs to be done is to define the macro prior to including any Blaze header file. This will override the Blaze default behavior. The following example demonstrates this by replacing std::bad_alloc by a custom exception type:

class BadAlloc
{
public:
BadAlloc();
// ...
};
#define BLAZE_THROW_BAD_ALLOC \
throw BadAlloc()
#include <blaze/Blaze.h>
Note
It is recommended to define the macro such that a subsequent semicolon is required!
Warning
This macro is provided with the intention to assist in adapting Blaze to special conditions and environments. However, the customization of the type of exception via this macro may have an effect on the library. Thus be advised to use the macro with due care!

◆ BLAZE_THROW_INVALID_ARGUMENT

#define BLAZE_THROW_INVALID_ARGUMENT (   MESSAGE)    BLAZE_THROW( std::invalid_argument( MESSAGE ) )

Macro for the emission of a std::invalid_argument exception.

This macro encapsulates the default way of Blaze to throw a std::invalid_argument exception. Also, since it may be desirable to replace the type of exception by a custom exception type this macro provides an opportunity to customize the behavior.

The macro excepts a single argument, which specifies the message of the exception:

#define BLAZE_THROW_INVALID_ARGUMENT( MESSAGE ) \
BLAZE_THROW( std::invalid_argument( MESSAGE ) )

In order to customize the type of exception all that needs to be done is to define the macro prior to including any Blaze header file. This will override the Blaze default behavior. The following example demonstrates this by replacing std::invalid_argument by a custom exception type:

class InvalidArgument
{
public:
InvalidArgument();
explicit InvalidArgument( const std::string& message );
// ...
};
#define BLAZE_THROW_INVALID_ARGUMENT( MESSAGE ) \
throw InvalidArgument( MESSAGE )
#include <blaze/Blaze.h>
Note
It is recommended to define the macro such that a subsequent semicolon is required!
Warning
This macro is provided with the intention to assist in adapting Blaze to special conditions and environments. However, the customization of the type of exception via this macro may have an effect on the library. Thus be advised to use the macro with due care!

◆ BLAZE_THROW_LENGTH_ERROR

#define BLAZE_THROW_LENGTH_ERROR (   MESSAGE)    BLAZE_THROW( std::length_error( MESSAGE ) )

Macro for the emission of a std::length_error exception.

This macro encapsulates the default way of Blaze to throw a std::length_error exception. Also, since it may be desirable to replace the type of exception by a custom exception type this macro provides an opportunity to customize the behavior.

The macro excepts a single argument, which specifies the message of the exception:

#define BLAZE_THROW_LENGTH_ERROR( MESSAGE ) \
BLAZE_THROW( std::length_error( MESSAGE ) )

In order to customize the type of exception all that needs to be done is to define the macro prior to including any Blaze header file. This will override the Blaze default behavior. The following example demonstrates this by replacing std::length_error by a custom exception type:

class LengthError
{
public:
LengthError();
explicit LengthError( const std::string& message );
// ...
};
#define BLAZE_THROW_LENGTH_ERROR( MESSAGE ) \
throw LengthError( MESSAGE )
#include <blaze/Blaze.h>
Note
It is recommended to define the macro such that a subsequent semicolon is required!
Warning
This macro is provided with the intention to assist in adapting Blaze to special conditions and environments. However, the customization of the type of exception via this macro may have an effect on the library. Thus be advised to use the macro with due care!

◆ BLAZE_THROW_LOGIC_ERROR

#define BLAZE_THROW_LOGIC_ERROR (   MESSAGE)    BLAZE_THROW( std::logic_error( MESSAGE ) )

Macro for the emission of a std::logic_error exception.

This macro encapsulates the default way of Blaze to throw a std::logic_error exception. Also, since it may be desirable to replace the type of exception by a custom exception type this macro provides an opportunity to customize the behavior.

The macro excepts a single argument, which specifies the message of the exception:

#define BLAZE_THROW_LOGIC_ERROR( MESSAGE ) \
BLAZE_THROW( std::logic_error( MESSAGE ) )

In order to customize the type of exception all that needs to be done is to define the macro prior to including any Blaze header file. This will override the Blaze default behavior. The following example demonstrates this by replacing std::logic_error by a custom exception type:

class LogicError
{
public:
LogicError();
explicit LogicError( const std::string& message );
// ...
};
#define BLAZE_THROW_LOGIC_ERROR( MESSAGE ) \
throw LogicError( MESSAGE )
#include <blaze/Blaze.h>
Note
It is recommended to define the macro such that a subsequent semicolon is required!
Warning
This macro is provided with the intention to assist in adapting Blaze to special conditions and environments. However, the customization of the type of exception via this macro may have an effect on the library. Thus be advised to use the macro with due care!

◆ BLAZE_THROW_OUT_OF_RANGE

#define BLAZE_THROW_OUT_OF_RANGE (   MESSAGE)    BLAZE_THROW( std::out_of_range( MESSAGE ) )

Macro for the emission of a std::out_of_range exception.

This macro encapsulates the default way of Blaze to throw a std::out_of_range exception. Also, since it may be desirable to replace the type of exception by a custom exception type this macro provides an opportunity to customize the behavior.

The macro excepts a single argument, which specifies the message of the exception:

#define BLAZE_THROW_OUT_OF_RANGE( MESSAGE ) \
BLAZE_THROW( std::out_of_range( MESSAGE ) )

In order to customize the type of exception all that needs to be done is to define the macro prior to including any Blaze header file. This will override the Blaze default behavior. The following example demonstrates this by replacing std::out_of_range by a custom exception type:

class OutOfRange
{
public:
OutOfRange();
explicit OutOfRange( const std::string& message );
// ...
};
#define BLAZE_THROW_OUT_OF_RANGE( MESSAGE ) \
throw OutOfRange( MESSAGE )
#include <blaze/Blaze.h>
Note
It is recommended to define the macro such that a subsequent semicolon is required!
Warning
This macro is provided with the intention to assist in adapting Blaze to special conditions and environments. However, the customization of the type of exception via this macro may have an effect on the library. Thus be advised to use the macro with due care!

◆ BLAZE_THROW_OVERFLOW_ERROR

#define BLAZE_THROW_OVERFLOW_ERROR (   MESSAGE)    BLAZE_THROW( std::overflow_error( MESSAGE ) )

Macro for the emission of a std::overflow_error exception.

This macro encapsulates the default way of Blaze to throw a std::overflow_error exception. Also, since it may be desirable to replace the type of exception by a custom exception type this macro provides an opportunity to customize the behavior.

The macro excepts a single argument, which specifies the message of the exception:

#define BLAZE_THROW_OVERFLOW_ERROR( MESSAGE ) \
BLAZE_THROW( std::overflow_error( MESSAGE ) )

In order to customize the type of exception all that needs to be done is to define the macro prior to including any Blaze header file. This will override the Blaze default behavior. The following example demonstrates this by replacing std::overflow_error by a custom exception type:

class OverflowError
{
public:
OverflowError();
explicit OverflowError( const std::string& message );
// ...
};
#define BLAZE_THROW_OVERFLOW_ERROR( MESSAGE ) \
throw OverflowError( MESSAGE )
#include <blaze/Blaze.h>
Note
It is recommended to define the macro such that a subsequent semicolon is required!
Warning
This macro is provided with the intention to assist in adapting Blaze to special conditions and environments. However, the customization of the type of exception via this macro may have an effect on the library. Thus be advised to use the macro with due care!

◆ BLAZE_THROW_RUNTIME_ERROR

#define BLAZE_THROW_RUNTIME_ERROR (   MESSAGE)    BLAZE_THROW( std::runtime_error( MESSAGE ) )

Macro for the emission of a std::runtime_error exception.

This macro encapsulates the default way of Blaze to throw a std::runtime_error exception. Also, since it may be desirable to replace the type of exception by a custom exception type this macro provides an opportunity to customize the behavior.

The macro excepts a single argument, which specifies the message of the exception:

#define BLAZE_THROW_RUNTIME_ERROR( MESSAGE ) \
BLAZE_THROW( std::runtime_error( MESSAGE ) )

In order to customize the type of exception all that needs to be done is to define the macro prior to including any Blaze header file. This will override the Blaze default behavior. The following example demonstrates this by replacing std::runtime_error by a custom exception type:

class RuntimeError
{
public:
RuntimeError();
explicit RuntimeError( const std::string& message );
// ...
};
#define BLAZE_THROW_RUNTIME_ERROR( MESSAGE ) \
throw RuntimeError( MESSAGE )
#include <blaze/Blaze.h>
Note
It is recommended to define the macro such that a subsequent semicolon is required!
Warning
This macro is provided with the intention to assist in adapting Blaze to special conditions and environments. However, the customization of the type of exception via this macro may have an effect on the library. Thus be advised to use the macro with due care!

◆ BLAZE_THROW_UNDERFLOW_ERROR

#define BLAZE_THROW_UNDERFLOW_ERROR (   MESSAGE)    BLAZE_THROW( std::underflow_error( MESSAGE ) )

Macro for the emission of a std::underflow_error exception.

This macro encapsulates the default way of Blaze to throw a std::underflow_error exception. Also, since it may be desirable to replace the type of exception by a custom exception type this macro provides an opportunity to customize the behavior.

The macro excepts a single argument, which specifies the message of the exception:

#define BLAZE_THROW_UNDERFLOW_ERROR( MESSAGE ) \
BLAZE_THROW( std::underflow_error( MESSAGE ) )

In order to customize the type of exception all that needs to be done is to define the macro prior to including any Blaze header file. This will override the Blaze default behavior. The following example demonstrates this by replacing std::underflow_error by a custom exception type:

class UnderflowError
{
public:
UnderflowError();
explicit UnderflowError( const std::string& message );
// ...
};
#define BLAZE_THROW_UNDERFLOW_ERROR( MESSAGE ) \
throw UnderflowError( MESSAGE )
#include <blaze/Blaze.h>
Note
It is recommended to define the macro such that a subsequent semicolon is required!
Warning
This macro is provided with the intention to assist in adapting Blaze to special conditions and environments. However, the customization of the type of exception via this macro may have an effect on the library. Thus be advised to use the macro with due care!

Typedef Documentation

◆ Bool_t

template<bool B>
using blaze::Bool_t = typedef IntegralConstant<bool,B>

Compile time integral constant wrapper for bool.

The Bool_t alias template represents an integral wrapper for a compile time constant expression of type bool. The value of a Bool_t can be accessed via the nested value (which is guaranteed to be of type bool), the type can be accessed via the nested type definition ValueType.

using namespace blaze;
Bool_t<true>::value // Evaluates to true
Bool_t<false>::ValueType // Results in bool
Generic wrapper for a compile time constant integral value.
Definition: IntegralConstant.h:74

◆ BoolConstant

template<bool B>
using blaze::BoolConstant = typedef IntegralConstant<bool,B>

Generic wrapper for a compile time constant boolean value.

The BoolConstant alias template represents a generic wrapper for a compile time constant boolean value. The value of a BoolConstant can be accessed via the nested value (which is guaranteed to be of type bool), the type can be accessed via the nested type definition ValueType.

using namespace blaze;
BoolConstant<true>::value // Evaluates to true

◆ byte_t

using blaze::byte_t = typedef unsigned char

Byte data type of the Blaze library.

The byte data type is guaranteed to be an integral data type of size 1.

◆ Char_t

template<char N>
using blaze::Char_t = typedef IntegralConstant<char,N>

Compile time integral constant wrapper for char.

The Char_t alias template represents an integral wrapper for a compile time constant expression of type char. The value of an Char_t can be accessed via the nested value (which is guaranteed to be of type char), the type can be accessed via the nested type definition ValueType.

using namespace blaze;
Char_t<3>::value // Evaluates to 3
Char_t<5>::ValueType // Results in char

◆ DisableIf

template<bool Condition, typename T = void>
using blaze::DisableIf = typedef EnableIf<!Condition,T>

Auxiliary type for the EnableIf class template.

The DisableIf alias declaration provides a convenient shortcut for negated SFINAE conditions. For instance, given the type T the following two type definitions are identical:

using Type1 = typename EnableIf< !IsBuiltin_v<T> >::Type;
using Type2 = typename DisableIf< IsBuiltin_v<T> >::Type;
Substitution Failure Is Not An Error (SFINAE) class.
Definition: EnableIf.h:97

◆ DisableIf_t

template<bool Condition, typename T = void>
using blaze::DisableIf_t = typedef typename EnableIf<!Condition,T>::Type

Auxiliary type for the EnableIf class template.

The DisableIf_t alias declaration provides a convenient shortcut to access the nested Type of the negated EnableIf class template. For instance, given the type T the following two type definitions are identical:

using Type1 = typename EnableIf< !IsBuiltin_v<T> >::Type;
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:175

◆ EnableIf_t

template<bool Condition, typename T = void>
using blaze::EnableIf_t = typedef typename EnableIf<Condition,T>::Type

Auxiliary type for the EnableIf class template.

The EnableIf_t alias declaration provides a convenient shortcut to access the nested Type of the EnableIf class template. For instance, given the type T the following two type definitions are identical:

using Type1 = typename EnableIf< IsBuiltin_v<T> >::Type;
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138

◆ FalseType

using blaze::FalseType = typedef BoolConstant<false>

Type/value traits base class.

The FalseType class is used as base class for type traits and value traits that evaluate to false.

◆ If_t

template<bool Condition, typename T1 , typename T2 >
using blaze::If_t = typedef typename If<Condition>::template Type<T1,T2>

Auxiliary alias template for the If class template.

The If_t alias template provides a convenient shortcut to access the nested Type of the If class template. For instance, given the types C, T1, and T2 the following two type definitions are identical:

using Type1 = typename If< IsBuiltin_v<C>, T1, T2 >::Type;
using Type2 = If_t< IsBuiltin_v<C>, T1, T2 >;
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition: If.h:108
Compile time type selection.
Definition: If.h:58

◆ Int_t

template<int N>
using blaze::Int_t = typedef IntegralConstant<int,N>

Compile time integral constant wrapper for int.

The Int_t alias template represents an integral wrapper for a compile time constant expression of type int. The value of an Int_t can be accessed via the nested value (which is guaranteed to be of type int), the type can be accessed via the nested type definition ValueType.

using namespace blaze;
Int_t<3>::value // Evaluates to 3
Int_t<5>::ValueType // Results in int

◆ Long_t

template<long N>
using blaze::Long_t = typedef IntegralConstant<long,N>

Compile time integral constant wrapper for long.

The Long_t alias template represents an integral wrapper for a compile time constant expression of type long. The value of an Long_t can be accessed via the nested value (which is guaranteed to be of type long), the type can be accessed via the nested type definition ValueType.

using namespace blaze;
Long_t<3>::value // Evaluates to 3
Long_t<5>::ValueType // Results in long

◆ make_shifted_index_sequence

template<size_t Offset, size_t N>
using blaze::make_shifted_index_sequence = typedef decltype( shift<Offset>( make_index_sequence<N>() ) )

Auxiliary alias declaration for the setup of shifted index sequences.

The make_shifted_index_sequence alias template provides a convenient way to create index sequences with specific initial index and a specific number of indices. The following code example demonstrates the use of make_shifted_index_sequence:

// Creating the index sequence <2,3,4,5,6>
decltype(shift< Offset >(make_index_sequence< N >())) make_shifted_index_sequence
Auxiliary alias declaration for the setup of shifted index sequences.
Definition: IntegerSequence.h:227

◆ make_shifted_index_subsequence

template<size_t Offset, size_t N, size_t ... Is>
using blaze::make_shifted_index_subsequence = typedef decltype( subsequence<Is...>( shift<Offset>( make_index_sequence<N>() ) ) )

Auxiliary alias declaration for the setup of shifted index subsequences.

The make_shifted_index_subsequence alias template provides a convenient way to create a subsequence of an index sequences with specific initial index and a specific number of indices. The following code example demonstrates the use of make_shifted_index_subsequence:

// Creating the subsequence <3,6,8> from the index sequence <2,3,4,5,6,7,8>
decltype(subsequence< Is... >(shift< Offset >(make_index_sequence< N >()))) make_shifted_index_subsequence
Auxiliary alias declaration for the setup of shifted index subsequences.
Definition: IntegerSequence.h:248

◆ Ptrdiff_t

template<ptrdiff_t N>
using blaze::Ptrdiff_t = typedef IntegralConstant<ptrdiff_t,N>

Compile time integral constant wrapper for ptrdiff_t.

The Ptrdiff_t alias template represents an integral wrapper for a compile time constant expression of type ptrdiff_t. The value of an Ptrdiff_t can be accessed via the nested value (which is guaranteed to be of type ptrdiff_t), the type can be accessed via the nested type definition ValueType.

using namespace blaze;
Ptrdiff_t<3>::value // Evaluates to 3
Ptrdiff_t<5>::ValueType // Results in ptrdiff_t

◆ Size_t

template<size_t N>
using blaze::Size_t = typedef IntegralConstant<size_t,N>

Compile time integral constant wrapper for size_t.

The Size_t alias template represents an integral wrapper for a compile time constant expression of type size_t. The value of an Size_t can be accessed via the nested value (which is guaranteed to be of type size_t), the type can be accessed via the nested type definition ValueType.

using namespace blaze;
Size_t<3>::value // Evaluates to 3
Size_t<5>::ValueType // Results in size_t

◆ TrueType

using blaze::TrueType = typedef BoolConstant<true>

Type traits base class.

The TrueType class is used as base class for type traits and value traits that evaluate to true.

Function Documentation

◆ alignedAllocate()

byte_t * blaze::alignedAllocate ( size_t  size,
size_t  alignment 
)
inline

Aligned array allocation.

Parameters
sizeThe number of bytes to be allocated.
alignmentThe required minimum alignment.
Returns
Byte pointer to the first element of the aligned array.
Exceptions
std::bad_allocAllocation failed.

This function provides the functionality to allocate memory based on the given alignment restrictions. For that purpose it uses the according system-specific memory allocation functions.

◆ alignedDeallocate()

void blaze::alignedDeallocate ( const void *  address)
inlinenoexcept

Deallocation of aligned memory.

Parameters
addressThe address of the first element of the array to be deallocated.
Returns
void

This function deallocates the given memory that was previously allocated via the alignedAllocate() function. For that purpose it uses the according system-specific memory deallocation functions.

◆ allocate()

template<typename T , EnableIf_t< IsBuiltin_v< T > > * = nullptr>
T * blaze::allocate ( size_t  size)

Aligned array allocation for built-in data types.

Aligned array allocation for user-specific class types.

Parameters
sizeThe number of elements of the given type to allocate.
Returns
Pointer to the first element of the aligned array.
Exceptions
std::bad_allocAllocation failed.

The allocate() function provides the functionality to allocate memory based on the alignment restrictions of the given built-in data type. For instance, in case SSE vectorization is possible, the returned memory is guaranteed to be at least 16-byte aligned. In case AVX is active, the memory is even guaranteed to be at least 32-byte aligned.

Examples:

// Guaranteed to be 16-byte aligned (32-byte aligned in case AVX is used)
double* dp = allocate<double>( 10UL );
Parameters
sizeThe number of elements of the given type to allocate.
Returns
Pointer to the first element of the aligned array.
Exceptions
std::bad_allocAllocation failed.

The allocate() function provides the functionality to allocate memory based on the alignment restrictions of the given user-specific class type. For instance, in case the given type has the requirement to be 32-byte aligned, the returned pointer is guaranteed to be 32-byte aligned. Additionally, all elements of the array are guaranteed to be default constructed. Note that the allocate() function provides exception safety similar to the new operator: In case any element throws an exception during construction, all elements that have already been constructed are destroyed in reverse order and the allocated memory is deallocated again.

◆ as_const() [1/2]

template<typename T >
void blaze::as_const ( const T &&  )
delete

Overload of the as_const() function for rvalues.

This overload of the as_const() function disables its use on rvalues. This prevents potential misuse as in for instance the following example:

for( const auto&& value : as_const( getTemporary() ) )
{
// ...
}
constexpr AddConst_t< T > & as_const(T &v) noexcept
Adding 'const' to the given lvalue.
Definition: AsConst.h:64

◆ as_const() [2/2]

template<typename T >
constexpr AddConst_t< T > & blaze::as_const ( T &  v)
constexprnoexcept

Adding 'const' to the given lvalue.

Parameters
vThe given lvalue.
Returns
The const-qualified lvalue.

This function adds the 'const' qualifier to the given lvalue.

◆ begin() [1/2]

template<typename T , size_t N, typename A >
SmallArray< T, N, A >::ConstIterator blaze::begin ( const SmallArray< T, N, A > &  sa)
inline

Returns an iterator to the first element of the given small array.

Parameters
saThe given small array.
Returns
Iterator to the first element of the given small array.

◆ begin() [2/2]

template<typename T , size_t N, typename A >
SmallArray< T, N, A >::Iterator blaze::begin ( SmallArray< T, N, A > &  sa)
inline

Returns an iterator to the first element of the given small array.

Parameters
saThe given small array.
Returns
Iterator to the first element of the given small array.

◆ cbegin()

template<typename T , size_t N, typename A >
SmallArray< T, N, A >::ConstIterator blaze::cbegin ( const SmallArray< T, N, A > &  sa)
inline

Returns an iterator to the first element of the given small array.

Parameters
saThe given small array.
Returns
Iterator to the first element of the given small array.

◆ cend()

template<typename T , size_t N, typename A >
SmallArray< T, N, A >::ConstIterator blaze::cend ( const SmallArray< T, N, A > &  sa)
inline

Returns an iterator just past the last element of the given small array.

Parameters
saThe given small array.
Returns
Iterator just past the last element of the given small array.

◆ checkAlignment()

template<typename T >
BLAZE_ALWAYS_INLINE bool blaze::checkAlignment ( const T *  address)

Checks the alignment of the given address.

Parameters
addressThe address to be checked.
Returns
true in case the address is properly aligned, false if it is not.

This function performs an alignment check on the given address. For instance, for fundamental data types that can be vectorized via SSE or AVX instructions, the proper alignment is 16 or 32 bytes, respectively. In case the given address is properly aligned, the function returns true, otherwise it returns false.

◆ checkedArrayDelete()

template<typename T >
void blaze::checkedArrayDelete ( T *  ptr)

Type-checked delete[] operation.

Parameters
ptrThe pointer to the array to be deleted.
Returns
void

This function frees the given pointer resource via delete[]. Note that the delete[] operation is NOT permitted for incomplete types (i.e. declared but undefined data types). The attempt to use this function for a pointer to an array of objects of incomplete type results in a compile time error!

◆ checkedDelete()

template<typename T >
void blaze::checkedDelete ( T *  ptr)

Type-checked delete operation.

Parameters
ptrThe pointer to be deleted.
Returns
void

This function frees the given pointer resource via delete. Note that the delete operation is NOT permitted for incomplete types (i.e. declared but undefined data types). The attempt to use this function for a pointer to an object of incomplete type results in a compile time error!

◆ clear()

template<typename T , size_t N, typename A >
void blaze::clear ( SmallArray< T, N, A > &  sa)
inline

Clearing the given small array.

Parameters
saThe small array to be cleared.
Returns
void

◆ const_pointer_cast() [1/2]

template<typename To , typename From >
To * blaze::const_pointer_cast ( From *  ptr)
inline

Const cast for pointer types.

Parameters
ptrThe pointer to be cast.
Returns
The casted value.

The const_pointer_cast function is used exactly as the built-in const_cast operator but for pointer types.

class A { ... };
const A* a1; // Pointer to a constant A object
A* a2 = const_pointer_cast<A>( a1 ); // Const cast to a pointer to a non-constant A object

◆ const_pointer_cast() [2/2]

template<typename To , template< typename > class S, typename From >
S< To > blaze::const_pointer_cast ( S< From >  ptr)
inline

Const cast for smart pointers.

Parameters
ptrThe smart pointer to be cast.
Returns
The casted smart pointer.

The const_pointer_cast function is used exactly as the built-in const_cast operator but for smart pointers.

class A { ... };
using APtr = SharedPtr<A>;
using ConstAPtr = SharedPtr<const A>;
ConstAPtr a1; // Smart pointer to a constant A object
APtr a2 = const_pointer_cast<A>( a1 ); // Const cast to a smart pointer to a non-constant A object

◆ deallocate()

template<typename T , EnableIf_t< IsBuiltin_v< T > > * = nullptr>
void blaze::deallocate ( T *  address)
noexcept

Deallocation of memory for built-in data types.

Deallocation of memory for user-specific class types.

Parameters
addressThe address of the first element of the array to be deallocated.
Returns
void

This function deallocates the given memory that was previously allocated via the allocate() function.

◆ dimensionof()

template<typename T , size_t N>
constexpr size_t blaze::dimensionof ( T(&)  a[N])
constexpr

Static evaluation of array dimensions.

Parameters
aReference to a static array of type T and size N.
Returns
Dimension of the static array.

The dimensionof function is a safe way to evaluate the size of an array. The function only works for array arguments and fails for pointers and user-defined class types.

int ai[ 42 ];
int* pi( ai );
std::vector<int> vi( 42 );
dimensionof( ai ); // Returns the size of the integer array (42)
dimensionof( pi ); // Fails to compile!
dimensionof( vi ); // Fails to compile!
constexpr size_t dimensionof(T(&a)[N])
Static evaluation of array dimensions.
Definition: DimensionOf.h:76

◆ dynamic_pointer_cast() [1/2]

template<typename To , typename From >
To * blaze::dynamic_pointer_cast ( From *  ptr)
inline

Dynamic cast for pointer types.

Parameters
ptrThe pointer to be cast.
Returns
The casted value.

The dynamic_pointer_cast function is used exactly as the built-in dynamic_cast operator but for pointer types. As in case with the built-in dynamic_cast 0 is returned if the runtime type conversion doesn't succeed.

class B { ... };
class D : public B { ... };
B* b = ...; // Base pointer
D* d = dynamic_pointer_cast<D>( b ); // Dynamic down-cast

◆ dynamic_pointer_cast() [2/2]

template<typename To , template< typename > class S, typename From >
S< To > blaze::dynamic_pointer_cast ( S< From >  ptr)
inline

Dynamic cast for smart pointers.

Parameters
ptrThe smart pointer to be cast.
Returns
The casted smart pointer.

The dynamic_pointer_cast function is used exactly as the built-in dynamic_cast operator but for smart pointers. As in case with the built-in dynamic_cast 0 is returned if the runtime type conversion doesn't succeed.

class B { ... };
class D : public B { ... };
using BPtr = SharedPtr<B>;
using DPtr = SharedPtr<D>;
BPtr b = ...; // Base smart pointer
DPtr d = dynamic_pointer_cast<D>( b ); // Dynamic down-cast

◆ end() [1/2]

template<typename T , size_t N, typename A >
SmallArray< T, N, A >::ConstIterator blaze::end ( const SmallArray< T, N, A > &  sa)
inline

Returns an iterator just past the last element of the given small array.

Parameters
saThe given small array.
Returns
Iterator just past the last element of the given small array.

◆ end() [2/2]

template<typename T , size_t N, typename A >
SmallArray< T, N, A >::Iterator blaze::end ( SmallArray< T, N, A > &  sa)
inline

Returns an iterator just past the last element of the given small array.

Parameters
saThe given small array.
Returns
Iterator just past the last element of the given small array.

◆ getCpuTime()

double blaze::getCpuTime ( )
inline

Returns the current CPU time in seconds.

Returns
The current CPU time in seconds.

◆ getDate()

std::string blaze::getDate ( )
inline

Creating a formated date string in the form YYYY-MM-DD.

Returns
Formated date string

◆ getTime()

std::string blaze::getTime ( )
inline

Creating a formated time and date string.

Returns
Formated time and date string in the format WEEKDAY DAY.MONTH YEAR, HOUR:MINUTES

◆ getWcTime()

double blaze::getWcTime ( )
inline

Returns the current wall clock time in seconds.

Returns
The current wall clock time in seconds.

◆ MAYBE_UNUSED()

template<typename... Args>
constexpr void blaze::MAYBE_UNUSED ( const Args &  ...)
constexpr

Suppression of unused parameter warnings.

Returns
void

The MAYBE_UNUSED function provides the functionality to suppress warnings about any number of unused parameters. Usually this problem occurs in case a parameter is given a name but is not used within the function:

void f( int x )
{} // x is not used within f. This may result in an unused parameter warning.

A possible solution is to keep the parameter unnamed:

void f( int )
{} // No warning about unused parameter is issued

However, there are situations where is approach is not possible, as for instance in case the variable must be documented via Doxygen. For these cases, the MAYBE_UNUSED class can be used to suppress the warnings:

void f( int x )
{
MAYBE_UNUSED( x ); // Suppresses the unused parameter warnings
}
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81

◆ misalignment()

template<typename T >
BLAZE_ALWAYS_INLINE size_t blaze::misalignment ( const T *  address)

Computes the misalignment of the given address.

Parameters
addressThe address to be checked.
Returns
The number of bytes the given address is misaligned.

This function computes the misalignment of the given address with respect to the given data type Type and the available instruction set (SSE, AVX, ...). It returns the number of bytes the address is larger than the next smaller properly aligned address.

◆ numeric_cast()

template<typename To , typename From >
To blaze::numeric_cast ( From  from)
inline

Checked conversion of values of numeric type.

Parameters
fromThe numeric value to be converted.
Returns
The converted value.
Exceptions
std::overflow_errorInvalid numeric cast (overflow).
std::underflow_errorInvalid numeric cast (underflow).

This function converts the given numeric value from to the specified type To. In case a loss of range is detected, either a std::underflow_error or std::overflow_error exception is thrown.

Examples:

// Triggers a std::overflow_error exception
try {
const short b( blaze::numeric_cast<short>( a ) );
}
catch( std::overflow_error& ) {}
// Triggers a std::underflow_error exception
try {
const int a( -1 );
const unsigned int b( blaze::numeric_cast<unsigned int>( a ) );
}
catch( std::underflow_error& ) {}
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

◆ operator!()

template<bool B>
constexpr BoolConstant<!B > blaze::operator! ( BoolConstant< B >  )
constexprnoexcept

Logical NOT of a boolean constant.

Returns
TrueType if the given argument is FalseType, FalseType otherwise.

This function performs a logical NOT on the given boolean constant. In case the argument is FalseType, the function returns TrueType, else it returns FalseType.

◆ operator!=() [1/2]

template<typename T1 , size_t N1, typename A1 , typename T2 , size_t N2, typename A2 >
bool blaze::operator!= ( const SmallArray< T1, N1, A1 > &  lhs,
const SmallArray< T2, N2, A2 > &  rhs 
)
inline

Inequality operator for the comparison of two dense arrays.

Parameters
lhsThe left-hand side small array for the comparison.
rhsThe right-hand side small array for the comparison.
Returns
true if the two arrays are not equal, false if they are equal.

◆ operator!=() [2/2]

template<size_t... I1s, size_t... I2s>
constexpr bool blaze::operator!= ( index_sequence< I1s... >  lhs,
index_sequence< I2s... >  rhs 
)
constexprnoexcept

Inequality operator for the comparison of two index sequences.

Parameters
lhsThe left-hand side index sequence for the comparison.
rhsThe right-hand side index sequence for the comparison.
Returns
true if the two index sequences are not equal, false if they are equal.

◆ operator&&()

template<bool B1, bool B2>
constexpr BoolConstant< B1 &&B2 > blaze::operator&& ( BoolConstant< B1 >  ,
BoolConstant< B2 >   
)
constexprnoexcept

Logical AND of two boolean constants.

Returns
TrueType if both arguments are TrueType, FalseType otherwise.

This function performs a logical AND between the two given boolean constants. In case both arguments are TrueType, the function returns TrueType, else it returns FalseType.

◆ operator==() [1/2]

template<typename T1 , size_t N1, typename A1 , typename T2 , size_t N2, typename A2 >
bool blaze::operator== ( const SmallArray< T1, N1, A1 > &  lhs,
const SmallArray< T2, N2, A2 > &  rhs 
)
inline

Equality operator for the comparison of two dense arrays.

Parameters
lhsThe left-hand side small array for the comparison.
rhsThe right-hand side small array for the comparison.
Returns
true if the two arrays are equal, false if not.

◆ operator==() [2/2]

template<size_t... I1s, size_t... I2s>
constexpr bool blaze::operator== ( index_sequence< I1s... >  lhs,
index_sequence< I2s... >  rhs 
)
constexprnoexcept

Equality operator for the comparison of two index sequences.

Parameters
lhsThe left-hand side index sequence for the comparison.
rhsThe right-hand side index sequence for the comparison.
Returns
true if the two index sequences are equal, false if not.

◆ operator||()

template<bool B1, bool B2>
constexpr BoolConstant< B1||B2 > blaze::operator|| ( BoolConstant< B1 >  ,
BoolConstant< B2 >   
)
constexprnoexcept

Logical OR of two boolean constants.

Returns
TrueType if any of the arguments is TrueType, FalseType otherwise.

This function performs a logical OR between the two given boolean constants. In case any of the two arguments is TrueType, the function returns TrueType, else it returns FalseType.

◆ reinterpret_pointer_cast() [1/2]

template<typename To , typename From >
To * blaze::reinterpret_pointer_cast ( From *  ptr)
inline

Reinterpret cast for pointer types.

Parameters
ptrThe pointer to be cast.
Returns
The casted value.

The reinterpret_pointer_cast function is used exactly as the built-in reinterpret_cast operator but for pointer types.

class A { ... };
unsigned char* raw = new unsigned char[ sizeof(A)*10 ]; // Allocation of raw memory
A* a = reinterpret_pointer_cast<A>( raw ); // Reinterpretation cast

◆ reinterpret_pointer_cast() [2/2]

template<typename To , template< typename > class S, typename From >
S< To > blaze::reinterpret_pointer_cast ( S< From >  ptr)
inline

Reinterpret cast for smart pointers.

Parameters
ptrThe smart pointer to be cast.
Returns
The casted smart pointer.

The reinterpret_pointer_cast function is used exactly as the built-in reinterpret_cast operator but for smart pointers.

◆ static_pointer_cast() [1/2]

template<typename To , typename From >
To * blaze::static_pointer_cast ( From *  ptr)
inline

Static cast for pointer types.

Parameters
ptrThe pointer to be cast.
Returns
The casted value.

The static_pointer_cast function is used exactly as the built-in static_cast operator but for pointer types.

class B { ... };
class D : public B { ... };
B* b = new D(); // Base pointer to a derived class object
D* d = static_pointer_cast<D>( b ); // Static down-cast

◆ static_pointer_cast() [2/2]

template<typename To , template< typename > class S, typename From >
S< To > blaze::static_pointer_cast ( S< From >  ptr)
inline

Static cast for smart pointers.

Parameters
ptrThe smart pointer to be cast.
Returns
The casted smart pointer.

The static_pointer_cast function is used exactly as the built-in static_cast operator but for smart pointers.

class B { ... };
class D : public B { ... };
using BPtr = SharedPtr<B>;
using DPtr = SharedPtr<D>;
BPtr b = BPtr( new D() ); // Base smart pointer to a derived class object
DPtr d = static_pointer_cast<D>( b ); // Static down-cast

◆ swap()

template<typename T , size_t N, typename A >
void blaze::swap ( SmallArray< T, N, A > &  a,
SmallArray< T, N, A > &  b 
)
inlinenoexcept

Swapping the contents of two small arrays.

Parameters
aThe first array to be swapped.
bThe second array to be swapped.
Returns
void

This function swaps the contents of two small arrays. Please note that this function is only guaranteed to not throw an exception if the move constructor of the underlying data type T is guaranteed to be noexcept.