At the moment, the valueOf-function uses signatures c("BernsteinFunction", "numeric", "integer"). This leads to impractical consequences. E.g. the third argument must be an actual integer and not and integerish double. Also for some applications a complex argument might be appropriate and for some Bernstein functions, the implementation might be able to process complex input.
Proposal
Only dispatch on first argument and argument check the rest.
Summary
At the moment, the
valueOf
-function uses signaturesc("BernsteinFunction", "numeric", "integer")
. This leads to impractical consequences. E.g. the third argument must be an actual integer and not and integerish double. Also for some applications a complex argument might be appropriate and for some Bernstein functions, the implementation might be able to process complex input.Proposal
Only dispatch on first argument and argument check the rest.