VEC_$DP_SP Domain/OS VEC_$DP_SP
NAME
vec_$dp_sp - copy a double-precision vector to a single-precision vector
SYNOPSIS (C)
#include <apollo/base.h>
#include <apollo/vec.h>
void vec_$dp_sp(
double *dp_vec,
float *sp_vec,
long int &length)
SYNOPSIS (Pascal)
%include '/sys/ins/base.ins.pas';
%include '/sys/ins/vec.ins.pas';
procedure vec_$dp_sp(
in dp_vec: univ vec_$double_vector;
in sp_vec: univ vec_$real_vector;
in length: integer32);
SYNOPSIS (FORTRAN)
%include '/sys/ins/base.ins.ftn'
%include '/sys/ins/vec.ins.ftn'
parameter (nvec = 10)
real sp_vec(nvec)
double precision dp_vec(nvec)
integer*4 length
call vec_$dp_sp(dp_vec, sp_vec, length)
DESCRIPTION
Vec_$dp_sp copies length elements from the double-precision vector dp_vec
to the single-precision vector sp_vec.
In C, the resulting operation is
for (i = 0; i < length; ++i)
sp_vec[i] = (float)dp_vec[i];
In Pascal, the resulting operation is
for i := 1 to length do
begin
sp_vec[i] := dp_vec[i];
end
In FORTRAN, the resulting operation is
do 10 i=1, length
sp_vec(i) = sngl(dp_vec(i))
10 continue
dp_vec
The double-precision vector to copy from.
sp_vec
The single-precision vector to copy to.
length
The number of elements to copy.
NOTES
In C and Pascal, vec_$dp_sp copies a row vector; whereas in FORTRAN, it
copies a column vector.
SEE ALSO
vec_$dp_sp_i, vec_$sp_dp.