tahoma2d/thirdparty/superlu/SuperLU_4.1/MATLAB/isperm.m

10 lines
213 B
Mathematica
Raw Normal View History

2016-03-24 05:25:36 +13:00
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;