Strange behaviour of \ w.r.t. chol
Marco Caliari
marco.caliari at univr.it
Mon Feb 18 12:01:03 CST 2008
Hi.
Please consider the following script
n = 11;
x = linspace(0,10,n)';
m = 7;
A = (x * ones (1, m+1)) .^ (ones (n, 1) * (m : -1 : 0));
B = A'*A;
matrix_type(B)
issymmetric(B)
eig(B)
det(B)
y = A'*sin(x);
B\y
R = chol(B);
R\(R'\y)
I get det(B)=0, even if matrix_type(B)='Positive Definite' and no
eigenvalue is 0. Moreover, I would expect that \ uses the Cholesky
factorization, but the result of B\y is different from R\(R'\y). Matlab
gives det(B) = 5.32e+32, a warning of bad scaled matrix, but the same
results. Octave has no problem with m = 6.
Finally, a minor thing: why B=matrix_type(B,matrix_type(B)) gives a
warning (invalid matrix type)?
I tried Octave 3.0.0 with atlas_sse2 libs (atlas_sse2) and Octave 2.9.12
with atlas_base libs.
Best regards,
Marco
More information about the Bug-octave
mailing list