Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

p?swap

Swaps two distributed vectors.

Syntax

void psswap (const MKL_INT *n , float *x , const MKL_INT *ix , const MKL_INT *jx , const MKL_INT *descx , const MKL_INT *incx , float *y , const MKL_INT *iy , const MKL_INT *jy , const MKL_INT *descy , const MKL_INT *incy );

void pdswap (const MKL_INT *n , double *x , const MKL_INT *ix , const MKL_INT *jx , const MKL_INT *descx , const MKL_INT *incx , double *y , const MKL_INT *iy , const MKL_INT *jy , const MKL_INT *descy , const MKL_INT *incy );

void pcswap (const MKL_INT *n , MKL_Complex8 *x , const MKL_INT *ix , const MKL_INT *jx , const MKL_INT *descx , const MKL_INT *incx , MKL_Complex8 *y , const MKL_INT *iy , const MKL_INT *jy , const MKL_INT *descy , const MKL_INT *incy );

void pzswap (const MKL_INT *n , MKL_Complex16 *x , const MKL_INT *ix , const MKL_INT *jx , const MKL_INT *descx , const MKL_INT *incx , MKL_Complex16 *y , const MKL_INT *iy , const MKL_INT *jy , const MKL_INT *descy , const MKL_INT *incy );

Include Files

  • mkl_pblas.h

Description

Given two distributed vectors sub(x) and sub(y), the p?swap routines return vectors sub(y) and sub(x) swapped, each replacing the other.

Here sub(x) denotes X(ix, jx:jx+n-1) if incx=m_x, and X(ix: ix+n-1, jx) if incx= 1;

sub(y) denotes Y(iy, jy:jy+n-1) if incy=m_y, and Y(iy: iy+n-1, jy) if incy= 1.

Input Parameters

n

(global) The length of distributed vectors, n0.

x

(local)

Array, size (jx-1)*m_x + ix+(n-1)*abs(incx)).

This array contains the entries of the distributed vector sub(x).

ix, jx

(global) The row and column indices in the distributed matrix X indicating the first row and the first column of the submatrix sub(X), respectively.

descx

(global and local) array of dimension 9. The array descriptor of the distributed matrix X.

incx

(global) Specifies the increment for the elements of sub(x). Only two values are supported, namely 1 and m_x. incx must not be zero.

y

(local)

Array, size (jy-1)*m_y + iy+(n-1)*abs(incy)).

This array contains the entries of the distributed vector sub(y).

iy, jy

(global) The row and column indices in the distributed matrix Y indicating the first row and the first column of the submatrix sub(Y), respectively.

descy

(global and local) array of dimension 9. The array descriptor of the distributed matrix Y.

incy

(global) Specifies the increment for the elements of sub(y). Only two values are supported, namely 1 and m_y. incy must not be zero.

Output Parameters

x

Overwritten by distributed vector sub(y).

y

Overwritten by distributed vector sub(x).