Skip to content

Commit

Permalink
AMD: add octave support
Browse files Browse the repository at this point in the history
  • Loading branch information
homka122 committed Apr 13, 2024
1 parent b2620e3 commit 31f2a24
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
8 changes: 7 additions & 1 deletion AMD/MATLAB/amd_demo.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
% First, print the help information for AMD
help amd2

have_octave = (exist ('OCTAVE_VERSION', 'builtin') == 5) ;

% Get the Harwell/Boeing can_24 matrix.

load can_24
Expand Down Expand Up @@ -56,7 +58,11 @@
title ('Cholesky factor, L') ;

subplot (2,2,4) ;
treeplot (parent) ;
if (have_octave)
treeplot (parent') ;
else
treeplot (parent) ;
end
title ('elimination tree') ;

% results from symbfact
Expand Down
15 changes: 12 additions & 3 deletions AMD/MATLAB/amd_make.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,24 @@
% Iain S. Duff. All Rights Reserved.
% SPDX-License-Identifier: BSD-3-clause

have_octave = (exist ('OCTAVE_VERSION', 'builtin') == 5) ;

details = 0 ; % 1 if details of each command are to be printed

d = '' ;
if (~isempty (strfind (computer, '64')))

if (~isempty (strfind (computer, '64')) && ~have_octave)
d = '-largeArrayDims' ;
end

% MATLAB 8.3.0 now has a -silent option to keep 'mex' from burbling too much
if (~verLessThan ('matlab', '8.3.0'))
if (have_octave)
d = ['-DOCTAVE ' d] ;
end

if (have_octave)
d = ['--silent ' d] ;
elseif (~verLessThan ('matlab', '8.3.0'))
% MATLAB 8.3.0 now has a -silent option to keep 'mex' from burbling too much
d = ['-silent ' d] ;
end

Expand Down
3 changes: 3 additions & 0 deletions AMD/MATLAB/amd_mex.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@

#include "amd.h"
#include "mex.h"

#ifndef OCTAVE
#include "matrix.h"
#endif

void mexFunction
(
Expand Down

0 comments on commit 31f2a24

Please sign in to comment.