v. ( u v -- x )
Factor documentation > Factor handbook > The language > Numbers > Vector operations > Vector arithmetic
Prev:vs* ( u v -- w )
Next:norm ( v -- x )


Vocabulary
math.vectors

Inputs and outputs
ua sequence of real numbers
va sequence of real numbers
xa real number


Word description
Computes the dot product of two vectors.

See also
2reduce

Definition
IN: math.vectors

GENERIC: v. ( u v -- x )


Methods
USING: generic math math.vectors sequences.cords ;

M: cord v.
[ v. ] [ + ] [ M\ cord v. (call-next-method) ] cord-2both ;
inline


USING: kernel math math.vectors sequences ;

M: object v. [ * ] [ + ] 2map-reduce ; inline


USING: generic kernel math.vectors math.vectors.simd
math.vectors.simd.intrinsics math.vectors.simd.private ;

M: simd-128 v.
dup simd-rep
[ (simd-v.) ] [ M\ simd-128 v. (call-next-method) ]
vv->x-op ; inline