Evaluation of binary expression
Michael Hiegemann
michael.hiegemann at gmx.ch
Sun Apr 6 03:50:04 CDT 2008
Hello,
first of all: Thanks for providing such an exciting system to us!
I am using octave-3.0.0 on a Windows XP computer and tried to use the bug_report command, but it failed for some reason I was unable to find out. Thus, I will provide you with a hand-written bug report.
My goal was to execute some functions in .m-files from an old MatlabR12 installation that we purchased some years ago. These are dealing with the iterative solution of linear equation systems. There are four files attached to this email, which I have all put in the same folder. After having typed the respective addpath command I succeeded to call the functions themselves, but got stuck with the execution of the function.
Here is the sequence of commands in detail:
octave-3.0.0.exe:1> addpath('D:/Data/Michael/octave/sparfun')
octave-3.0.0.exe:2> A = [1,1;-1,1];
octave-3.0.0.exe:3> b = [3;1];
octave-3.0.0.exe:4> tol = 1.0e-6;
octave-3.0.0.exe:5> maxit = 1000;
octave-3.0.0.exe:6> x = cgs(A, b, tol, maxit)
error: `M1' undefined near line 90 column 30
error: evaluating argument list element number 1
error: evaluating prefix operator `!' near line 90, column 21
error: evaluating binary operator `&' near line 90, column 19
error: if: error evaluating conditional expression
error: evaluating if command near line 90, column1
error: called from `cgs' in file `D:/Data/Michael/octave/sparfun\cgs.m'
error evaluating assignment expression near line 21, column 3
octave-3.0.0.exe:7>
The problem obviously is in line 90 of cgs.m (my version of it), which is
if ((nargin >= 5) & ~isempty(M1))
I tend to say that the evaluation of the second expression of the binary operator `&' should be suppressed in case the evaluation of the first expression did already provide a negative result. This is my understanding of the treatment of respective expressions in C language, i.e. by e.g. the VC8 compiler, and this seems to be the treatment of the (old) Matlab engine as well.
Best regards,
Dr.-Ing. Michael Hiegemann
ALSTOM Power (Switzerland) Ltd.
TSNDC
Brown-Boveri-Strasse 8
5401 Baden
Switzerland
--
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cgs.m
Type: application/octet-stream
Size: 9485 bytes
Desc: not available
Url : https://www.cae.wisc.edu/pipermail/bug-octave/attachments/20080406/634bc724/attachment-0004.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iterapp.m
Type: application/octet-stream
Size: 964 bytes
Desc: not available
Url : https://www.cae.wisc.edu/pipermail/bug-octave/attachments/20080406/634bc724/attachment-0005.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iterchk.m
Type: application/octet-stream
Size: 1107 bytes
Desc: not available
Url : https://www.cae.wisc.edu/pipermail/bug-octave/attachments/20080406/634bc724/attachment-0006.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itermsg.m
Type: application/octet-stream
Size: 2904 bytes
Desc: not available
Url : https://www.cae.wisc.edu/pipermail/bug-octave/attachments/20080406/634bc724/attachment-0007.obj
More information about the Bug-octave
mailing list