({{, DOT[x,y] 
computes the dot product of two vectors x and y.}})

OpenersNotesSection(Spacer1)Details

To use DOT, you first need to load the BLAS Package using (RefLink[Needs, paclet:ref/Needs])["LinearAlgebra`BLAS`"].

The following arguments must be given:

The vector arguments must be of the same length.

OpenersPrimaryExamplesSection(Spacer1)Examples  (7)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Load the BLAS package:

Needs["LinearAlgebra`BLAS`"]

Compute the dot product of two vectors:

DOT[{1,2,3},{-1,2,1}]

OpenersExampleSection1(Spacer1)Scope  (4)

Real vectors:

DOT[{2.1,3.4,5.1},{4.2,-2.3,-0.8}]

Complex vectors:

DOT[{2.+I,-3.-2 I,4},{-I,2.-I,3.}]

Arbitrary-precision vectors:

DOT[{1`20,2,3},{-1`20,2,1}]

Symbolic vectors:

DOT[{a,b,c},{d,e,f}]

OpenersExampleSection3(Spacer1)Properties & Relations  (1)

For vectors x and y, DOT[x,y] is equivalent to x.y:

x=RandomReal[1,{5}];
y=RandomReal[1,{5}];
DOT[x,y]==x.y

OpenersExampleSection4(Spacer1)Possible Issues  (1)

Arguments must be of the same length:

DOT[{1,2},{1,2,3}]

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Basic Linear Algebra Subroutines, paclet:LowLevelLinearAlgebra/guide/BLASGuide])}})}})