math_dot_product: Compute the dot product of two vectors

math_dot_productR Documentation

Compute the dot product of two vectors

Description

'dot' or 'scalar' product of vectors or pairwise columns of matrices.

Usage

math_dot_product(x, y)

Arguments

x

Vector or a Matrix of vectors

y

Vector or a Matrix of vectors

Details

Returns the 'dot' or 'scalar' product of vectors or columns of matrices. Two vectors must be of same length, two matrices must be of the same size. If x and y are column or row vectors, their dot product will be computed as if they were simple vectors.

Value

Vector with length of input dimension

Author(s)

Florian Wagner florian.wagner@wagnius.ch

Examples

math_dot_product(c(1,0,0),c(0.1,5,0))
math_dot_product(c(1,0),c(0,1))
sqrt(math_dot_product(c(1,1,1), c(1,1,1)))  #=> 1.732051

wagnius-GmbH/slvwagner documentation built on Jan. 19, 2025, 7:10 a.m.