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

Re: !ERR and MPFIT



> In this case it's more of a termination condition than an error.  For
> example, the user function may decide that a parameter has gotten out
> of bounds unrecoverably.  I would like MPFIT to return gracefully
> rather than barfing if possible, so the user routine needs a way to
> signal MPFIT that something is wrong.

How about putting something like a conditional

message, 'Number of iterations exceeded limits'

in the user procedure, to signal MPFIT. Put no CATCH in user procedure. Then, in
MPFIT you have CATCH statment followed by a graceful return. If a parameter is
so out of bounds that user procedure signals, its unlikely you can obtain
anything meaningful from MPFIT, then why not let it quit with CATCH? No common
blocks, pointers or anything else. Fully self-contained, no conflicts due to
multiple instances running, etc.

Cheers,
Pavel