"Brendan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>F -is- in fact an iterative optimizer that minimizes A on x (B is the
> derivative of A). So yes, F will call A and B on mulitple 'x's. In
> that case, it seems the mutable object trick is the way to go. Thanks.
As long a
On 3 Apr 2005 16:21:10 -0700, "Brendan" <[EMAIL PROTECTED]> wrote:
>Thanks for the tips. Making FW a callable class (choice 5) seems to be
>a good (if verbose) solution. I might just wrap my temporary values in
>a list [lastX, lastA, lastB] and mutate them as Michael suggests.
>Thanks to Michael
>James Stroud Apr 3, 3:18 pm:
>I think you might want to look at "python generators".
I've seen discussion of generators before, but haven't invested the
time to understand them yet. This might be a good excuse.
--
http://mail.python.org/mailman/listinfo/python-list
F -is- in fact an iterative optimizer that minimizes A on x (B is the
derivative of A). So yes, F will call A and B on mulitple 'x's. In
that case, it seems the mutable object trick is the way to go. Thanks.
I didn't follow your last sentence. What about the Python Cookbook?
--
http://mail.
Thanks for the tips. Making FW a callable class (choice 5) seems to be
a good (if verbose) solution. I might just wrap my temporary values in
a list [lastX, lastA, lastB] and mutate them as Michael suggests.
Thanks to Michael especially for the explanation of the name-binding
process that's at th
"Brendan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have a function, call it F(x), which asks for two
> other functions as arguments, say A(x) and B(x). ...
If I understand this and the rest, a third party library whose code you
cannot modify (easily) has a function F wit
On 3 Apr 2005 14:12:48 -0700, "Brendan" <[EMAIL PROTECTED]> wrote:
>Hi everyone
>
>I'm new to Python, so forgive me if the solution to my question should
>have been obvious. I have a function, call it F(x), which asks for two
>other functions as arguments, say A(x) and B(x). A and B are most
>ef
On Sunday 03 April 2005 04:12 pm, Brendan wrote:
> from ThirdPartyLibrary import F
> from MyOtherModule import AB
>
> def FW(x):
> lastX = None
> aLastX = None
> bLastX = None
I'm pretty sure your method will work if you just specify
that these are global:
def FW(x):
global lastX
I wish I had time to dig into your specific problem because it looks
interesting. But I think you might want to look at "python generators". I
beleive there is no reason that they can't yield a function.
http://www.python.org/peps/pep-0255.html
http://docs.python.org/ref/yield.html
http://linuxg
Brendan wrote:
Hi everyone
I'm new to Python, so forgive me if the solution to my question should
have been obvious.
...
Good question. For a thorough explanation see:
http://www.python.org/dev/doc/devel/ref/naming.html
Simple version follows:
OK, here's my problem: How do I best store and cha
Hi everyone
I'm new to Python, so forgive me if the solution to my question should
have been obvious. I have a function, call it F(x), which asks for two
other functions as arguments, say A(x) and B(x). A and B are most
efficiently evaluated at once, since they share much of the same math,
ie, A
11 matches
Mail list logo