Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

VEC_$ICOPY16_I                    Domain/OS                     VEC_$ICOPY16_I


NAME
     vec_$icopy16_i - copy a vector from one 16-bit integer matrix to another

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

     void vec_$icopy16_i(
          short *start_vec,
          long int &inc1,
          short *result_vec,
          long int &inc2,
          long int &length)

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

     procedure vec_$icopy16_i(
          in start_vec: univ vec_$integer16_vector;
          in inc1: integer32;
          out result_vec: univ vec_$integer16_vector;
          in inc2: integer32;
          in length: integer32);

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

           parameter (nvec = 10)

           integer*2 start_vec(nvec), result_vec(nvec)
           integer*4 length, inc1, inc2

           call vec_$icopy16_i(start_vec, inc1, result_vec, inc2, length)

DESCRIPTION
     Vec_$icopy16_i copies length elements of the 16-bit integer array
     start_vec selected by inc1 into elements of result_vec selected by inc2.

     Through appropriate choice of inc1 and inc2, a program can use
     vec_$icopy16_i to copy a vector from one matrix to another.  To copy the
     Mth vector in a matrix, choose inc1 equal to the number of vectors in the
     matrix, and place the Mth element of the matrix array at the beginning of
     start_vec.  To place the copy into the Nth vector of a matrix, choose
     inc2 equal to the number of vectors in the resultant matrix, and place
     the Nth element of the matrix array at the beginning of result_vec.

     In C, the resulting operation is

          j = 0;
          k = 0;
          for (i = 0; i < length; ++i) {
               result_vec[k] = start_vec[j];
               k += inc2;
               j += inc1;
          }

     In Pascal, the resulting operation is

          j := 1;
          k := 1;
          for i := 1 to length do
               begin
               result_vec[k] := start_vec[j];
               k := k + inc2;
               j := j + inc1;
               end

     In FORTRAN, the resulting operation is

           j = 1
           k = 1
           do 10 i = 1, length
               result_vec(j) = start_vec(k)
               j = j + inc2
               k = k + inc1
       10  continue

     start_vec
          The array whose elements will be copied to result_vec.

     inc1 Increment for the index of start_vec used to select the elements of
          start_vec that will be copied to result_vec.

     result_vec
          The array resulting from copying elements of start_vec selected by
          inc1 into elements of result_vec selected by inc2.

     inc2 Increment for the index of result_vec used to select the elements of
          result_vec that will receive the copies of the elements of start_vec
          selected by inc1.

     length
          The number of elements in start_vec that will be copied to
          result_vec.

NOTES
     In C and Pascal, vec_$icopy16_i copies column vectors; whereas in FOR-
     TRAN, it copies row vectors.

SEE ALSO
     vec_$copy_i, vec_$dcopy_i, vec_$icopy16, vec_$icopy_i.

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