Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

VEC_$SUB                          Domain/OS                           VEC_$SUB


NAME
     vec_$sub - subtract single-precision vectors

SYNOPSIS (C)
     #include <apollo/base.h>
     #include <apollo/vec.h>

     void vec_$sub(
          float *start_vec,
          float *sub_vec,
          long int &length,
          float *result_vec)

SYNOPSIS (Pascal)
     %include '/sys/ins/base.ins.pas';
     %include '/sys/ins/vec.ins.pas';

     procedure vec_$sub(
          in start_vec: univ vec_$real_vector;
          in sub_vec: univ vec_$real_vector;
          in length: integer32;
          out result_vec: univ vec_$real_vector);

SYNOPSIS (FORTRAN)
     %include '/sys/ins/base.ins.ftn'
     %include '/sys/ins/vec.ins.ftn'

           parameter (nvec = 10)

           real start_vec(nvec), sub_vec(nvec), result_vec(nvec)
           integer*4 length

           call vec_$sub(start_vec, sub_vec, length, result_vec)

DESCRIPTION
     Vec_$sub subtracts length elements of sub_vec from start_vec, and sup-
     plies the difference in result_vec.

     In C, the resulting operation is

          for (i = 0; i < length; ++i)
               result_vec[i] = start_vec[i] - sub_vec[i];

     In Pascal, the resulting operation is

          for i := 1 to length do
               result_vec[i] := start_vec[i] - sub_vec[i];

     In FORTRAN, the resulting operation is

           do 10 i = 1, length
               result_vec(i) = start_vec(i) - sub_vec(i)
       10  continue

     start_vec
          The vector to subtract sub_vec from.

     sub_vec
          The vector to subtract from start_vec.

     length
          The number of differences to calculate.

     result_vec
          The difference of start_vec and sub_vec.

NOTES
     When vec_$sub is used to operate on matrixes in C and Pascal, start_vec,
     result_vec, and result_vec are row vectors; whereas in FORTRAN, they are
     column vectors.

SEE ALSO
     vec_$dsub, vec_$isub, vec_$isub16, vec_$sub_i.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026