cyaiip |
Table of contents
ProcedureCYAIIP ( Cycle the elements of an integer array, in place ) SUBROUTINE CYAIIP ( NELT, DIR, NCYCLE, ARRAY ) AbstractCycle the elements of an integer array forward or backward in place. Required_ReadingNone. KeywordsARRAY DeclarationsIMPLICIT NONE INTEGER NELT CHARACTER*1 DIR INTEGER NCYCLE INTEGER ARRAY ( * ) Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- NELT I Number of elements. DIR I Direction to cycle: 'F' or 'B'. NCYCLE I Number of times to cycle. ARRAY I-O Array to be cycled/cycled array. Detailed_InputNELT is the number of elements in the input array. DIR is the direction in which the elements in the array are to be cycled. 'F' or 'f' to cycle forward. 'B' or 'b' to cycle backward. NCYCLE is the number of times the elements in the array are to be cycled. ARRAY is the array to be cycled. Detailed_OutputARRAY is the input array after it has been cycled. ParametersNone. Exceptions1) If the value of DIR is not recognized, the error SPICE(INVALIDDIRECTION) is signaled. 2) If NELT is less than 1, the output array is not modified. 3) If NCYCLE is negative, the array is cycled NCYCLE times in the opposite direction of DIR. FilesNone. ParticularsThis routine cycles an integer array in place. To cycle an array and store the result in a new array, use CYCLAI. An array is cycled when its contents are shifted forward or backward by one place. An element pushed off one end of the array is brought around to the other end of the array instead of disappearing. ExamplesLet the integer array A contain the following elements. A(1) = 1 A(2) = 2 A(3) = 3 A(4) = 4 Cycling A forward once yields the array A(1) = 4 A(2) = 1 A(3) = 2 A(4) = 3 Cycling A backward once yields the array A(1) = 2 A(2) = 3 A(3) = 4 A(4) = 1 Cycling by any multiple of the number of elements in the array yields the same array. RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) H.A. Neilan (JPL) W.L. Taber (JPL) I.M. Underwood (JPL) VersionSPICELIB Version 1.1.0, 12-AUG-2021 (JDR) Added IMPLICIT NONE statement. Edited the header to comply with NAIF standard. SPICELIB Version 1.0.0, 09-SEP-2005 (NJB) (HAN) (WLT) (IMU) |
Fri Dec 31 18:36:05 2021