| filld_c |
|
Table of contents
Procedure
filld_c ( Fill a double precision array )
void filld_c ( SpiceDouble value,
SpiceInt ndim,
SpiceDouble array [] )
AbstractFill a double precision array with a specified value. Required_ReadingNone. KeywordsARRAY 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'.
ParametersNone. ExceptionsError free. 1) If ndim < 1, the array is not modified. FilesNone. ParticularsNone. 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
RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionJ. Diaz del Rio (ODC Space) Version-CSPICE Version 1.0.0, 19-FEB-2021 (JDR) Index_Entriesfill a d.p. array |
Fri Dec 31 18:41:06 2021