shabbychef / madness

Multivariate Automatic Differentiation R package
GNU Lesser General Public License v3.0
31 stars 0 forks source link

scalar to vector power broken? #6

Closed shabbychef closed 6 years ago

shabbychef commented 8 years ago

This should run:

X <- madness(2,dvdx=c(1),vtag='x')
Xpow <- X^(1:5)

Instead, I get:

Error in if (length(val) != dim(dvdx)[1]) { : argument is of length zero

Enter a frame number, or 0 to exit   

1: X^(1:5)
2: X^(1:5)
3: new("madness", val = val, dvdx = dvdx, vtag = vtag, xtag = xtag, varx = varx)
4: initialize(value, ...)
5: initialize(value, ...)
6: .local(.Object, ...)

This is with madness 0.2.0

shabbychef commented 8 years ago

Similarly broken are:

X <- madness(2,dvdx=c(1),vtag='x')
Xpow <- X + (1:5)
Xpow <- X - (1:5)
Xpow <- X * (1:5)
shabbychef commented 6 years ago

Fixed by dc89580926 includes unit tests.