tahoma2d/thirdparty/superlu/SuperLU_4.1/MATLAB/isperm.m
2016-03-24 01:31:57 +09:00

9 lines
213 B
Matlab

function result = isperm(p)
% ISPERM Is the argument a permutation?
result = 0;
if min(size(p)) > 1, return, end;
ds = diff(sort(p));
if any(ds ~= 1), return, end;
if min(p) ~= 1, return, end;
result = 1;