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
filld_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

   filld_c ( Fill a double precision array ) 

   void filld_c  ( SpiceDouble         value,
                   SpiceInt            ndim,
                   SpiceDouble         array  [] )

Abstract

   Fill a double precision array with a specified value.

Required_Reading

   None.

Keywords

   ARRAY
   ASSIGNMENT


Brief_I/O

   VARIABLE  I/O  DESCRIPTION
   --------  ---  --------------------------------------------------
   value      I   Double precision value to be placed in all the
                  elements of `array'.
   ndim       I   The number of elements in `array'.
   array      O   Double precision array which is to be filled.

Detailed_Input

   value       is the value to be assigned to the array elements
               0 through ndim - 1.

   ndim        is the number of elements in the array.

Detailed_Output

   array       is a double precision array whose elements are to be
               set to `value'.

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.


      Example code begins here.


      /.
         Program filld_ex1
      ./
      #include <stdio.h>
      #include "SpiceUsr.h"

      int main( )
      {

         /.
         Local parameters.
         ./
         #define NDIM         4

         /.
         Local variables.
         ./
         SpiceDouble          array  [NDIM];

         SpiceInt             i;

         /.
         Initialize all members of the array `array' to 1, and
         print out its contents.
         ./
         filld_c ( 1.0, NDIM, array );

         printf( "Contents of ARRAY:\n" );
         for ( i = 0; i < NDIM; i++ )
         {
            printf( "   Index: %1d; value: %3.1f\n", (int)i, array[i] );
         }

         return ( 0 );
      }


      When this program was executed on a Mac/Intel/cc/64-bit
      platform, the output was:


      Contents of ARRAY:
         Index: 0; value: 1.0
         Index: 1; value: 1.0
         Index: 2; value: 1.0
         Index: 3; value: 1.0

Restrictions

   None.

Literature_References

   None.

Author_and_Institution

   J. Diaz del Rio     (ODC Space)

Version

   -CSPICE Version 1.0.0, 19-FEB-2021 (JDR)

Index_Entries

   fill a d.p. array
Fri Dec 31 18:41:06 2021