![]() |
In addition to fundamental element types, the Blaze library supports vectors and matrices with non-fundamental element type. For instance, it is possible to define block matrices by using a matrix type as the element type:
The matrix/vector multiplication in this example runs fully parallel and uses vectorization for every inner matrix/vector multiplication and vector addition.
The only thing to keep in mind when using non-fundamental element types is that all operations between the elements have to be well defined. More specifically, the size of vector and matrix elements has to match. The attempt to combine two non-matching elements results in either a compilation error (in case of statically sized elements) or an exception (for dynamically sized elements):
Therefore please don't forget that dynamically sized elements (e.g. blaze::DynamicVector
, blaze::HybridVector
, blaze::DynamicMatrix
, blaze::HybridMatrix
, ...) need to be sized accordingly upfront.
The first example demonstrates the multiplication between a statically sized block matrix and a block vector:
The second example shows the multiplication between a compressed block matrix with blocks of varying size and a compressed block vector:
Previous: LAPACK Functions Next: Intra-Statement Optimization