void scard_c ( SpiceInt card,
SpiceCell * cell )
Set the cardinality of a SPICE cell of any data type.
CELLS
CELLS
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
card I Cardinality of (number of elements in) the cell.
cell O The cell.
card is the cardinality of (number of elements in) the
cell.
cell is a SpiceCell of any data type. On output, the
cardinality of the cell is card. The data portion of
the cell is left unchanged.
If the cardinality is set to zero, the cell becomes a
CSPICE set: the cell's "is a set?" attribute becomes
true. The cell then can be used as an input to the
CSPICE set routines such as insrt*_c.
None.
1) If the cardinality value supplied is less than 0 or greater
than the cell size, the error SPICE(INVALIDCARDINALITY) is
signaled.
None.
The set cardinality (scard_c) and set size (ssize_c) routines are
typically used to initialize cells for subsequent use.
The set cardinality routines are also used by library routines
which manipulate cells (including set and window routines) to
reset the cardinalities of cells as they gain or lose elements.
1) Declare an integer cell. Populate the cell, then reset
the cardinality to zero to effectively make room in the
cell.
#include "SpiceUsr.h"
.
.
.
#define SIZE 10
Spiceint i;
/.
Declare a cell with room for SIZE integers.
./
SPICEINT_CELL ( icell, SIZE );
/.
Fill in the cell with integers 0 through 9.
./
for ( i = 0; i < SIZE; i++ )
{
appndi_c ( i, &icell );
}
.
.
.
/.
Make room in the cell.
./
scard_c ( 0, &icell );
.
.
.
None.
None.
N.J. Bachman (JPL)
C.A. Curzon (JPL)
W.L. Taber (JPL)
I.M. Underwood (JPL)
-CSPICE Version 1.0.0, 21-AUG-2002 (NJB) (CAC) (WLT) (IMU)
set the cardinality of an integer cell
Link to routine scard_c source file scard_c.c
|