Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.stsci.edu/~sontag/spicedocs/cspice/size_c.html
Дата изменения: Sat Dec 17 06:09:42 2005 Дата индексирования: Sun Apr 10 22:52:44 2016 Кодировка: Поисковые слова: http astrokuban.info astrokuban |
Return the size (maximum cardinality) of a SPICE cell of any data type.
CELLS
VARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- cell I Input cell. The function returns the size of the input cell.
cell is a CSPICE cell of any data type. Cell must be declared as a character, double precision, or integer SpiceCell.
The function returns the size of (maximum number of elements in) the input cell.
None.
None.
The size_c function is typically used in conjunction with the card_c function to predict (and subsequently avoid) overflows when manipulating cells. In the following example, size_c is used to determine whether the integer cell original can be safely copied into the integer cell save before actually attempting the operation. (If original contains more elements than save is capable of holding, then the operation will fail.) #include "SpiceUsr.h" . . . /. Declare the cells original and save with string length LNSIZE and maximum number of strings SIZE1 and SIZE2 respectively. ./ SPICECHAR_CELL ( original, SIZE1, LNSIZE ); SPICECHAR_CELL ( save, SIZE2, LNSIZE ); . . . if ( card_c(&original) <= size_c(&save) ) { copy_c ( &original, &save ); } else { [ Handle overflow case ] . . . }
None.
1) If the input array has invalid cardinality, the error SPICE(INVALIDCARDINALITY) is signaled. size_c returns an unspecified value in this case. 2) If the input array has invalid size, the error SPICE(INVALIDSIZE) is signaled. size_c returns an unspecified value in this case.
None.
N.J. Bachman (JPL) C.A. Curzon (JPL) H.A. Neilan (JPL) W.L. Taber (JPL) I.M. Underwood (JPL)
None.
-CSPICE Version 1.0.0, 06-AUG-2002 (NJB) (CAC) (HAN) (WLT) (IMU)
size of a cell