octave-maintainers
[Top][All Lists]
Advanced

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

How to break out of a computation?


From: John W. Eaton
Subject: How to break out of a computation?
Date: Sat, 18 Feb 2006 13:05:11 -0500

On 18-Feb-2006, Sebastien Loisel wrote:

| Hello,
| 
| I'm tweaking the I/O right now so that
| 
| 1) You can see the result of any disp() as soon as it's done (instead of
| batched together at the end of the computation)

Isn't that just a matter of setting page_output_immediately = 1?

| 2) You can hit Ctrl+C.
| 
| I've got 1) done, but now I'm trying to figure out how to tell Octave to
| stop computing. How do I do that? Throw an exception? The way I do it now is
| when Octave does a octave_stdout<<foo, the actual octave_stdout.rdbuf() is a
| custom object that will dump foo into the output window. So I can actually
| do arbitrary computations and update the GUI whenever Octave does a <<.

What do you mean by "stop computing"?  Do you want to abort the
current computation completely and go back to the beginning of the
main loop, or do you want to temporarily suspend the computation and
then return to it?  Sending Octave a SIGINT should do the former.
I don't know of a way to do the latter, at least not yet.

Also, if you are finding that you need to modify the Octave internals
to do something, please tell us what you are modifying and why.
Perhaps these are changes that we should consider for the core Octave
distribution.  If your GUI depends on patches or modifications to the
core of Octave, that will likely cause you some maintenance trouble in
the future, because the core of Octave is not static.

jwe



reply via email to

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