Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

VEC_$IPREMULT                     Domain/OS                      VEC_$IPREMULT


NAME
     vec_$ipremult - multiply a 32-bit vector by a 4x4 matrix

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

     void vec_$ipremult(
          long *start_vec,
          long *matrix,
          long *result_vec)

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

     procedure vec_$ipremult(
          in start_vec: univ vec_$integer32_vector;
          in matrix: univ vec_$integer32_matrix;
          out result_vec: univ vec_$integer32_vector);

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

           integer*4 start_vec(4), matrix(4,4), result_vec(4)

           call vec_$ipremult(start_vec, matrix, result_vec)

DESCRIPTION
     Vec_$ipremult multiplies the 4-element vector start_vec by the 4x4 matrix
     matrix.

     In C, vec_$ipremult applies matrix as a left transform to a column vector
     start_vec, and the resulting operation is

          for (i = 0; i < 4; ++i) {
               result_vec[i] = 0;
               for (j = 0; i < 4; ++j)
                    result_vec[i] += start_vec[i]
                                  * matrix[i][j];
          }

     In Pascal, vec_$ipremult applies matrix as a left transform to a column
     vector start_vec, and the resulting operation is

          for i := 1 to 4 do
               begin
               result_vec[i] := 0;
               for j := 1 to 4 do
                    result_vec[i] := result_vec[i]
                                  + start_vec[i]
                                  * matrix[i,j];
               end

     In FORTRAN, vec_$ipremult applies matrix as a right transform to a row
     vector start_vec, and the resulting operation is

           do 10 i = 1, 4
               result_vec(i) = 0
               do 10 j = 1, 4
                    result_vec(i) = result_vec(i)
          &                       + start_vec(j)
          &                       * matrix(j,i)
       10  continue

     start_vec
          The vector to multiply by matrix.

     matrix
          The matrix to multiply by start_vec.

     result_vec
          The product of start_vec and matrix.

NOTES
     Vec_$ipostmult transforms 32-bit integer vectors from the other side.

SEE ALSO
     vec_$dpremult, vec_$ipremult16, vec_$premult.

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