Wiki

Clone wiki

blaze / Vectors


General Concepts

The Blaze library currently offers five dense vector types (StaticVector, DynamicVector, HybridVector, CustomVector, and UniformVector) and two sparse vector types (CompressedVector and ZeroVector). All vectors can be specified as either column vectors or row vectors:

using blaze::DynamicVector;
using blaze::columnVector;
using blaze::rowVector;

// Setup of the 3-dimensional dense column vector
//
//    ( 1 )
//    ( 2 )
//    ( 3 )
//
DynamicVector<int,columnVector> a{ 1, 2, 3 };

// Setup of the 3-dimensional dense row vector
//
//    ( 4  5  6 )
//
DynamicVector<int,rowVector> b{ 4, 5, 6 };

Per default, all vectors in Blaze are column vectors:

// Instantiation of a 3-dimensional column vector
blaze::DynamicVector<int> c( 3UL );

Vector Details


Examples

using blaze::StaticVector;
using blaze::DynamicVector;
using blaze::CompressedVector;
using blaze::rowVector;
using blaze::columnVector;

StaticVector<int,6UL> a;            // Instantiation of a 6-dimensional static column vector
CompressedVector<int,rowVector> b;  // Instantiation of a compressed row vector
DynamicVector<int,columnVector> c;  // Instantiation of a dynamic column vector

// ... Resizing and initialization

c = a + trans( b );

Previous: Getting Started ---- Next: Vector Types

Updated