1
/* ========================================================================== */
2
/* === UMF_is_permutation =================================================== */
3
/* ========================================================================== */
5
/* -------------------------------------------------------------------------- */
6
/* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
7
/* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
8
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
9
/* -------------------------------------------------------------------------- */
11
/* Return TRUE if P is a r-permutation vector, FALSE otherwise */
12
/* P [0..r-1] must be an r-permutation of 0..n-1 */
14
#include "umf_internal.h"
16
GLOBAL Int UMF_is_permutation
18
const Int P [ ], /* permutation of size r */
19
Int W [ ], /* workspace of size n */
28
/* if P is (Int *) NULL, this is the identity permutation */
32
ASSERT (W != (Int *) NULL) ;
34
for (i = 0 ; i < n ; i++)
38
for (k = 0 ; k < r ; k++)
41
DEBUG5 (("k "ID" i "ID"\n", k, i)) ;
44
DEBUG0 (("i out of range "ID" "ID"\n", i, n)) ;
49
DEBUG0 (("i duplicate "ID"\n", i)) ;