Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

VEC_$SP_DP_I                      Domain/OS                       VEC_$SP_DP_I


NAME
     vec_$sp_dp_i - copy a single-precision vector to a double-precision vec-
     tor in matrixes

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

     void vec_$sp_dp_i(
          float *sp_vec,
          long int &inc1,
          double *dp_vec,
          long int &inc2,
          long int &length)

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

     procedure vec_$sp_dp_i(
          in sp_vec: univ vec_$real_vector;
          in inc1: integer32;
          in dp_vec: univ vec_$double_vector;
          in inc2: integer32;
          in length: integer32) ;

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

           parameter (nvec = 10)

           double precision dp_vec(nvec)
           real sp_vec(nvec)
           integer*4 length, inc1, inc2

           call vec_$sp_dp_i(sp_vec, inc1, dp_vec, inc2, length)

DESCRIPTION
     Vec_$sp_dp_i copies length elements selected by inc1 from the single-
     precision array sp_vec to elements of the double-precision array dp_vec
     chosen by inc2.

     Through appropriate choice of inc1 and inc2, a program can use
     vec_$sp_dp_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
     sp_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 dp_vec.

     In C, the resulting operation is

          j = 0;
          k = 0;
          for (i = 0; i < length; ++i) {
               dp_vec[i] = (double)sp_vec[i];
               j += inc1;
               k += inc2;
          }

     In Pascal, the resulting operation is

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

     In FORTRAN, the resulting operation is

           j = 1
           k = 1
           do 10 i = 1, length
               dp_vec(k) = dble(sp_vec(j))
               j = j + inc1
               k = k + inc2
       10  continue

     sp_vec
          The single-precision array to copy from.

     inc1 Increment for the index of sp_vec that selects the elements to copy
          from.

     dp_vec
          The double-precision array to copy to.

     inc2 Increment for the index of dp_vec that selects the elements to copy
          to.

     length
          The number of elements to copy from sp_vec to dp_vec.

NOTES
     In C and Pascal, vec_$sp_dp_i copies column vectors; whereas in FORTRAN,
     it copies row vectors.

SEE ALSO
     vec_$dp_sp_i, vec_$sp_dp.

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