Blaze 3.9
blaze::Size< T, N > Struct Template Reference

Compile time evaluation of the size of vectors and matrices. More...

#include <Size.h>

Inherits blaze::SizeHelper1< T, N >.

Detailed Description

template<typename T, size_t N>
struct blaze::Size< T, N >

Compile time evaluation of the size of vectors and matrices.

The Size type trait evaluates the size of a particular dimension of the given vector or matrix type at compile time. In case the given type T is a vector or matrix type with a fixed size (e.g. StaticVector or StaticMatrix) and N is a valid dimension, the value member constant is set to the according size. In all other cases, value is set to -1.

blaze::Size< StaticVector<int,3UL>, 0UL >::value // Evaluates to 3
blaze::Size< StaticMatrix<int,2UL,4UL>, 0UL >::value // Evaluates to 2 (the number of rows)
blaze::Size< StaticMatrix<int,2UL,4UL>, 1UL >::value // Evaluates to 4 (the number of columns)
blaze::Size< StaticVector<int,3UL>, 1UL >::value // Evaluates to -1; 1 is not a valid vector dimension!
blaze::Size< HybridVector<int,3UL>, 0UL >::value // Evaluates to -1; Only maximum size is fixed!
blaze::Size< DynamicVector<int>, 0UL >::value // Evaluates to -1; Size not fixed at compile time!
Efficient implementation of an arbitrary sized vector.
Definition: DynamicVector.h:223
Efficient implementation of a dynamically sized vector with static memory.
Definition: HybridVector.h:222
Efficient implementation of a fixed-sized matrix.
Definition: StaticMatrix.h:249
Efficient implementation of a fixed-sized vector.
Definition: StaticVector.h:230
Compile time evaluation of the size of vectors and matrices.
Definition: Size.h:119

The documentation for this struct was generated from the following file: