File: isperm.m

package info (click to toggle)
superlu 3.0%2B20070106-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze, wheezy
  • size: 5,416 kB
  • ctags: 1,942
  • sloc: ansic: 51,552; makefile: 397; csh: 141; fortran: 54; sh: 14
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;