RobinHankin / spray

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

complex values #34

Open RobinHankin opened 1 year ago

RobinHankin commented 1 year ago

It should be straightforward to implement the complex case. In response to a stackoverflow questin, Dirk gives this:

R> cppFunction("ComplexVector doubleMe(ComplexVector x) { return x+x; }")
R> doubleMe(1+1i)
[1] 2+2i
R> doubleMe(c(1+1i, 2+2i))
[1] 2+2i 4+4i
R>