Index Page
cspice_sumai
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_SUMAI returns the integer sum of elements of
   an integer vector.

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

I/O

   
   Given a vector, vec, of length (order) N:
   
      vec_sum = cspice_sumai( 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_sumai( vec[a,b], k)
   
   which returns the sum of k element starting with
   element vec[a], assuming b-a =< k.
   

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.

   
      vec = [ 34, -9, 18, 3 ]
   
      print, cspice_sumai( vec, 4)
             46
   
      print, cspice_sumai( vec, 3)
             43
   
      print, cspice_sumai( vec[0:1], 2)
             25
   
      print, cspice_sumai( vec[1:3], 2)
              9

Particulars


   None.

Required Reading


   ICY.REQ

Version


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

Index_Entries

 
   sum of an integer array 
 



Wed Apr  5 17:58:04 2017