RobinHankin / spray

sparse arrays and fast multivariate polynomials
https://robinhankin.github.io/spray/
2 stars 2 forks source link

drop() gives misleading output #26

Closed RobinHankin closed 2 years ago

RobinHankin commented 2 years ago
> a <- homog(3) + 77
> a
           val
 0 0 1  =    1
 0 1 0  =    1
 1 0 0  =    1
 0 0 0  =   77
> constant(a)
           val
 0 0 0  =   77
> constant(a,drop=TRUE)
[1] 77
> drop(constant(a))
           val
 0 0 0  =   77
> 

Above, everything works as expected until the last line, where drop() returns a (constant) spray object instead of what I expected (I expected the value of drop(constant(a)) to be the same as constant(a,drop=TRUE)).