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

       moved_c ( Move a double precision array to another )

       void moved_c  ( ConstSpiceDouble    arrfrm [],
                       SpiceInt            ndim,
                       SpiceDouble         arrto  [] )

#### Abstract

       Copy the elements of one double precision array into another
       array.

#### Required_Reading

       None.

#### Keywords

       ARRAY

#### 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_Input

       arrfrm      Array from which to copy items.

       ndim        Number of items to copy.

#### Detailed_Output

       arrto       Array to which items should be copied.

#### Parameters

       None.

#### Exceptions

       Error free.

       1)  If ndim < 1, the output array is returned unchanged.

#### Files

       None.

#### 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 )

#### Restrictions

       None.

#### Literature_References

       None.

#### Author_and_Institution

       J. Diaz del Rio     (ODC Space)

#### Version

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

#### Index_Entries

       move 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