RobinHankin / clifford

https://robinhankin.github.io/clifford/
5 stars 0 forks source link

improvement to `getcoeffs()` #86

Closed RobinHankin closed 8 months ago

RobinHankin commented 1 year ago

Function getcoeffs() returns a vector, not a disord object. It might be a nice idea to name the returned value:

suppressMessages(library("clifford"))
set.seed(0)
(a <- rcliff())
#> Element of a Clifford algebra, equal to
#> + 4 + 1e_1 + 5e_12 - 3e_14 - 2e_26 - 1e_236 + 4e_56 + 2e_156
B <- list(c(1,4),c(1,5,6),1)
(x <- getcoeffs(a,B))
#> [1] -3  2  1
names(x) <- lapply(B,catterm)
x
#>  e_14 e_156   e_1 
#>    -3     2     1

Created on 2023-06-29 with reprex v2.0.2

Observe that catterm() is sensitive to options separate and basissep.

RobinHankin commented 1 year ago

getcoeffs() is quite an interesting function and deserves its own function profile along the lines of stokes::inst/Alt.Rmd.

RobinHankin commented 8 months ago

Om reflection, the manpage does a good job documenting getcoeffs(), no need for a vignette.