Skip to content

Commit 31f2a24

Browse files
committed
AMD: add octave support
1 parent b2620e3 commit 31f2a24

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

AMD/MATLAB/amd_demo.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
% First, print the help information for AMD
1919
help amd2
2020

21+
have_octave = (exist ('OCTAVE_VERSION', 'builtin') == 5) ;
22+
2123
% Get the Harwell/Boeing can_24 matrix.
2224

2325
load can_24
@@ -56,7 +58,11 @@
5658
title ('Cholesky factor, L') ;
5759

5860
subplot (2,2,4) ;
59-
treeplot (parent) ;
61+
if (have_octave)
62+
treeplot (parent') ;
63+
else
64+
treeplot (parent) ;
65+
end
6066
title ('elimination tree') ;
6167

6268
% results from symbfact

AMD/MATLAB/amd_make.m

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,24 @@
1010
% Iain S. Duff. All Rights Reserved.
1111
% SPDX-License-Identifier: BSD-3-clause
1212

13+
have_octave = (exist ('OCTAVE_VERSION', 'builtin') == 5) ;
14+
1315
details = 0 ; % 1 if details of each command are to be printed
1416

1517
d = '' ;
16-
if (~isempty (strfind (computer, '64')))
18+
19+
if (~isempty (strfind (computer, '64')) && ~have_octave)
1720
d = '-largeArrayDims' ;
1821
end
1922

20-
% MATLAB 8.3.0 now has a -silent option to keep 'mex' from burbling too much
21-
if (~verLessThan ('matlab', '8.3.0'))
23+
if (have_octave)
24+
d = ['-DOCTAVE ' d] ;
25+
end
26+
27+
if (have_octave)
28+
d = ['--silent ' d] ;
29+
elseif (~verLessThan ('matlab', '8.3.0'))
30+
% MATLAB 8.3.0 now has a -silent option to keep 'mex' from burbling too much
2231
d = ['-silent ' d] ;
2332
end
2433

AMD/MATLAB/amd_mex.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828

2929
#include "amd.h"
3030
#include "mex.h"
31+
32+
#ifndef OCTAVE
3133
#include "matrix.h"
34+
#endif
3235

3336
void mexFunction
3437
(

0 commit comments

Comments
 (0)