/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:30:07 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include "i7copy.h" #include void /*FUNCTION*/ i7copy( long p, long y[], long x[]) { long int i; /* OFFSET Vectors w/subscript range: 1 to dimension */ long *const X = &x[0] - 1; long *const Y = &y[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. * File: I7COPY.for Three integer subrs used by the * David Gay & Linda Kaufman nonlinear LS package. * Needed for versions that allow Bounded variables. * I7COPY, I7PNVR, and I7SHFT * *>> 1992-04-27 CLL Removed unreferenced stmt labels. *>> 1990-03-20 CLL @ JPL *** from netlib, Wed Feb 7 19:41:53 EST 1990 *** * * *** SET Y = X, WHERE X AND Y ARE INTEGER P-VECTORS *** * * ------------------------------------------------------------------ */ for (i = 1; i <= p; i++) { Y[i] = X[i]; } return; } /* end of function */ /* ================================================================== */ void /*FUNCTION*/ i7pnvr( long n, long x[], long y[]) { long int i, j; /* OFFSET Vectors w/subscript range: 1 to dimension */ long *const X = &x[0] - 1; long *const Y = &y[0] - 1; /* end of OFFSET VECTORS */ /* *** SET PERMUTATION VECTOR X TO INVERSE OF Y *** * */ for (i = 1; i <= n; i++) { j = Y[i]; X[j] = i; } return; } /* end of function */ /* ================================================================== */ void /*FUNCTION*/ i7shft( long n, long k, long x[]) { long int i, nm1, t; /* OFFSET Vectors w/subscript range: 1 to dimension */ long *const X = &x[0] - 1; /* end of OFFSET VECTORS */ /* *** SHIFT X(K),...,X(N) LEFT CIRCULARLY ONE POSITION *** * * ------------------------------------------------------------------ */ if (k >= n) goto L_999; nm1 = n - 1; t = X[k]; for (i = k; i <= nm1; i++) { X[i] = X[i + 1]; } X[n] = t; L_999: return; } /* end of function */