help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: uniform random variable in oct file?


From: Michael Creel
Subject: Re: uniform random variable in oct file?
Date: Mon, 11 Sep 2006 14:00:53 +0000



On 9/10/06, Paul Kienzle <address@hidden> wrote:

On Sep 10, 2006, at 10:08 AM, Michael Creel wrote:

>
>
> On 9/9/06, Paul Kienzle <address@hidden> wrote:
>> 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
>
>
> I'm still just not clear about all of this, but maybe I should make it
> clear that my goal is to come up with an efficient minimizer for
> objective functions defined as .m files. Objective functions written
> as .oct files should also be supported. Currently, bfgsmin.m and
> samin.oct achieve this goal. They do this using feval() to evaluate
> the objective function (using celleval.oct). I would like to eliminate
> the feval, if possible, but your point #4 seems to use it still to
> allow .m file objective functions. So I'm not sure that there is a
> speedup here, for .m file objective functions. Speeding up
> minimization of .c objective functions isn't my priority, at least
> yet. M.

You won't be able to speed up feval for m-files significantly without a
lot of work. To see any improvement you will need to make the
interpreter run faster.

- Paul

OK. I was hoping maybe there was some big improvement I was overlooking that didn't use feval. Actually, I think that there are some redundant fevals in the method I'm currently using, which I'll try to remove. Thanks for the comments. Michael

reply via email to

[Prev in Thread] Current Thread [Next in Thread]