[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #31742] sqp: incorrect order of removal of Inf
From: |
Olaf Till |
Subject: |
[Octave-bug-tracker] [bug #31742] sqp: incorrect order of removal of Inf bounds |
Date: |
Mon, 13 Dec 2010 09:35:56 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.19) Gecko/2010102906 Iceweasel/3.0.6 (Debian-3.0.6-3) |
Follow-up Comment #6, bug #31742 (project octave):
Thanks for the thorough review.
The first issue (scalar bounds) is resolved in the now attached patch
(without expanding the scalar bounds).
The third suggestion (isinf() -> ==) is also in the new patch. I did not
know that == is overloaded for +-Inf in current Octave, it was not so before.
I did not follow your second suggestion (global variables) for the following
reasons:
1. I don't think global variables give a speed advantage, see this test:
octave:1> function f_global (x)
> global y;
> for id = 1:1000
> x == y;
> endfor
> endfunction
octave:2> function f_anonymous (x, y)
> for id = 1:1000
> x == y;
> endfor
> endfunction
octave:3> global y;
octave:4> y = 1;
octave:5> z = 1;
octave:6> af = @ (x) f_anonymous (x, z);
octave:7> tic; f_global (1), toc
Elapsed time is 0.00171609 seconds.
octave:8> tic; af (1), toc
Elapsed time is 0.00165111 seconds.
octave:9> tic; f_global (1), toc
Elapsed time is 0.00172499 seconds.
octave:10> tic; af (1), toc
Elapsed time is 0.00164196 seconds.
octave:11> tic; f_global (1), toc
Elapsed time is 0.00170795 seconds.
octave:12> tic; af (1), toc
Elapsed time is 0.00164512 seconds.
octave:13>
2. I think the original author used global variables simply because
anonymouns function were not available in Octave at this time.
3. The most important point: Global variables break recursive calls of sqp.
But recursive optimization is sometimes necessary. I think all global
variables in sqp have to be replaced by using anonymous functions in the
future. So I would not add a further global variable now.
(file #22192)
_______________________________________________________
Additional Item Attachment:
File name: sqp-3rd-inf-bounds-removal.changeset Size:4 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?31742>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #31742] sqp: incorrect order of removal of Inf bounds, Olaf Till, 2010/12/02
- [Octave-bug-tracker] [bug #31742] sqp: incorrect order of removal of Inf bounds, Rik, 2010/12/04
- [Octave-bug-tracker] [bug #31742] sqp: incorrect order of removal of Inf bounds, Olaf Till, 2010/12/05
- [Octave-bug-tracker] [bug #31742] sqp: incorrect order of removal of Inf bounds, Olaf Till, 2010/12/05
- [Octave-bug-tracker] [bug #31742] sqp: incorrect order of removal of Inf bounds, Olaf Till, 2010/12/06
- [Octave-bug-tracker] [bug #31742] sqp: incorrect order of removal of Inf bounds, Rik, 2010/12/12
- [Octave-bug-tracker] [bug #31742] sqp: incorrect order of removal of Inf bounds,
Olaf Till <=
- [Octave-bug-tracker] [bug #31742] sqp: incorrect order of removal of Inf bounds, Rik, 2010/12/13
- [Octave-bug-tracker] [bug #31742] sqp: incorrect order of removal of Inf bounds, Olaf Till, 2010/12/15
- [Octave-bug-tracker] [bug #31742] sqp: incorrect order of removal of Inf bounds, Rik, 2010/12/16
- [Octave-bug-tracker] [bug #31742] sqp: incorrect order of removal of Inf bounds, Rik, 2010/12/29