Bug#499565: basic matrix computations give incorrect results
John Peterkort
jpeterkort at comcast.net
Fri Sep 19 20:52:55 UTC 2008
Package: scilab
Version: 4.1.2-6
Severity: normal
File: /usr/bin/scilab
*** Please type your report below this line ***
When using Scilab-4.1.2 in a amd64 system some basic matrix computations give
incorrect results. (When doing the same computations in a virtual machine
running 32 bit Ubuntu 8.04 and scilab-4.1.2 the results are correct.)
~$ uname -a
Linux gig 2.6.26-1-openvz-amd64 #1 SMP Wed Sep 10 16:30:00 UTC 2008 x86_64 GNU/Linux
FIRST EXAMPLE:
-->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.
If I enter R directly using the keyboard instead of calculating it as R =
rref(A), then the calculation C = 2 * R is correct.
SECOND EXAMPLE:
-->s = [1 5 6; 9 7 9; 1 5 4]
s =
1. 5. 6.
9. 7. 9.
1. 5. 4.
-->t = inv(s)
t =
- 0.2236842 0.1315789 0.0394737
- 0.3552632 - 0.0263158 0.5921053
0.5 0. - 0.5
-->u = s * t
u =
1. 0. 0.
- 8.882D-16 2. 8.882D-16
0. 0. 1.
u should be the 3x3 identity matrix, and so u(2,2) should be 1 not 2.
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.26-1-openvz-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages scilab depends on:
ii scilab-bin 4.1.2-6 Matrix-based scientific software p
ii tk8.4 [wish] 8.4.19-2 Tk toolkit for Tcl and X11, v8.4 -
Versions of packages scilab recommends:
ii scilab-doc 4.1.2-6 Matrix-based scientific software p
Versions of packages scilab suggests:
ii gfortran 4:4.3.2-1 The GNU Fortran 95 compiler
-- no debconf information
More information about the debian-science-maintainers
mailing list