Skip to content

Instantly share code, notes, and snippets.

@zdk123
Created February 14, 2016 21:57
Show Gist options
  • Save zdk123/f76f539ddfe0541b20d7 to your computer and use it in GitHub Desktop.
Save zdk123/f76f539ddfe0541b20d7 to your computer and use it in GitHub Desktop.
#!/bin/octave -qf
## Compare AMD ordering output from:
## amdtest.cpp https://gist.github.com/zdk123/9c623b6bdf3a57018ae2
## Usage after compiling the above script:
## $ amdtest > data.txt
## $ octave -qf amdtest.m data.txt
arg_list = argv();
filename = arg_list{1};
dat = dlmread(filename, " ");
n = size(dat, 2);
X = dat(1:n,:);
P = dat((n+1):end,:);
[pEigen,coli] = find(P);
pMat = amd(X);
disp(pEigen')
disp(pMat)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment