onion-class function

Class onion

Class onion

The formal class for onion and onionmat objects class

Objects from the Class

Class onion is a virtual class extending classes quaternion and octonion . In package documentation, onion means an object that behaves as a vector of quaternions or octonions, stored as a four- or eight- row numeric matrix.

Class onionmat is the class for matrices whose elements are quaternions or octonions. An onionmat is stored as a two-element list, the first being an onion and the second an integer matrix which holds structural matrix attributes such as dimensions and dimnames. Most standard arithmetic idiom for matrices should work for onionmats.

Class index is taken from the excellent Matrix package and is a setClassUnion() of classes numeric, logical, and character, which mean that it is an arity-one matrix index.

Author(s)

Robin K. S. Hankin

Examples

as.octonion(1:8,single=TRUE) as.quaternion(matrix(runif(20),nrow=4)) H <- matrix(rquat(21),3,7) dimnames(H) <- list(foo=letters[1:3],bar=state.abb[1:7]) i(H) <- 0.1 I <- matrix(rquat(14),7,2) dimnames(I) <- list(foo=state.abb[1:7],baz=LETTERS[1:2]) H %*% I
  • Maintainer: Robin K. S. Hankin
  • License: GPL-2
  • Last published: 2024-03-29