| moved_c |
|
Table of contents
Procedure
moved_c ( Move a double precision array to another )
void moved_c ( ConstSpiceDouble arrfrm [],
SpiceInt ndim,
SpiceDouble arrto [] )
AbstractCopy the elements of one double precision array into another array. Required_ReadingNone. KeywordsARRAY Brief_I/O
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
arrfrm I Double precision array to be moved.
ndim I Number of elements to copy, i.e. the dimension
of `arrfrm' and `arrto'.
arrto O Destination array.
Detailed_Inputarrfrm Array from which to copy items. ndim Number of items to copy. Detailed_Outputarrto Array to which items should be copied. ParametersNone. ExceptionsError free. 1) If ndim < 1, the output array is returned unchanged. FilesNone. Particulars
This routine is simply shorthand for the following 3 lines of
code.
for ( i = 0; i < ndim; i++ )
{
arrto[i] = arrfrm[i];
}
Examples
Often one needs to make a temporary copy of an array so that
it can be manipulated without altering the original array.
As pointed out in particulars, you could just do this within
the code that needs the copy. However, if you have several
arrays to copy, you can cut the number of lines of code that
are needed by a third.
For example:
for ( i = 0; i < 19; i++ )
{
tempa[i] = a[i];
}
for ( i = 0; i < 38; i++ )
{
tempb[i] = b[i];
}
Can be rewritten as
moved_c ( a, 19, tempa )
moved_c ( b, 38, tempb )
RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionJ. Diaz del Rio (ODC Space) Version-CSPICE Version 1.0.0, 08-FEB-2021 (JDR) Index_Entriesmove a d.p. array to another d.p. array Link to routine moved_c source file moved_c.c |
Fri Dec 31 18:41:09 2021