~logan/ubuntu/trusty/suitesparse/4.2.1-3ubuntu1

« back to all changes in this revision

Viewing changes to CXSparse/MATLAB/Test/lu_rightr.m

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2007-05-29 09:36:29 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070529093629-zowquo0b7slkk6nc
Tags: 3.0.0-2
* suitesparse builds properly twice in a row
* Bug fix: "suitesparse - FTBFS: Broken build depens: libgfortran1-dev",
  thanks to Bastian Blank (Closes: #426349).
* Bug fix: "suitesparse_3.0.0-1: FTBFS: build-depends on
  libgfortran1-dev", thanks to Steve Langasek (Closes: #426354).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function [L,U] = lu_rightr (A)
 
2
%LU_RIGHTR recursive right-looking LU.
 
3
% Example:
 
4
%   [L,U] = lu_rightr (A)
 
5
% See also: cs_demo
 
6
 
 
7
%   Copyright 2006-2007, Timothy A. Davis.
 
8
%   http://www.cise.ufl.edu/research/sparse
 
9
 
 
10
n = size (A,1) ;
 
11
if (n == 1)
 
12
    L = 1 ;
 
13
    U = A ;
 
14
else
 
15
    u11 = A (1,1) ;                                                      % (6.4)
 
16
    u12 = A (1,2:n) ;                                                    % (6.5)
 
17
    l21 = A (2:n,1) / u11 ;                                              % (6.6)
 
18
    [L22,U22] = lu_rightr (A (2:n,2:n) - l21*u12) ;                      % (6.7)
 
19
    L = [ 1 zeros(1,n-1) ; l21 L22 ] ;
 
20
    U = [ u11 u12 ; zeros(n-1,1) U22 ] ;
 
21
end