Bug#499565: basic matrix computations give incorrect results
John Peterkort
jpeterkort at comcast.net
Tue Sep 23 00:20:14 UTC 2008
Sylvestre Ledru wrote:
>> -->A = [ 1 2 0 0 1; 2 0 1 0 2; 3 2 1 -1 4]
>> A =
>>
>> 1. 2. 0. 0. 1.
>> 2. 0. 1. 0. 2.
>> 3. 2. 1. - 1. 4.
>>
>> -->R = rref(A)
>> R =
>>
>> 1. 0. 0.5 0. 2.
>> 0. 1. - 0.25 0. 2.776D-17
>> 0. 0. 0. 1. - 2.
>>
>> -->C = 2 * R
>> C =
>>
>> 2. 0. 2. 0. 2.
>> 0. 2. - 0.5 0. 5.551D-17
>> 0. 0. 0. 2. - 2.
>>
>> The result of C=2*R is incorrect. C(1,3) should be 1 not 2, C(1,5) should be 4
>> not 2, and C(3,5) should be -4 not -2.
> After this example, could you try
> -- > C(1,3)-1
> What is the result ?
-->A = [ 1 2 0 0 1; 2 0 1 0 2; 3 2 1 -1 4]
A =
1. 2. 0. 0. 1.
2. 0. 1. 0. 2.
3. 2. 1. - 1. 4.
-->R = rref(A)
R =
1. 0. 0.5 0. 2.
0. 1. - 0.25 0. 2.776D-17
0. 0. 0. 1. - 2.
-->C = 2 * R
C =
2. 0. 2. 0. 2.
0. 2. - 0.5 0. 5.551D-17
0. 0. 0. 2. - 2.
-->C(1,3)-1
ans =
- 1.110D-16
It looks like the display problem occurs at C(1,3), R(1,5) and R(3,5).
-->R(1,5)-1
ans =
- 1.110D-16
-->R(3,5)+1
ans =
1.110D-16
I don't know if this will help you or not, but I downloaded scilab-5.0.1
directly from The scilab web site. When I ran it I got the exact same incorrect
output as I reported in the original bug report.
Also, when running scilab-5.0.1 from the command line I got the following output
on the terminal:
jack at gig:/data/download/scilab/scilab-5.0.1/bin$ ./scilab
jack at gig:/data/download/scilab/scilab-5.0.1/bin$
(<unknown>:23812): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
(<unknown>:23812): Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libxfce.so:
wrong ELF class: ELFCLASS64
(<unknown>:23812): Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libxfce.so:
wrong ELF class: ELFCLASS64
(<unknown>:23812): Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libxfce.so:
wrong ELF class: ELFCLASS64
(<unknown>:23812): Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libxfce.so:
wrong ELF class: ELFCLASS64
(<unknown>:23812): Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libxfce.so:
wrong ELF class: ELFCLASS64
(<unknown>:23812): Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libxfce.so:
wrong ELF class: ELFCLASS64
John
More information about the debian-science-maintainers
mailing list