Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

VEC_$DDOT_I                       Domain/OS                        VEC_$DDOT_I


NAME
     vec_$ddot_i - return the dot product of two vectors in double-precision
     matrixes

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

     double vec_$ddot_i(
          double *vector1,
          long int &inc1,
          double *vector2,
          long int &inc2,
          long int &length)

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

     function vec_$ddot_i(
          in vector1: univ vec_$double_vector;
          in inc1: integer32;
          in vector2: univ vec_$double_vector;
          in inc2: integer32;
          in length: integer32): double;

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

           parameter (nvec = 10)

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

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

DESCRIPTION
     Vec_$ddot_i returns the dot (scalar) product of two vectors from the
     double-precision arrays vector1 and vector2.

     In C, the resulting operation is

          j = 0;
          k = 0;
          return_value = 0.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.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_$ddot_i = 0.0
           do 10 i = 1,length
               vec_$ddot_i = vec_$ddot_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_$ddot_i is used on matrixes in C or Pascal, vector1 and vector2
     are column vectors; whereas in FORTRAN, they are row vectors.

SEE ALSO
     vec_$ddot, vec_$dot_i, vec_$idot16_i, vec_$idot_i.

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