[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Are functional objects (functors/closures) possible?
From: |
John W. Eaton |
Subject: |
Are functional objects (functors/closures) possible? |
Date: |
Fri, 22 Nov 2002 11:07:52 -0600 |
On 21-Nov-2002, Brett Viren <address@hidden> wrote:
| I am using Octave 2.1.36 for the "lsode" ODE solver. The ODE I want
| to solve is a function of many parameters. Is there some way to pass
| in these parameters to the function to be used durring the "lsode"
| running?
|
| The only thing I can think of is to use globals.
To me, that seems to be a reasonable way to solve this problem. If
many global variables bother you, you can pack all the data in a
structure or cell array (in recent snapshot versions of Octave, at
least).
| If octave supported functional objects, (aka functors, aka closures,
| aka currying) then I could create an instance of "f" which stores the
| values of its parameters. Searching google and the ML archives I
| didn't find anything.
Right, Octave does not support this.
| If octave doesn't support this directly, is there a way to use C++
| functional objects (ie, objects with an operator()()) through writing
| a dynamically loaded .oct file?
Sorry, I'm not following what you want. Can you be more specific
about what it is you want and how it would help you?
jwe
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------