Index of Functions: A B C D E F G H I J K L M N O P Q R S T U V W X
Index Page cleard_c
Table of contents
Procedure Abstract Required_Reading Keywords Brief_I/O Detailed_Input | Detailed_Output Parameters Exceptions Files Particulars Examples | Restrictions Literature_References Author_and_Institution Version Index_Entries
#### Procedure
       cleard_c ( Clear a double precision array )

       void cleard_c ( SpiceInt       ndim,
                       SpiceDouble  * array )
#### Abstract
       Fill a double precision array with zeros.
#### Required_Reading
       None.
#### Keywords
       ARRAY
       ASSIGNMENT
#### Brief_I/O
       VARIABLE  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_Input
       ndim        is the number of elements in `array' which are to be
                   set to zero.
#### Detailed_Output
       array       is the double precision array which is to be filled
                   with zeros.
#### Parameters
       None.
#### Exceptions
       Error free.

       1)  If ndim < 1, the array is not modified.
#### Files
       None.
#### Particulars
       None.
#### Examples
       The 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
#### Restrictions
       None.
#### Literature_References
       None.
#### Author_and_Institution
       N.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_Entries
       clear a d.p. array
#### Link to routine cleard_c source file cleard_c.c

    Fri Dec 31 18:41:03 2021