comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » !ERR and MPFIT
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
!ERR and MPFIT [message #17916] Tue, 16 November 1999 00:00 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
When I set out to translate MPFIT from MINPACK, I wanted to stay as
faithful as possible, but I also wanted it to be as simple as
possible. When it came to error handling, I wanted the user's model
routine to be able to report an error condition.

Unfortunately I chose to use the !ERR system variable. If !ERR is set
to a negative number, then MPFIT aborts the run, assuming that there
was an unrecoverable error.

I now realize that using !ERR was probably a mistake. Why? RSI seems
to want to make it obsolete. Through their error-handling flavor of
the month program, !ERR seems to have fallen out of favor. Also,
there are quite a few actions which might set !ERR accidentally in the
user's function without actually signalling an error condition.

So I have two questions:

* to people who use MPFIT: does anybody actually use the !ERR status
variable to control the fitting process? If not, then I would
consider removing it.

* to everybody: any suggestions on how to generically signal an error
condition? My thoughts were:

- ERROR keyword variable - don't like this, since then the
function has to accept keywords

- define a new system variable - don't like this either, since
it's hard to do system variables right

- common block variable - not very pretty, but gets the job done.

To be clear, this is some kind of error flag that a user routine would
(optionally!) set to signal an abnormal termination condition. Right
now I am leaning toward the common-block approach. Sorry David.

Thanks,

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Previous Topic: xpalette -> error messages
Next Topic: idl2c ???

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 23:24:18 PDT 2025

Total time taken to generate the page: 1.76315 seconds