/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:30:08 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include "pvec.h" #include void /*FUNCTION*/ pvec( long list[], long head) { long int i, j, k, n; /* OFFSET Vectors w/subscript range: 1 to dimension */ long *const List = &list[0] - 1; /* end of OFFSET VECTORS */ /* Copyright (c) 1996 California Institute of Technology, Pasadena, CA. * ALL RIGHTS RESERVED. * Based on Government Sponsored Research NAS7-03001. *>> 1994-11-11 PVEC Krogh Declared all vars. *>> 1990-02-08 PVEC WV Snyder at JPL 91109, adapted for MATH77 * * PVEC converts a chain of items in LIST, starting at HEAD, to a * permutation vector. * */ n = 0; i = head; /* Convert the chain in LIST to an inverse permutation vector. * */ L_1: if (i != 0) { n += 1; j = List[i]; List[i] = n; i = j; goto L_1; } /* Invert the inverse permutation vector in LIST. * */ L_2: if (n == 0) return; j = n; k = List[j]; if (k != n) { L_3: i = List[j]; if (i > 0) { List[j] = -k; k = j; j = i; if (j != n) goto L_3; List[n] = k; } else { List[j] = -i; } } n -= 1; goto L_2; } /* end of function */