-
Notifications
You must be signed in to change notification settings - Fork 265
/
SuiteSparse_demo.m
211 lines (189 loc) · 4.04 KB
/
SuiteSparse_demo.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
function SuiteSparse_demo (matrixpath, dopause)
%SUITESPARSE_DEMO a demo of all packages in SuiteSparse
%
% Example:
% SuiteSparse_demo
%
% See also umfpack, cholmod, amd, camd, colamd, ccolamd, btf, klu, spqr,
% CSparse, CXSparse, ldlsparse, mongoose, GraphBLAS.
% Copyright (c) 2020, Timothy A. Davis, http://suitesparse.com.
% See each package for its license.
if (nargin < 1 || isempty (matrixpath) || ~ischar (matrixpath))
try
% older versions of MATLAB do not have an input argument to mfilename
p = mfilename ('fullpath') ;
t = strfind (p, '/') ;
matrixpath = [ p(1:t(end)) 'CXSparse/Matrix' ] ;
catch me %#ok
% mfilename failed, assume we're in the SuiteSparse directory
matrixpath = 'CXSparse/Matrix' ;
end
end
if (nargin < 2)
dopause = false ;
end
if (dopause)
input ('Hit enter to run the CXSparse demo: ', 's') ;
end
try
cs_demo (0, matrixpath)
catch me
disp (me.message) ;
fprintf ('\nIf you have an older version of MATLAB, you must run the\n') ;
fprintf ('SuiteSparse_demo while in the SuiteSparse directory.\n\n') ;
fprintf ('CXSparse demo failed\n' )
end
if (dopause)
input ('Hit enter to run the UMFPACK demo: ', 's') ;
end
try
umfpack_demo (1)
catch me
disp (me.message) ;
fprintf ('UMFPACK demo failed\n' )
end
if (dopause)
input ('Hit enter to run the CHOLMOD demo: ', 's') ;
end
try
cholmod_demo
catch me
disp (me.message) ;
fprintf ('CHOLMOD demo failed\n' )
end
if (dopause)
input ('Hit enter to run the CHOLMOD graph partitioning demo: ', 's') ;
end
try
graph_demo
catch me
disp (me.message) ;
fprintf ('graph_demo failed, probably because METIS not installed\n') ;
end
if (dopause)
input ('Hit enter to run the AMD demo: ', 's') ;
end
try
amd_demo
catch me
disp (me.message) ;
fprintf ('AMD demo failed\n' )
end
if (dopause)
input ('Hit enter to run the CAMD demo: ', 's') ;
end
try
camd_demo
catch me
disp (me.message) ;
fprintf ('CAMD demo failed\n' )
end
if (dopause)
input ('Hit enter to run the COLAMD demo: ', 's') ;
end
try
colamd_demo
catch me
disp (me.message) ;
fprintf ('COLAMD demo failed\n' )
end
if (dopause)
input ('Hit enter to run the CCOLAMD demo: ', 's') ;
end
try
ccolamd_demo
catch me
disp (me.message) ;
fprintf ('CCOLAMD demo failed\n' )
end
if (dopause)
input ('Hit enter to run the BTF demo: ', 's') ;
end
try
btf_demo
catch me
disp (me.message) ;
fprintf ('BTF demo failed\n' )
end
if (dopause)
input ('Hit enter to run the KLU demo: ', 's') ;
end
try
klu_demo
catch me
disp (me.message) ;
fprintf ('KLU demo failed\n' )
end
if (dopause)
input ('Hit enter to run the LDL demo: ', 's') ;
end
try
ldldemo
catch me
disp (me.message) ;
fprintf ('LDL demo failed\n' )
end
if (dopause)
input ('Hit enter to run the SSMULT demo: ', 's') ;
end
try
ssmult_demo
catch me
disp (me.message) ;
fprintf ('SSMULT demo failed\n' )
end
if (dopause)
input ('Hit enter to run the MESHND demo: ', 's') ;
end
try
meshnd_example
catch me
disp (me.message) ;
fprintf ('MESHND demo failed\n' )
end
if (dopause)
input ('Hit enter to run the SPARSEINV demo: ', 's') ;
end
try
sparseinv_test
catch me
disp (me.message) ;
fprintf ('SPARSEINV demo failed\n' )
end
if (dopause)
input ('Hit enter to run the SuiteSparseQR demo: ', 's') ;
end
try
spqr_demo
catch me
disp (me.message) ;
fprintf ('SuiteSparseQR demo failed\n' )
end
if (dopause)
input ('Hit enter to run the quick spqr_rank demo: ', 's') ;
end
try
quickdemo_spqr_rank
catch me
disp (me.message) ;
fprintf ('spqr_rank demo failed\n' )
end
if (dopause)
input ('Hit enter to run the Mongoose demo: ', 's') ;
end
try
mongoose_demo
catch me
disp (me.message) ;
fprintf ('Mongoose demo failed\n' )
end
if (dopause)
input ('Hit enter to run the GraphBLAS demo: ', 's') ;
end
try
gbdemo
catch me
disp (me.message) ;
fprintf ('GraphBLAS demo failed\n' )
end
fprintf ('\n\n---- SuiteSparse demos complete\n') ;