Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

VEC_$IDOT16_I                     Domain/OS                      VEC_$IDOT16_I


NAME
     vec_$idot16_i - return the dot product of two vectors in 16-bit integer
     matrixes

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

     short vec_$idot16_i(
          short *vector1,
          long int &inc1,
          short *vector2,
          long int &inc2,
          long int &length)

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

     function vec_$idot16_i(
          in vector1: univ vec_$integer16_vector;
          in inc1: integer32;
          in vector2: univ vec_$integer16_vector;
          in inc2: integer32;
          in length: integer32): integer16;

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

           parameter (nvec = 10)

           integer*2 vector1(nvec), vector2(nvec), result
           integer*4 length, inc1, inc2

           result = vec_$idot16_i(vector1, inc1, vector2, inc2, length)

DESCRIPTION
     Vec_$idot16_i returns the dot (scalar) product of two vectors from the
     16-bit integer arrays vector1 and vector2.

     In C, the resulting operation is

          j = 0;
          k = 0;
          return_value = 0;
          for (i = 0; i < length; ++i) {
               return_value += vector1[j] * vector2[k];
               j += inc1;
               k += inc2;
          }

     In Pascal, the resulting operation is

          j := 1;
          k := 1;
          return_value := 0;
          for i := 1 to length do
               begin
               return_value := return_value
                            + vector1[j] * vector2[k];
               j := j + inc1;
               k := k + inc2;
               end;

     In FORTRAN, the resulting operation is

           j = 1
           k = 1
           vec_$idot16_i = 0
           do 10 i = 1,length
               vec_$idot16_i = vec_$idot16_i
          &                  + vector1(j) * vector2(k)
                    j = j + inc1
                    k = k + inc2
       10  continue

     vector1
          An array containing one of the vectors to use in calculating the dot
          product.

     inc1 An increment for vector1 that chooses which elements will be used to
          calculate the product.

     vector2
          An array containing the other vector to use in calculating the dot
          product.

     inc2 An increment for vector2 that chooses which elements will be used to
          calculate the product.

     length
          The number of elements from vector1 or vector2 to use in calculating
          the dot product.

NOTES
     When vec_$idot16_i is used on matrixes in C or Pascal, vector1 and vec-
     tor2 are column vectors; whereas in FORTRAN they are row vectors.

SEE ALSO
     vec_$ddot_i, vec_$dot_i, vec_$idot16, vec_$idot_i.

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