Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

VEC_$IMULT_RSUB_CONSTANT16        Domain/OS         VEC_$IMULT_RSUB_CONSTANT16


NAME
     vec_$imult_rsub_constant16 - multiply two 16-bit integer vectors, negate
     the result, add a scalar

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

     void vec_$imult_rsub_constant16(
          short int *start_vec,
          short int *mult_vec,
          long int &length,
          short int &constant,
          short int *result_vec)

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

     procedure vec_$imult_rsub_constant16(
          in start_vec: univ vec_$integer16_vector;
          in mult_vec: univ vec_$integer16_vector;
          in length: integer32;
          in constant: integer16;
          out result_vec: univ vec_$integer16_vector);

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

           parameter (nvec = 10)

           integer*2 start_vec(nvec), mult_vec(nvec), result_vec(nvec), constant
           integer*4 length

           call vec_$imult_rsub_constant16(start_vec, mult_vec, length, constant, result_vec)

DESCRIPTION
     Vec_$imult_rsub_constant16 multiplies start_vec by mult_vec, negates the
     result (multiplies by -1), and adds a scalar constant to produce the vec-
     tor result_vec.  It differs from vec_$mult_rsub_constant in that the vec-
     tors being handled contain 16-bit integers.


     The calculation performed is as follows:

     For each integer I such that 1 <= I <= length,
     result_vec(I) = (-1 x(start_vec(I) x mult_vec(I))) + constant

     Note that the multiplication done by this call is point-wise.  This call
     does not perform matrix multiplication, since the product of two vectors
     is another vector of the same magnitude.

     start_vec
          A multiplicand vector.

     mult_vec
          A multiplier vector.

     length
          The number of elements to be operated on;  normally the same as the
          number of elements in the vectors.

     constant
          The scalar constant to be added to the result of the multiplication.

     result_vec
          The vector created by multiplying start_vec and mult_vec, negating
          the result, and multiplying the resulting vector by constant.

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

     As in all the vec_$ calls, the result array must not overlap any of the
     input arrays; the result array may be identical to an input, but must not
     contain any subset of it.   Because of pipelining, using overlapping
     input and output arrays may cause incorrect results.

     Vec_$imult_rsub_constant16, like all 16-bit integer routines, performs
     poorly when compared to the 32-bit integer routines.  Its use should be
     avoided wherever possible, especially on high-performance workstations.

SEE ALSO
     vec_$mult_rsub_constant16, vec_$mult_rsub_constant_i,
     vec_$dmult_rsub_constant, vec_$dmult_rsub_constant_i,
     vec_$imult_rsub_constant, vec_$imult_rsub_constant_i,
     vec_$imult_rsub_constant16_i.

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