David Bateman wrote: > >> Yes that would be preferable but I don't think Octave (3.0.0) keeps >> track of if the matrix is symmetric (pos def), at least a test I did >> with for example, >> >> > > A = diag(1:4,1) + 10*eye(5) + diag(1:4,-1); > matrix_type (A) > ans = Positive Definite > b = A \ ones(5,1) > b = > > 0.092340 > 0.076598 > 0.070842 > 0.046128 > 0.081549 > > matrix_type (A) > ans = Positive Definite > > Octave both tracks and uses the positive definiteness of a matrix to > accelerate its calculations. Note that before using the "\" operator you > do know for sure that the matrix is positive definite as the test for a > positive definite matrix is a low cost one and if the cholesky > factorization fails the positive definite flag is removed and the matrix > is treated with an LU decomposition. > > D. > OK. But what about if the matrix is symmetric or not? I could find a function issymmetric but there is a significant overhead of using that function:
octave:1> A = randn(5000,5000); octave:2> Q = A'*A; octave:3> tic, issymmetric(Q),toc ans = 5000 Elapsed time is 3.6212 seconds. octave:4> tic, R=chol(Q);toc Elapsed time is 3.5773 seconds. For the logdet function it would be nice to be able to avoid that overhead (which is in the same order as computing the Cholesky decomposition). /F ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev