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

« back to all changes in this revision

Viewing changes to CXSparse/MATLAB/Test/sqr_example.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 sqr_example
 
2
%SQR_EXAMPLE test cs_sqr
 
3
% Example:
 
4
%   sqr_example
 
5
% See also: testall
 
6
 
 
7
%   Copyright 2006-2007, Timothy A. Davis.
 
8
%   http://www.cise.ufl.edu/research/sparse
 
9
 
 
10
Prob = UFget (706) ;
 
11
 
 
12
A = Prob.A' ;
 
13
q = colamd (A) ;
 
14
A = A (:,q) ;
 
15
A = sprandn (A) ;
 
16
[m n] = size (A) ;
 
17
 
 
18
[vnz, rnz, parent, c, leftmost, p] = cs_sqr(A) ;
 
19
 
 
20
m2 = length (p) ;
 
21
B = [A ; sparse(m2-m,n)] ;
 
22
B = B (p,q) ;
 
23
 
 
24
R1 = gqr3 (B) ;
 
25
 
 
26
clf
 
27
subplot (2,2,1) ; spy(A)
 
28
subplot (2,2,3) ; spy (chol (A'*A + 100*speye(n))) ;
 
29
subplot (2,2,4) ; spy (R1) ;