RobinHankin / stokes

methods for exterior calculus
https://robinhankin.github.io/stokes/
3 stars 0 forks source link

print method for spray, kform, ktensor #32

Closed RobinHankin closed 3 years ago

RobinHankin commented 4 years ago

The print methods for spray, kform and ktensor give identical output; there is no way to distinguish from the output what the class of the object is:

> S <- spray(matrix(c(1,1,2,2,1,3,3,1,3,5),ncol=2,byrow=TRUE),1:5)
> S
         val
 3 5  =    5
 1 3  =    3
 1 1  =    1
 3 1  =    4
 2 2  =    2
> as.ktensor(S)
         val
 3 5  =    5
 1 3  =    3
 1 1  =    1
 3 1  =    4
 2 2  =    2
> as.kform(S)
         val
 3 5  =    5
 1 3  =   -1
RobinHankin commented 4 years ago

As ever, the zero tensor kform presents problems

RobinHankin commented 3 years ago

The difference between the print methods for alternating forms and tensors is still confusing:

> rform()
A linear map from V^3 to R with V=R^7:
           val
 2 3 6  =    1
 4 5 6  =   -1
 5 6 7  =   -1
 2 4 6  =   -2
 1 2 7  =   -1
 1 3 4  =   -1
 3 4 7  =    1
 2 3 5  =   -1
> rtensor()
A linear mapping from V^3 to R with V=R^7:
           val
 5 2 6  =    1
 5 3 1  =    1
 4 4 5  =    1
 3 5 7  =    1
 5 2 4  =    1
 7 5 3  =    1
 6 4 5  =    1
 3 4 5  =    1
 1 1 4  =    1