Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 10/31/2024
Public
Document Table of Contents

?laset

Initializes the off-diagonal elements and the diagonal elements of a matrix to given values.

Syntax

lapack_int LAPACKE_slaset (int matrix_layout , char uplo , lapack_int m , lapack_int n , float alpha , float beta , float * a , lapack_int lda );

lapack_int LAPACKE_dlaset (int matrix_layout , char uplo , lapack_int m , lapack_int n , double alpha , double beta , double * a , lapack_int lda );

lapack_int LAPACKE_claset (int matrix_layout , char uplo , lapack_int m , lapack_int n , lapack_complex_float alpha , lapack_complex_float beta , lapack_complex_float * a , lapack_int lda );

lapack_int LAPACKE_zlaset (int matrix_layout , char uplo , lapack_int m , lapack_int n , lapack_complex_double alpha , lapack_complex_double beta , lapack_complex_double * a , lapack_int lda );

Include Files

  • mkl.h

Description

The routine initializes an m-by-n matrix A to beta on the diagonal and alpha on the off-diagonals.

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.

matrix_layout

Specifies whether matrix storage layout is row major (LAPACK_ROW_MAJOR) or column major ( LAPACK_COL_MAJOR ).

uplo

Specifies the part of the matrix A to be set.

If uplo = 'U', upper triangular part is set; the strictly lower triangular part of A is not changed.

If uplo = 'L': lower triangular part is set; the strictly upper triangular part of A is not changed.

Otherwise: All of the matrix A is set.

m

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

n

The number of columns of the matrix A.

n 0.

alpha, beta

The constants to which the off-diagonal and diagonal elements are to be set, respectively.

a

Array, size at least max(1, lda*n) for column major and max(1, lda*m) for row major layout.

The array a contains the m-by-n matrix A.

lda

The leading dimension of the array a.

lda max(1,m) for column major layout and lda max(1,n) for row major layout.

Output Parameters

a

On exit, the leading m-by-n submatrix of A is set as follows:

if uplo = 'U', Aij = alpha, 1≤ij-1, 1≤jn,

if uplo = 'L', Aij = alpha, j+1≤im, 1≤jn,

otherwise, Aij = alpha, 1≤im, 1≤jn, ij,

and, for all uplo, Aii = beta, 1≤i≤min(m, n).

Return Values

This function returns a value info.

If info = 0, the execution is successful.

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

If info = -1011, memory allocation error occurred.