help-octave
[Top][All Lists]
Advanced

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

Possible wrong matrix determinant value


From: Marco Guazzone
Subject: Possible wrong matrix determinant value
Date: Wed, 13 May 2009 09:48:55 +0200

Dear octave users,

It seems the function "det()" gives a wrong determinant value for
certain matrices.

Look at the following code:

--- [code_snip] ---
A=[0.5560, 0.2747, 0.5406, 0.7989; 0.1089, 0.8301, 0.8917, 0.8953;
0.9480, 0.9732, 0.2165, 0.8832; 0.0238, 0.6754, 0.2318, 0.4503]
det(A);
--- [/code_snip] ---

The result (on my machine: Intel Core 2 Duo+Fedora 10 x86_64) with
octave 3.0.3 is: -0.078647

However, trying with other tools/libraries, the above value seems to
be wrong. In fact:

With Octave 3.0.3:             -0.078647
With BOOST uBLAS 1.39: -0.07874537
With R 2.9.0:                     -0.07874537
With NumPy 1.2.0:             -0.078745369636711721
With Mathematica 7:           -0.07874537

Note the octave result is wrong starting from the 4th decimal digit.

For the best of my knowledge, the matrix is not ill-conditioned since:
cond(A) = 32.100
cond(A, Inf) = 54.714
Hence, any numerical inaccuracy should be negligible.

So, is this a bug?

Thank you for your attention!!

Cheers,

-- Marco


reply via email to

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