RobinHankin / spray

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

drop() of zero polynomial #27

Closed RobinHankin closed 2 years ago

RobinHankin commented 2 years ago

look:

> jj <- spray(diag(1:5),1:5)
> jj
               val
 0 0 0 0 5  =    5
 0 0 0 4 0  =    4
 0 0 3 0 0  =    3
 0 2 0 0 0  =    2
 1 0 0 0 0  =    1
> subs(jj,1:5,rep(0,5))
empty sparse array with  columns
> drop(subs(jj,1:5,rep(0,5)))
list()
> 

The last line is a bug I think: drop() should return 0 for a zero polynomial. See also issue #14