help-octave
[Top][All Lists]
Advanced

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

Re: recursion and fsolve


From: David Bateman
Subject: Re: recursion and fsolve
Date: Thu, 5 Aug 2004 00:47:34 +0200
User-agent: Mutt/1.4.1i

According to John W. Eaton <address@hidden> (on 08/04/04):
> On  4-Aug-2004, David Bateman <address@hidden> wrote:
> 
> | F90 allows recursion. Perhaps we should try to use g95 as the basic
> | fortran compiler. We could then add a test to configure.in for 
> | whether the fortran compiler accepts recursion and and enable somthing
> | like the code I suggested...
> 
> You would also have to look at the Minpack code that is the core of
> fsolve (hybrd1 and hybrj1) and determine whether it is actually
> written in a way that would allow a recursive call to work.
>
> There are other cases as well, such as daspk, lsode, etc., which I
> suspect are NOT written with recursion in mind.

What will cause recursion to have problems is if common blocks or save
statements are used. Even that isn't a guarentee that the code won't work
as if the variables in the common or save statements are in fact constants
that are initialized either directly or by a data statement then there 
should be no problem, There are only a couple of potential problems

daspk -> save statement possible problems with ddaspk.f: "SAVE LID, LENID, 
        NONNEG", though not clear why these need saving. With a quick look
        it seems they are re-iniitalize on the next entry. Other SAVE 
        statements in daspk are initialize as constants with a DATA statement

odepack -> contains common block that are definitely used to pass data between
        subroutines. This will cause problems with recursion. However a 
        handy function SRCOM is defined that allows the contents of the 
        common block to be saved and restored. So recursion would be possible
        if this call is used prior to a new call to the solver.

odessa -> similar arguments apply as to odepack

So it seems to me that the recursion issues aren't insurmountable.

D.

-- 
David Bateman                                address@hidden
Motorola CRM                                 +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 1 69 35 77 01 (Fax) 
91193 Gif-Sur-Yvette FRANCE

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

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