![]() |
Multiplying two vectors with the same transpose flag (i.e. either blaze::columnVector or blaze::rowVector) via the multiplication operator results in a componentwise multiplication of the two vectors:
The multiplication between a row vector and a column vector results in an inner product between the two vectors:
The trans()
function can be used to transpose a vector as necessary:
Alternatively, either the inner()
function, the dot()
function or the comma operator can be used for any combination of vectors (row or column vectors) to perform an inner product:
When using the comma operator, please note the brackets embracing the inner product expression. Due to the low precedence of the comma operator (lower even than the assignment operator) these brackets are strictly required for a correct evaluation of the inner product.
The multiplication between a column vector and a row vector results in the outer product of the two vectors:
The trans()
function can be used to transpose a vector as necessary:
Alternatively, the outer()
function can be used for any combination of vectors (row or column vectors) to perform an outer product:
Two vectors with the same transpose flag can be multiplied via the cross product. The cross product between two vectors and
is defined as
Due to the absence of a operator in the C++ language, the cross product is realized via the
cross()
function. Alternatively, the modulo operator (i.e. operator%
) can be used in case infix notation is required:
Please note that the cross product is restricted to three dimensional (dense and sparse) column vectors.
Previous: Scalar Multiplication Next: Vector/Vector Division