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

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. More...

#include <Size.h>

Inherits blaze::PtrdiffT<-1L >.

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!

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