![]() |
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, the comma operator can used for any combination of vectors (row or column vectors) to perform an inner product:
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:
Two column vectors 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 modulo operator (i.e.
operator%
):
Please note that the cross product is restricted to three dimensional (dense and sparse) vectors.