~ubuntu-branches/ubuntu/oneiric/suitesparse/oneiric

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Nick Ellery
  • Date: 2009-06-14 19:15:52 UTC
  • mfrom: (7.2.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090614191552-2hliya5q8n1quseu
Tags: 1:3.4.0-1ubuntu1
* Merge from debian unstable, remaining changes (LP: #387137):
  - debian/control:
    - demote libatlas-doc from recommends to suggests as it is not in main
    - drop recommends on doc-central as it is not in main

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
U = zeros (n) ;
14
14
for k = 1:n
15
15
    x = [ L(:,1:k-1) [ zeros(k-1,n-k+1) ; eye(n-k+1) ]] \ (P * A (:,k)) ;
16
 
    U (1:k-1,k) = x (1:k-1) ;           % the column of U
17
 
    [a i] = max (abs (x (k:n))) ;       % find the pivot row i
 
16
    U (1:k-1,k) = x (1:k-1) ;           % the column of U
 
17
    [a i] = max (abs (x (k:n))) ;       % find the pivot row i
18
18
    i = i + k - 1 ;
19
 
    L ([i k],:) = L ([k i], :) ;        % swap rows i and k of L, P, and x
 
19
    L ([i k],:) = L ([k i], :) ;        % swap rows i and k of L, P, and x
20
20
    P ([i k],:) = P ([k i], :) ;
21
21
    x ([i k]) = x ([k i]) ;
22
22
    U (k,k) = x (k) ;
23
23
    L (k,k) = 1 ;
24
 
    L (k+1:n,k) = x (k+1:n) / x (k) ;   % divide the pivot column by U(k,k)
 
24
    L (k+1:n,k) = x (k+1:n) / x (k) ;   % divide the pivot column by U(k,k)
25
25
end