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

Procedure
Abstract
Required_Reading
Keywords
Declarations
Brief_I/O
Detailed_Input
Detailed_Output
Parameters
Exceptions
Files
Particulars
Examples
Restrictions
Literature_References
Author_and_Institution
Version

Procedure

      VSUBG ( Vector subtraction, general dimension )
 
      SUBROUTINE VSUBG ( V1, V2, NDIM, VOUT )
 

Abstract

     Compute the difference between two double precision vectors of
     arbitrary dimension.

Required_Reading

     None.

Keywords

     VECTOR

Declarations

 
      INTEGER            NDIM
      DOUBLE PRECISION   V1   ( NDIM )
      DOUBLE PRECISION   V2   ( NDIM )
      DOUBLE PRECISION   VOUT ( NDIM )
 

Brief_I/O

     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.

Detailed_Input

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

Detailed_Output

     VOUT    is a double precision vector containing the difference
             V1 - V2.

Parameters

     None.

Exceptions

     Error free.

Files

     None.

Particulars

     For each value of the index I from 1 to NDIM, this subroutine
     performs the following subtraction:

        VOUT(I) = V1(I) - V2(I)

     No error checking is performed to guard against numeric overflow
     or underflow.

Examples

     The following table shows the results of VSUBG 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 )

Restrictions

     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.

Literature_References

     None.

Author_and_Institution

     W.M. Owen       (JPL)

Version

    SPICELIB Version 1.0.3, 23-APR-2010 (NJB)

        Header correction: assertions that the output
        can overwrite the input have been removed.

    SPICELIB Version 1.0.2, 10-MAR-1992 (WLT)

        Comment section for permuted index source lines was added
        following the header.

    SPICELIB Version 1.0.1, 9-MAY-1990 (HAN)

        Several errors in the header documentation were corrected.

    SPICELIB Version 1.0.0, 31-JAN-1990 (WMO)
Wed Apr  5 17:47:45 2017