DotProduct - Maple Help

SignalProcessing

 DotProduct
 compute the dot product of two arrays of samples

 Calling Sequence DotProduct(A, B)

Parameters

 A, B - Arrays of real or complex values

Description

 • The DotProduct(A, B) command returns the dot product of the Arrays A and B. This is defined by the expression

${\sum }_{k=1}^{N}{A}_{k}{B}_{k}$

 where $N$ is the number of elements of A and B.
 • Note that the element-wise conjugate is not used, even for complex Arrays.
 • Before the code performing the computation runs, Maple converts each input Array to a hardware datatype, first attempting float[8] and subsequently complex[8], unless it already has one of these datatypes. For this reason, it is most efficient the input Arrays have one of these datatypes beforehand.
 • The Arrays A and B must have the same number of elements.

 • The SignalProcessing[DotProduct] command is thread-safe as of Maple 17.

Examples

 > $\mathrm{with}\left(\mathrm{SignalProcessing}\right):$
 > $a≔\mathrm{Array}\left(\left[1,2,3,4,5\right],'\mathrm{datatype}'='\mathrm{float}'\left[8\right]\right)$
 ${a}{≔}\left[\begin{array}{ccccc}{1.}& {2.}& {3.}& {4.}& {5.}\end{array}\right]$ (1)
 > $b≔\mathrm{Array}\left(\left[5,4,3,2,1\right],'\mathrm{datatype}'='\mathrm{float}'\left[8\right]\right)$
 ${b}{≔}\left[\begin{array}{ccccc}{5.}& {4.}& {3.}& {2.}& {1.}\end{array}\right]$ (2)
 > $\mathrm{DotProduct}\left(a,b\right)$
 ${35.}$ (3)

Compatibility

 • The SignalProcessing[DotProduct] command was introduced in Maple 17.