Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

VEC_$MULT_ADD                     Domain/OS                      VEC_$MULT_ADD


NAME
     vec_$mult_add - scale and add one single-precision vector to another

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

     void vec_$mult_add(
          float *add_vec,
          float *mult_vec,
          long int &length,
          float &constant,
          float *result_vec)

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

     procedure vec_$mult_add(
          in add_vec: univ vec_$real_vector;
          in mult_vec: univ vec_$real_vector;
          in length: integer32;
          in constant: real;
          out result_vec: univ vec_$real_vector);

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

           parameter (nvec = 10)

           real add_vec(nvec), mult_vec(nvec), result_vec(nvec), constant
           integer*4 length

           call vec_$mult_add(add_vec, mult_vec, length,
          &                   constant, result_vec)

DESCRIPTION
     Vec_$mult_add multiplies the vector mult_vec by the scalar constant, adds
     the product to the vector add_vec, and supplies the resulting vector in
     result_vec.

     In C, the resulting operation is

          for (i = 0; i< length; ++i)
               result_vec[i] = add_vec[i]
                             + constant * mult_vec[i];

     In Pascal, the resulting operation is

          for i := 1 to length do
               result_vec[i] := add_vec[i]
                             + constant * mult_vec[i];

     In FORTRAN, the resulting operation is

           do 10 i = 1, length
               result_vec(i) = add_vec(i)
          &                  + constant * mult_vec(i)
       10  continue

     add_vec
          The vector to add to the product of mult_vec and constant.

     mult_vec
          The vector to scale by constant and add to add_vec.

     length
          The number of elements to use in the calculation.

     constant
          The scalar value used to scale mult_vec.

     result_vec
          The vector resulting from multiplying mult_vec by constant and
          adding the product to add_vec.

NOTES
     When vec_$mult_add is used to operate on matrixes in C and Pascal,
     add_vec, mult_vec, and result_vec are row vectors; whereas in FORTRAN,
     they are column vectors.

SEE ALSO
     vec_$dmult_add, vec_$imult_add, vec_$imult_add16, vec_$mult_add_i.

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