help-octave
[Top][All Lists]
Advanced

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

Possible bug in det (was: Possible loss of accuracy)


From: Marco Caliari
Subject: Possible bug in det (was: Possible loss of accuracy)
Date: Thu, 16 May 2013 12:13:50 +0200 (CEST)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

Secondly, this makes use of ATLAS' multi core capabilities:
% getting to 1 the hard way
N = 2100; A = rand(N);
tic, det(A*inv(A)), toc
ans = Inf
Elapsed time is 1.6111 seconds.

N = 2000; A = rand(N);
tic, det(A*inv(A)), toc
ans =  1.0000
Elapsed time is 1.436 seconds.

Here I suspect a bug: I get

N = 2100;
A = rand(N);
det(A*inv(A))
ans = Inf
prod(diag(chol(A*inv(A))))
ans =  1.00000 % <- correct
prod(diag([~,U]=lu(A*inv(A))))
ans =  1.00000 % <- correct

Shouldn't Octave use Cholesky factorization of A*inv(A) (or, if not recognized as hermitian, LU factorization) in order to compute its determinant?

Marco


reply via email to

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