octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #34850] Behaviour of chol(a,'lower')


From: anonymous
Subject: [Octave-bug-tracker] [bug #34850] Behaviour of chol(a,'lower')
Date: Thu, 17 Nov 2011 14:28:29 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1

URL:
  <http://savannah.gnu.org/bugs/?34850>

                 Summary: Behaviour of chol(a,'lower')
                 Project: GNU Octave
            Submitted by: None
            Submitted on: gio 17 nov 2011 14:28:28 UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Salvatore Filippone
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.4.2
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Hello,
Following the discussion
https://mailman.cae.wisc.edu/pipermail/help-octave/2011-November/048569.html 

To reproduce the problem: Build an SPD matrix
octave:1> a=[12,2,3,4;
> 2,14,5,3;
> 3,5,16,6;
> 4,3,6,16]
a =

   12    2    3    4
    2   14    5    3
    3    5   16    6
    4    3    6   16

Ask for the Cholesky factorization: in LAPACK, if you ask for the 'Upper'
factor, only the upper triangle counts and is looked at/modified, and Octave
agrees as in the following:

> chol(triu(a))
ans =

   3.46410   0.57735   0.86603   1.15470
   0.00000   3.69685   1.21725   0.63117
   0.00000   0.00000   3.71057   1.14045
   0.00000   0.00000   0.00000   3.60107

The symmetric choice of 'lower' in LAPACK only looks at the lower triangle;
this is also true of MATLAB, but Octave gives the following:
octave:5> chol(tril(a),'lower')
ans =

   3.46410   0.00000   0.00000   0.00000
   0.00000   3.74166   0.00000   0.00000
   0.00000   0.00000   4.00000   0.00000
   0.00000   0.00000   0.00000   4.00000

i.e. it behaves as if factoring the upper triangle (which is just the main
diagonal) and then transposing it, whereas according to the LAPACK mode of
operation, I should get exactly* the same output I would get by asking for 
   (chol(triu(a)))' 

The documentation of CHOL does not explicitly specify this behaviour, whereas
LAPACK is very explicit about this. 
As a minimum, this should be clarified in the docs (I'd prefer to see complete
compatibility with MATLAB and LAPACK though). 

Thanks
Salvatore 

* Note: up to working precision, as going from Upper to Lower might change the
order of floating point operations, and thus there may be differences in the
last (few) significant bit(s), also depending on the matrix condition. In the
simple example above there is no difference. 






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?34850>

_______________________________________________
  Messaggio inviato con/da Savannah
  http://savannah.gnu.org/




reply via email to

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