File: isperm.m

package info (click to toggle)
superlu 5.3.0%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 11,976 kB
  • sloc: ansic: 59,420; makefile: 405; fortran: 185; csh: 141
file content (9 lines) | stat: -rw-r--r-- 213 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
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;