|
From: | Michael Creel |
Subject: | Re: uniform random variable in oct file? |
Date: | Sun, 10 Sep 2006 14:08:09 +0000 |
4. Define a c function which can call back into the scripting
language. This is useful if the user passes a scripted
objective function rather than one implemented in C.
double scriptcall(int n, const double p[], void *data);
a. convert n,p into a vector v in the scripting language
b. cast data into function type fn in the scripting language
c. call fn with v using feval in the scripting language
d. if the script function raised an exception return inf
otherwise convert the script return value into a c double
and return it
[Prev in Thread] | Current Thread | [Next in Thread] |