compute the product of Matrix and a column Vector - Maple Help

Home : Support : Online Help : Mathematics : Linear Algebra : LinearAlgebra Package : Standard : LinearAlgebra/MatrixVectorMultiply

LinearAlgebra[MatrixVectorMultiply] - compute the product of Matrix and a column Vector

LinearAlgebra[VectorMatrixMultiply] - compute the product of a  row Vector and a Matrix

 Calling Sequence MatrixVectorMultiply(A, U, options) VectorMatrixMultiply(V, A, options)

Parameters

 A - Matrix U - column Vector V - row Vector options - (optional); constructor options for the result object

Description

 • The MatrixVectorMultiply(A, U) function, where U is a column Vector, computes the product $A\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}U$ and returns a column Vector.
 • The VectorMatrixMultiply(V, A) function, where V is a row Vector, computes the product $V\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}A$ and returns a row Vector.
 • The constructor options provide additional information (readonly, shape, storage, order, datatype, and attributes) to the Vector constructor that builds the result. These options may also be provided in the form outputoptions=[...], where [...] represents a Maple list.  If a constructor option is provided in both the calling sequence directly and in an outputoptions option, the latter takes precedence (regardless of the order).
 • This function is part of the LinearAlgebra package, and so it can be used in the form MatrixVectorMultiply(..) only after executing the command with(LinearAlgebra). However, it can always be accessed through the long form of the command by using LinearAlgebra[MatrixVectorMultiply](..).
 • This function has an equivalent shortcut notation, $A\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}U$. For more information, see the dot operator.

Examples

 > $\mathrm{with}\left(\mathrm{LinearAlgebra}\right):$
 > $u:=⟨1|0|0|2⟩$
 ${u}{:=}\left[\begin{array}{cccc}{1}& {0}& {0}& {2}\end{array}\right]$ (1)
 > $M:=⟨⟨5,0,0,0⟩|⟨0,1,0,0⟩|⟨0,0,2,0⟩|⟨0,0,0,1⟩⟩$
 ${M}{:=}\left[\begin{array}{rrrr}{5}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}\\ {0}& {0}& {2}& {0}\\ {0}& {0}& {0}& {1}\end{array}\right]$ (2)
 > $v:=⟨x,y,z,1⟩$
 ${v}{:=}\left[\begin{array}{c}{x}\\ {y}\\ {z}\\ {1}\end{array}\right]$ (3)
 > $\mathrm{MatrixVectorMultiply}\left(M,v\right)$
 $\left[\begin{array}{c}{5}{}{x}\\ {y}\\ {2}{}{z}\\ {1}\end{array}\right]$ (4)
 > $\mathrm{VectorMatrixMultiply}\left(u,M\right)$
 $\left[\begin{array}{cccc}{5}& {0}& {0}& {2}\end{array}\right]$ (5)