Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 3/31/2023
Public

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

Document Table of Contents

?lapmr

Rearranges rows of a matrix as specified by a permutation vector.

Syntax

lapack_int LAPACKE_slapmr (int matrix_layout, lapack_logical forwrd, lapack_int m, lapack_int n, float* x, lapack_int ldx, lapack_int * k);

lapack_int LAPACKE_dlapmr (int matrix_layout, lapack_logical forwrd, lapack_int m, lapack_int n, double* x, lapack_int ldx, lapack_int * k);

lapack_int LAPACKE_clapmr (int matrix_layout, lapack_logical forwrd, lapack_int m, lapack_int n, lapack_complex_float* x, lapack_int ldx, lapack_int * k);

lapack_int LAPACKE_zlapmr (int matrix_layout, lapack_logical forwrd, lapack_int m, lapack_int n, lapack_complex_double* x, lapack_int ldx, lapack_int * k);

Include Files
  • mkl.h
Description

The ?lapmr routine rearranges the rows of the m-by-n matrix X as specified by the permutation k[0], k[1], ... , k[m-1] of the integers 1,...,m.

If forwrd is true, forward permutation:

X(k[i-1],:) is moved to X{i,:) for i= 1,2,...,m.

If forwrd is false, backward permutation:

X{i,:) is moved to X(k[i-1,:) for i = 1,2,...,m.

Input Parameters

A <datatype> placeholder, if present, is used for the C interface data types in the C interface section above. See C Interface Conventions for the C interface principal conventions and type definitions.

forwrd

If forwrd is true, forward permutation.

If forwrd is false, backward permutation.

m

The number of rows of the matrix X. m 0.

n

The number of columns of the matrix X. n 0.

x

Array, size at least max(1, ldx*n) for column major and max(1, ldx*m) for row major layout. On entry, the m-by-n matrix X.

ldx

The leading dimension of the array X, ldx max(1,m)for column major layout and ldx max(1,n) for row major layout.

k

Array, size (m). On entry, k contains the permutation vector and is used as internal workspace.

Output Parameters
x

On exit, x contains the permuted matrix X.

k

On exit, k is reset to its original value.

Return Values

This function returns a value info.

If info = 0, the execution is successful.

If info = -i, the i-th parameter had an illegal value.

If info = -1011, memory allocation error occurred.