Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

vec_$dpostmultn

vec_$ipostmultn16

vec_$postmultn

VEC_$IPOSTMULTN                   Domain/OS                    VEC_$IPOSTMULTN


NAME
     vec_$ipostmultn - multiply a 32-bit integer vector by a matrix

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

     void vec_$ipostmultn(
          long *matrix,
          long *start_vec,
          long int &m,
          long int &n,
          long *result_vec)

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

     procedure vec_$ipostmultn(
          in matrix: univ vec_$integer32_matrix;
          in start_vec: univ vec_$integer32_vector;
          in m: integer32;
          in n: integer32;
          out result_vec: univ vec_$integer32_vector);

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

           integer*4 m, n
           parameter (m = 3, n = 4)

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

           call vec_$ipostmultn(matrix, start_vec, m, n, result_vec)

DESCRIPTION
     Vec_$ipostmultn multiplies the n-element vector start_vec by the variably
     dimensioned matrix matrix, and supplies the resulting m-element vector in
     result_vec.

     In C, vec_$ipostmultn applies the nxm matrix matrix as a right transform
     to the m-element row vector start_vec, and supplies the transformed n-
     element result in result_vec:

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

     In Pascal, vec_$ipostmultn applies the nxm matrix matrix as a right
     transform to the m-element row vector start_vec, and supplies the
     transformed n-element result in result_vec:

          for i := 1 to m do
               begin
               result_vec[i] := 0.0;
               for j := 1 to n do
                    result_vec[i] := result_vec[i]
                                  + start_vec[j]
                                  * matrix[j,i];
               end;

     In FORTRAN, vec_$ipostmultn applies the mxn matrix matrix as a left
     transform to the m-element column vector start_vec, and supplies the
     transformed n-element result in result_vec:

           do 10 i = 1, m
               result_vec(i) = 0.0
               do 10 j = 1, n
                    result_vec(i) = result_vec(i)
          &                       + start_vec(j)
          &                       * matrix(i,j)
       10  continue

     matrix
          A matrix to multiply start_vec by.

     start_vec
          An n-element vector to multiply by matrix.

     m    The number of elements in start_vec.

     n    The number of elements in result_vec.

     result_vec
          An m-element vector that is the product of matrix and start_vec.

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

SEE ALSO
     vec_$dpostmultn, vec_$ipostmultn16, vec_$postmultn.

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