RobinHankin / onion

R functionality to deal with quaternions and octonions
6 stars 1 forks source link

infelicity in %*% and drop() #15

Closed RobinHankin closed 3 years ago

RobinHankin commented 3 years ago

The product of an onionmat and an onion should be an onion, not an onionmat. But:

> A <- matrix(roct(4),2,2)
> A %*% roct(2)
   [1,1] [2,1]
Re -1.62  2.56
i   5.38  0.78
j   3.80 -0.34
k  -0.48 -1.41
l   1.38 -0.11
il  7.97 -1.27
jl -0.42  2.08
kl  1.59 -1.76
     [,1]
[1,]    1
[2,]    2
> 
RobinHankin commented 3 years ago

Well I'll be hornswoggled:

> matrix(1:16,4,4) %*% (1:4)
     [,1]
[1,]   90
[2,]  100
[3,]  110
[4,]  120
>