[R] problem applying .C function in outer product

Allin Cottrell cottrell at wfu.edu
Thu Mar 13 00:30:42 CET 2003


On Wed, 12 Mar 2003, Jim McLoughlin wrote:

> /*
>   * Wrapper for use in R - requires that return value by passed via
> argument
>   */
> void blackScholesR( double *S, double *K, double *r, double *T, double
> *volatility, double *price)
> {
>      *price = blackScholes(*S, *K, *r, *T, *volatility);
> }

You are passing all scalars and no vectors to the function
blackScholes().  E.g. if S is of type (double *), then *S is of type
double (a single double-precision value, S[0]), and so on for *K, *r,
*T etc.

Allin Cottrell.



More information about the R-help mailing list