void vsubg_c ( ConstSpiceDouble * v1,
ConstSpiceDouble * v2,
SpiceInt ndim,
SpiceDouble * vout )
Compute the difference between two double precision vectors of
arbitrary dimension.
None.
VECTOR
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
v1 I First vector (minuend).
v2 I Second vector (subtrahend).
ndim I Dimension of v1, v2, and vout.
vout O Difference vector, v1 - v2.
vout can overwrite either v1 or v2.
v1 is a double precision vector of arbitrary dimension which
is the minuend (i.e. first or left-hand member) in the
vector subtraction.
v2 is a double precision vector of arbitrary dimension which
is the subtrahend (i.e. second or right-hand member) in
the vector subtraction.
ndim is the dimension of v1 and v2 (and vout).
vout is a double precision vector containing the difference
v1 - v2.
None.
Error free.
None.
For each value of the index i from 0 to (ndim - 1), this subroutine
performs the following subtraction:
vout(i) = v1(i) - v2(i)
No error checking is performed to guard against numeric overflow
or underflow. vout may overwrite v1 or v2.
The following table shows the results of vsubg_c from various
inputs.
v1 v2 ndim vout
-----------------------------------------------------------------
(1, 2, 3, 4) ( 1, 1, 1, 1 ) 4 ( 0, 1, 2, 3 )
(1, 2, 3, 4) (-1,-2,-3,-4 ) 4 ( 2, 4, 6, 8 )
(1, 2, 3, 4) (-1, 2,-3, 4 ) 4 ( 2, 0, 6, 0 )
No error checking is performed to guard against numeric overflow.
The programmer is thus required to insure that the values in v1
and v2 are reasonable and will not cause overflow.
It is assumed the proper amount of memory has been allocated for
v1, v2 and vout.
None.
W.M. Owen (JPL)
E.D. Wright (JPL)
-CSPICE Version 1.1.0, 22-OCT-1998 (NJB)
Made input vectors const.
-CSPICE Version 1.0.0, 05-MAR-1998 (EDW)
n-dimensional vector subtraction
Link to routine vsubg_c source file vsubg_c.c
|