grapes-inner-grapes function

Numerical and Symbolic Inner Product

Numerical and Symbolic Inner Product

Computes the inner product of two numeric or character arrays.

x %inner% y

Arguments

  • x: numeric or character array.
  • y: numeric or character array.

Returns

numeric or character.

Details

The inner product between two arrays A and B is computed as:

C=j1jnAj1jnBj1jn C = \sum_{j_1\dots j_n} A_{j_1\dots j_n}B_{j_1\dots j_n}

Examples

### numeric inner product x <- array(1:4, dim = c(2,2)) x %inner% x ### symbolic inner product x <- array(letters[1:4], dim = c(2,2)) x %inner% x

References

Guidotti E (2022). "calculus: High-Dimensional Numerical and Symbolic Calculus in R." Journal of Statistical Software, 104(5), 1-37. tools:::Rd_expr_doi("10.18637/jss.v104.i05")

See Also

Other basic arithmetic: %diff%(), %div%(), %dot%(), %kronecker%(), %outer%(), %prod%(), %sum%()

  • Maintainer: Emanuele Guidotti
  • License: GPL-3
  • Last published: 2023-03-09