Scalar Multiplication

The scalar multiplication is the multiplication of a scalar value with a vector or a matrix. In Blaze it is possible to use all built-in/fundamental data types except bool as scalar values. Additionally, it is possible to use std::complex values with the same built-in data types as element type.

blaze::StaticMatrix<int,3UL,2UL> M1{ { 1, 2 }, { 3, 4 }, { 5, 6 } };

Vectors and matrices cannot be used for as scalar value for scalar multiplications (see the following example). However, each vector and matrix provides the scale() function, which can be used to scale a vector or matrix element-wise with arbitrary scalar data types:

M1 * scalar; // No scalar multiplication, but matrix/matrix multiplication
M1.scale( scalar ); // Scalar multiplication


Previous: Subtraction     Next: Componentwise Multiplication