Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

VEC_$MULT_CONSTANT                Domain/OS                 VEC_$MULT_CONSTANT


NAME
     vec_$mult_constant - multiply a single-precision vector by a scalar

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

     void vec_$mult_constant(
          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_constant(
          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 mult_vec(nvec), result_vec(nvec), constant
           integer*4 length

           call vec_$mult_constant(mult_vec, length, constant, result_vec)

DESCRIPTION
     Vec_$mult_constant multiplies the single-precision array mult_vec by the
     scalar value constant and supplies the result in the array result_vec.

     In C, the resulting operation is

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

     In Pascal, the resulting operation is

          for i := 1 to length do
               begin
               result_vec[i] := constant * start_vec[i];
               end

     In FORTRAN, the resulting operation is

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

     mult_vec
          The vector to multiply by constant.

     length
          The number of elements to multiply.

     constant
          The scalar constant to multiply mult_vec by.

     result_vec
          The vector resulting from multiplying mult_vec by constant.

NOTES
     When vec_$mult_constant is used to operate on matrixes in C and Pascal,
     mult_vec and result_vec are row vectors; in FORTRAN, they are column vec-
     tors.

SEE ALSO
     vec_$add_constant, vec_$sub_constant, vec_$dmult_constant,
     vec_$imult_constant, vec_$imult_constant16, vec_$mult_constant_i.

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