![]() |
Blaze
3.6
|
Classes | |
class | blaze::AlignedAllocator< Type > |
Allocator for type-specific aligned memory.The AlignedAllocator class template represents an implementation of the allocator concept of the standard library for the allocation of type-specific, aligned, uninitialized memory. The allocator performs its allocation via the blaze::allocate() and blaze::deallocate() functions to guarantee properly aligned memory based on the alignment restrictions of the specified type Type. For instance, in case the given type is a fundamental, built-in data type and 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. More... | |
class | blaze::AlignedArray< Type, N, Alignment > |
Implementation of a static array with a fixed alignment.The AlignedArray class template represents a static array with a guaranteed, fixed alignment. The type of the array elements, the number of elements and the alignment of the array can be specified via the three template parameters: More... | |
struct | blaze::DisableIf< Condition, T > |
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool for an intentional application of the Substitution Failure Is Not An Error (SFINAE) principle. It allows a function template or a class template specialization to include or exclude itself from a set of matching functions or specializations based on properties of its template arguments. For instance, it can be used to restrict the selection of a function template to specific data types. The following example illustrates this in more detail. More... | |
struct | blaze::EmptyType |
Empty data type for utility purposes. More... | |
struct | blaze::EnableIf< Condition, T > |
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool for an intentional application of the Substitution Failure Is Not An Error (SFINAE) principle. It allows a function template or a class template specialization to include or exclude itself from a set of matching functions or specializations based on properties of its template arguments. For instance, it can be used to restrict the selection of a function template to specific data types. The following example illustrates this in more detail. More... | |
class | blaze::FunctionTrace |
RAII object for function tracing.The FunctionTrace class is an auxiliary helper class for the tracing of function calls. It is implemented as a wrapper around std::cerr and is responsible for the atomicity of the output of trace information. More... | |
struct | blaze::IntegralConstant< T, N > |
Generic wrapper for a compile time constant integral value.The IntegralConstant class template represents a generic wrapper for a compile time constant integral value. The value of an IntegralConstant can be accessed via the nested value (which is guaranteed to be of type T), the type can be accessed via the nested type definition ValueType. More... | |
struct | blaze::Limits< Type > |
Numerical limits of built-in data types.The Limits class provides numerical limits for the following built-in data types: More... | |
class | blaze::MemoryPool< Type, Blocksize > |
Memory pool for small objects.The memory pool efficiently improves the performance of dynamic memory allocations for small objects. By allocating a large block of memory that can be dynamically assigned to small objects, the memory allocation is reduced from a few hundred cycles to only a few cycles. The memory pool is build from memory blocks of type Block, which hold the memory for a specified number of objects. The memory of these blocks is managed as a single free list. More... | |
class | blaze::NonCopyable |
Base class for non-copyable class instances.The NonCopyable class is intended to work as a base class for non-copyable classes. Both the copy constructor and the copy assignment operator are explicitly deleted in order to prohibit copy operations of the derived classes. . More... | |
class | blaze::NonCreatable |
Base class for non-creatable (static) classes.The NonCreatable class is intended to work as a base class for non-creatable classes, i.e. classes that cannot be instantiated and exclusively offer static functions/data. Both the standard as well as the copy constructor and the copy assignment operator are declared private and left undefinded in order to prohibit the instantiation of objects of derived classes. . More... | |
class | blaze::NullType |
Utility type for generic codes.The NullType class represents an invalid or terminating data type for generic codes. For instance, the TypeList class uses the NullType as terminating data type for the type list. More... | |
struct | blaze::ArrayDelete |
Array-delete policy class.The ArrayDelete policy functor class applies an array delete operation to the given argument. Note that the array delete operation is NOT permitted for inclomplete types (i.e. declared but undefined data types). The attempt to apply an ArrayDelete functor to a pointer to an array of objects of incomplete type results in a compile time error! More... | |
struct | blaze::Deallocate |
Deallocate policy class.The Deallocate deletion policy is the according deletion policy for arrays allocated via the blaze::allocate function. It uses deallocate to free the resource. Note that the delete operation is NOT permitted for inclomplete types (i.e. declared but undefined data types). The attempt to apply a PtrDelete functor to a pointer to an object of incomplete type results in a compile time error! More... | |
struct | blaze::DefaultDelete< Type > |
Default C++ deletion policy class.The DefaultDelete deletion policy is the standard delete for resources allocated via the new operator. It uses delete or array delete (depending on the template argument) to free the resource: More... | |
struct | blaze::NoDelete |
No-delete policy class. More... | |
struct | blaze::PtrDelete |
Pointer-delete policy class.The PtrDelete policy functor class applies a delete operation to the given argument. Note that the delete operation is NOT permitted for inclomplete types (i.e. declared but undefined data types). The attempt to apply a PtrDelete functor to a pointer to an object of incomplete type results in a compile time error! More... | |
class | blaze::SmallArray< T, N, A > |
Implementation of a dynamic array with small array optimization.The SmallArray class template is a hybrid data structure between a static array and a dynamic array. It provides static, in-place memory for up to N elements of type T, but can grow beyond this size by allocating dynamic memory via its allocator of type A. More... | |
class | blaze::UnsignedValue< T > |
Implementation of a wrapper for built-in unsigned integral values.This class wraps a value of built-in unsigned integral type in order to be able to extract non-negative unsigned integral values from an input stream. More... | |
class | blaze::complex |
Complex data type of the Blaze library. More... | |
class | blaze::initializer_list |
Initializer list type of the Blaze library. More... | |
class | blaze::size_t |
Size type of the Blaze library. More... | |
class | blaze::ptrdiff_t |
Pointer difference type of the Blaze library. More... | |
class | blaze::int8_t |
8-bit signed integer type of the Blaze library. More... | |
class | blaze::uint8_t |
8-bit unsigned integer type of the Blaze library. More... | |
class | blaze::int16_t |
16-bit signed integer type of the Blaze library. More... | |
class | blaze::uint16_t |
16-bit unsigned integer type of the Blaze library. More... | |
class | blaze::int32_t |
32-bit signed integer type of the Blaze library. More... | |
class | blaze::uint32_t |
32-bit unsigned integer type of the Blaze library. More... | |
class | blaze::int64_t |
64-bit signed integer type of the Blaze library. More... | |
class | blaze::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.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. More... | |
#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. More... | |
#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. More... | |
#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. More... | |
#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. 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.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. More... | |
#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. More... | |
#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. More... | |
#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. More... | |
#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: More... | |
Typedefs | |
template<bool Condition, typename T = void> | |
using | blaze::DisableIf_t = typename DisableIf< Condition, T >::Type |
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenient shortcut to access the nested Type of the DisableIf class template. For instance, given the type T the following two type definitions are identical: More... | |
template<bool Condition, typename T = void> | |
using | blaze::EnableIf_t = 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: More... | |
template<bool B> | |
using | blaze::BoolConstant = 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. More... | |
using | blaze::FalseType = 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. | |
using | blaze::TrueType = BoolConstant< true > |
Type traits base class.The TrueType class is used as base class for type traits and value traits that evaluate to true. | |
template<bool B> | |
using | blaze::Bool_t = 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. More... | |
template<char N> | |
using | blaze::Char_t = 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. More... | |
template<int N> | |
using | blaze::Int_t = 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. More... | |
template<long N> | |
using | blaze::Long_t = 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. More... | |
template<ptrdiff_t N> | |
using | blaze::Ptrdiff_t = 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. More... | |
template<size_t N> | |
using | blaze::Size_t = 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. More... | |
template<bool Condition, typename T1 , typename T2 > | |
using | blaze::If_t = typename If< Condition, T1, T2 >::Type |
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: More... | |
using | blaze::byte_t = unsigned char |
Byte data type of the Blaze library.The byte data type is guaranteed to be an integral data type of size 1. | |
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.This overload of the as_const() function disables its use on rvalues. This prevents potential misuse as in for instance the following example: More... | |
template<typename T , size_t N> | |
constexpr size_t | blaze::dimensionof (T(&a)[N]) |
Static evaluation of array dimensions. 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... | |
template<typename T > | |
EnableIf_t< IsBuiltin_v< T >, T * > | blaze::allocate (size_t size) |
Aligned array allocation for built-in data types. More... | |
template<typename T > | |
EnableIf_t< IsBuiltin_v< T > > | 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... | |
#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:
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:
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.
#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:
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_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.
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:
#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:
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:
#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:
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:
#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:
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:
#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:
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:
#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:
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:
#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:
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:
#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:
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:
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 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 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 blaze::DisableIf_t = typedef typename DisableIf<Condition,T>::Type |
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenient shortcut to access the nested Type of the DisableIf class template. For instance, given the type T the following two type definitions are identical:
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 blaze::If_t = typedef typename If<Condition,T1,T2>::Type |
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 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 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 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 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.
EnableIf_t< IsBuiltin_v<T>, T* > blaze::allocate | ( | size_t | size | ) |
Aligned array allocation for built-in data types.
size | The number of elements of the given type to allocate. |
std::bad_alloc | Allocation 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:
|
inlinenoexcept |
Adding 'const' to the given lvalue.
v | The given lvalue. |
This function adds the 'const' qualifier to the given lvalue.
|
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:
|
inline |
Returns an iterator to the first element of the given small array.
sa | The given small array. |
|
inline |
Returns an iterator to the first element of the given small array.
sa | The given small array. |
|
inline |
Returns an iterator to the first element of the given small array.
sa | The given small array. |
|
inline |
Returns an iterator just past the last element of the given small array.
sa | The given small array. |
BLAZE_ALWAYS_INLINE bool blaze::checkAlignment | ( | const T * | address | ) |
Checks the alignment of the given address.
address | The address to be checked. |
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.
void blaze::checkedArrayDelete | ( | T * | ptr | ) |
Type-checked delete
[] operation.
ptr | The pointer to the array to be deleted. |
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!
void blaze::checkedDelete | ( | T * | ptr | ) |
Type-checked delete
operation.
ptr | The pointer to be deleted. |
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!
|
inline |
Clearing the given small array.
sa | The small array to be cleared. |
|
inline |
Const cast for pointer types.
ptr | The pointer to be cast. |
The const_pointer_cast function is used exactly as the built-in const_cast operator but for pointer types.
|
inline |
Const cast for smart pointers.
ptr | The smart pointer to be cast. |
The const_pointer_cast function is used exactly as the built-in const_cast operator but for smart pointers.
|
noexcept |
Deallocation of memory for built-in data types.
address | The address of the first element of the array to be deallocated. |
This function deallocates the given memory that was previously allocated via the allocate() function.
|
inline |
Static evaluation of array dimensions.
a | Reference to a static array of type T and size N. |
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.
|
inline |
Dynamic cast for pointer types.
ptr | The pointer to be cast. |
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.
|
inline |
Dynamic cast for smart pointers.
ptr | The smart pointer to be cast. |
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.
|
inline |
Returns an iterator just past the last element of the given small array.
sa | The given small array. |
|
inline |
Returns an iterator just past the last element of the given small array.
sa | The given small array. |
|
inline |
Returns the current CPU time in seconds.
|
inline |
Creating a formated date string in the form YYYY-MM-DD.
|
inline |
Creating a formated time and date string.
|
inline |
Returns the current wall clock time in seconds.
|
inline |
Suppression of unused parameter warnings.
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:
A possible solution is to keep the parameter unnamed:
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:
BLAZE_ALWAYS_INLINE size_t blaze::misalignment | ( | const T * | address | ) |
Computes the misalignment of the given address.
address | The address to be checked. |
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.
|
inline |
Checked conversion of values of numeric type.
from | The numeric value to be converted. |
std::overflow_error | Invalid numeric cast (overflow). |
std::underflow_error | Invalid 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:
|
noexcept |
Logical AND of two boolean constants.
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.
|
noexcept |
Logical NOT of a boolean constant.
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.
|
inline |
Inequality operator for the comparison of two dense arrays.
lhs | The left-hand side small array for the comparison. |
rhs | The right-hand side small array for the comparison. |
|
inline |
Equality operator for the comparison of two dense arrays.
lhs | The left-hand side small array for the comparison. |
rhs | The right-hand side small array for the comparison. |
|
noexcept |
Logical OR of two boolean constants.
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.
|
inline |
Reinterpret cast for pointer types.
ptr | The pointer to be cast. |
The reinterpret_pointer_cast function is used exactly as the built-in reinterpret_cast operator but for pointer types.
|
inline |
Reinterpret cast for smart pointers.
ptr | The smart pointer to be cast. |
The reinterpret_pointer_cast function is used exactly as the built-in reinterpret_cast operator but for smart pointers.
|
inline |
Static cast for pointer types.
ptr | The pointer to be cast. |
The static_pointer_cast function is used exactly as the built-in static_cast operator but for pointer types.
|
inline |
Static cast for smart pointers.
ptr | The smart pointer to be cast. |
The static_pointer_cast function is used exactly as the built-in static_cast operator but for smart pointers.
|
inlinenoexcept |
Swapping the contents of two small arrays.
a | The first array to be swapped. |
b | The second array to be swapped. |
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.