Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

VEC_$DMAT_MULT                    Domain/OS                     VEC_$DMAT_MULT


NAME
     vec_$dmat_mult - multiply two 4x4 double-precision matrixes

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

     void vec_$dmat_mult(
          double *matrix1,
          double *matrix2,
          double *out_matrix)

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

     procedure vec_$dmat_mult(
          in matrix1: univ vec_$double_matrix;
          in matrix2: univ vec_$double_matrix;
          out out_matrix: univ vec_$double_matrix);

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

           double precision matrix1(4, 4), matrix2(4, 4), out_matrix(4, 4)

           call vec_$dmat_mult(matrix1, matrix2, out_matrix)

DESCRIPTION
     Vec_$dmat_mult multiplies two 4x4 matrixes, matrix1 and matrix2, and sup-
     plies the result in out_matrix.

     In C, vec_$dmat_mult calculates the product of matrix2 on the left and
     matrix1 on the right, and the resulting operation is

          for (i = 0; i < 4; ++i)
               for (j = 0; j < 4; ++j) {
                    out_mat[j,i] = 0.0;
                    for (k = 0; k < 4; ++k)
                         out_mat[j][i] += matrix1[k][i]
                                       * matrix2[j][k];
               }

     In Pascal, vec_$dmat_mult calculates the product of matrix2 on the left
     and matrix1 on the right, and the resulting operation is

          for i := 1 to 4 do
               for j := 1 to 4 do
                    begin
                    out_mat[j,i] := 0.0;
                    for k := 1 to 4 do
                         out_mat[j,i] := out_mat[j,i]
                                      + matrix1[k,i]
                                      * matrix2[j,k];
                    end;

     In FORTRAN, vec_$dmat_mult calculates the product of matrix1 on the left
     and matrix2 on the right, and the resulting operation is

           do 10 i = 1, 4
               do 10 j = 1, 4
                    out_mat(i,j) = 0.0
                    do 10 k = 1, 4
                         out_mat(i,j) = out_mat(i,j)
          &                           + matrix1(i,k)
          &                           * matrix2(k,j)
       10  continue

     matrix1
          A 4x4 matrix.

     matrix2
          Another 4x4 matrix.

     out_matrix
          The product of matrix1 and matrix2.

NOTES
     Vec_$dmat_multn performs the same operations for variably dimensioned
     matrixes.

SEE ALSO
     vec_$imat_mult, vec_$imat_mult16, vec_$mat_mult.

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