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

« back to all changes in this revision

Viewing changes to CXSparse/MATLAB/Demo/private/ex3.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 ex3
 
2
%EX3: create 2D and 3D meshes using mesh2d1, mesh2d2, mesh3d1, mesh3d2.
 
3
 
 
4
% Example:
 
5
%   ex3
 
6
% See also: cs_demo
 
7
 
 
8
%   Copyright 2006-2007, Timothy A. Davis.
 
9
%   http://www.cise.ufl.edu/research/sparse
 
10
 
 
11
t1 = zeros (50,1) ;
 
12
t2 = zeros (50,1) ;
 
13
t3 = zeros (50,1) ;
 
14
t4 = zeros (50,1) ;
 
15
 
 
16
fprintf ('run times for each method, given n:\n') ;
 
17
for n = 2:50
 
18
 
 
19
    tic ;
 
20
    A = mesh2d1 (n) ;
 
21
    t1 (n) = toc ;
 
22
 
 
23
    tic
 
24
    B = mesh2d2 (n) ;
 
25
    t2 (n) = toc ;
 
26
 
 
27
    tic
 
28
    C = mesh3d1 (n) ;
 
29
    t3 (n) = toc ;
 
30
 
 
31
    tic
 
32
    D = mesh3d2 (n) ;
 
33
    t4 (n) = toc ;
 
34
 
 
35
    fprintf ('%3d: %8.3f %8.3f %8.3f %8.3f\n', n, t1(n), t2(n), t3(n), t4(n)) ;
 
36
 
 
37
    subplot (2,2,1) ; spy (A) ; title ('2D mesh, method 1') ;
 
38
    subplot (2,2,2) ; spy (B) ; title ('2D mesh, method 2') ;
 
39
    subplot (2,2,3) ; spy (C) ; title ('3D mesh, method 1') ;
 
40
    subplot (2,2,4) ; spy (D) ; title ('3D mesh, method 2') ;
 
41
    drawnow
 
42
end