cleard_c |
Table of contents
Procedurecleard_c ( Clear a double precision array ) void cleard_c ( SpiceInt ndim, SpiceDouble * array ) AbstractFill a double precision array with zeros. Required_ReadingNone. KeywordsARRAY ASSIGNMENT Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- ndim I The number of elements of `array' which are to be set to zero. array O Double precision array to be filled. Detailed_Inputndim is the number of elements in `array' which are to be set to zero. Detailed_Outputarray is the double precision array which is to be filled with zeros. ParametersNone. ExceptionsError free. 1) If ndim < 1, the array is not modified. FilesNone. ParticularsNone. ExamplesThe numerical results shown for this example may differ across platforms. The results depend on the SPICE kernels used as input, the compiler and supporting libraries, and the machine specific arithmetic implementation. 1) Initialize all members of a double precision array to the same value and clear it afterwards. Example code begins here. /. Program cleard_ex1 ./ #include <stdio.h> #include "SpiceUsr.h" int main( ) { /. Local parameters. ./ #define NDIM 4 /. Local variables. ./ SpiceDouble array [NDIM]; SpiceInt i; /. Initialize all member of the array `array' to 11.5, and print out its contents. ./ filld_c ( 11.5, NDIM, array ); printf( "Contents of `array' before cleard_c:\n" ); for ( i = 0; i < 4; i++ ) { printf( "%6.1f", array[i] ); } printf( "\n" ); /. Clear the contents of `array' and print it. ./ cleard_c ( NDIM, array ); printf( "\n" ); printf( "Contents of `array' after cleard_c:\n" ); for ( i = 0; i < 4; i++ ) { printf( "%6.1f", array[i] ); } printf( "\n" ); return ( 0 ); } When this program was executed on a Mac/Intel/cc/64-bit platform, the output was: Contents of `array' before cleard_c: 11.5 11.5 11.5 11.5 Contents of `array' after cleard_c: 0.0 0.0 0.0 0.0 RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) W.M. Owen (JPL) Version-CSPICE Version 1.0.1, 19-MAY-2021 (JDR) Edited the header to comply with NAIF standard and added complete code example. -CSPICE Version 1.0.0, 21-MAR-2016 (NJB) (WMO) Index_Entriesclear a d.p. array |
Fri Dec 31 18:41:03 2021