Index Page
cspice_sumad
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Abstract
I/O
Examples
Particulars
Required Reading
Version
Index_Entries

Abstract


   CSPICE_SUMAD returns the double precision sum of elements of
   a double precision vector.

   For important details concerning this module's function, please refer to
   the CSPICE routine sumad_c.

I/O

   
   Given a vector 'vec', of length (order) 'N':
   
      vec_sum = cspice_sumad( vec, N)
   
   returns to 'vec_sum' the summation of the N elements of
   the vector 0 to N-1 where N indicates the number of array 
   elements to sum. Use of a value less than N sums only
   that subset of array elements [0,M] M < N.
   
   The user may also sum an arbitrary contiguous segment of
   an array:
   
      vec_sum = cspice_sumad( vec[a,b], k)
   
   which returns the sum of k element starting with
   element vec[a].
   

Examples


   Any numerical results shown for this example may differ between
   platforms as the results depend on the SPICE kernels used as input
   and the machine specific arithmetic implementation.

   
      print, vec1
      vec1 = [ 12.3d, -4.32d, 76.d, 1.87d]
   
      print, cspice_sumad( vec1[2:3], 2 )
          77.870000
   
      print, cspice_sumad( vec1[1:3], 2 )
          71.680000
   
      print, cspice_sumad( vec1[0:3], 2 )
          7.9800000

Particulars


   None.

Required Reading


   ICY.REQ

Version


   -Icy Version 1.0.0, 16-JUN-2003, EDW (JPL)

Index_Entries

 
   sum of a d.p. array 
 



Wed Apr  5 17:58:04 2017