help-octave
[Top][All Lists]
Advanced

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

Re: Question about LU decomposition


From: forkandwait
Subject: Re: Question about LU decomposition
Date: Tue, 20 Apr 2010 14:28:02 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

> > Let A = [2 4; 4 11].
> >
> > Then the output from the lu command is
> >
> > L = [1 0; 1/2 1]
> > U = [4 11; 0 -3/2]
> > P = [0 1; 1 0]
> >
> > This is great... but it is different from what would be generated if  
> > the
> > permutation hadn't been done first, which would have been
> >
> > L = [1 0; 2 1]
> > U = [2 4; 0 3]
> >
> 
> [l, u] = lu(sparse(A), 0);
> full(l)
> full(u)
> full(l*u-A)

It is OK (i.e. not bogging me down anymore), but that doesn't give the desired 
result on my distribution:

octave-3.3.50:247> A2
A2 =

    2    4
    4   11

octave-3.3.50:248> [l , u] = lu (sparse(A2),0)
l =

Compressed Column Sparse (rows = 2, cols = 2, nnz = 3 [75%])

  (2, 1) ->  1
  (1, 1) ->  0.50000
  (1, 2) ->  1

u =

Compressed Column Sparse (rows = 2, cols = 2, nnz = 3 [75%])

  (1, 1) ->  4
  (1, 2) ->  11
  (2, 2) -> -1.5000

Thanks for the quick and thoughtful answers though!




reply via email to

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