VEC_$DSWAP Domain/OS VEC_$DSWAP
NAME
vec_$dswap - swap two double-precision vectors
SYNOPSIS (C)
#include <apollo/base.h>
#include <apollo/vec.h>
void vec_$dswap(
double *vec1,
double *vec2,
long int &length)
SYNOPSIS (Pascal)
%include '/sys/ins/base.ins.pas';
%include '/sys/ins/vec.ins.pas';
procedure vec_$dswap(
var vec1: univ vec_$double_vector;
var vec2: univ vec_$double_vector;
in length: integer32);
SYNOPSIS (FORTRAN)
%include '/sys/ins/base.ins.ftn'
%include '/sys/ins/vec.ins.ftn'
parameter (nvec = 10)
double precision vec1(nvec), vec2(nvec)
integer*4 length
call vec_$dswap(vec1, vec2, length)
DESCRIPTION
Vec_$dswap swaps length elements between the double-precision vectors
vec1 and vec2.
In C, the resulting operation is
for (i = 0; i < length, ++i) {
temp = vec1[i];
vec1[i] = vec2[i];
vec2[i] = temp;
}
In Pascal, the resulting operation is
for i := 1 to length do
begin
temp := vec1[i];
vec1[i] := vec2[i];
vec2[i] := temp;
end
In FORTRAN, the resulting operation is
do 10 i = 1, length
temp = vec1(i)
vec1(i) = vec2(i)
vec2(i) = temp
10 continue
vec1 The vector to be swapped with vec2.
vec2 The vector to be swapped with vec1.
length
The number of elements to swap.
NOTES
When vec_$dswap is used to operate on matrixes in C and Pascal, vec1 and
vec2 are row vectors; whereas in FORTRAN, they are column vectors.
SEE ALSO
vec_$dswap_i, vec_$iswap, vec_$iswap16, vec_$swap.