?laset
?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 matrixAto be set.If, upper triangular part is set; the strictly lower triangular part ofuplo='U'Ais not changed.If: lower triangular part is set; the strictly upper triangular part ofuplo='L'Ais not changed.Otherwise:All of the matrixAis set.
- m
- The number of rows of the matrixA..m≥0
- n
- The number of columns of the matrixA..n≥0
- alpha,beta
- The constants to which the off-diagonal and diagonal elements are to be set, respectively.
- a
- Array, size at leastmax(1,for column major andlda*n)max(1,for row major layout.lda*m)The arrayacontains them-by-nmatrixA.
- lda
- The leading dimension of the arraya.lda≥max(1,m)for column major layout and lda.≥max(1,n) for row major layout
Output Parameters
- a
- On exit, the leadingm-by-nsubmatrix ofAis set as follows:if,uplo='U',A=ijalpha1≤,i≤j-1, 1≤j≤nif,uplo='L',A=ijalpha,j+1≤i≤m, 1≤j≤notherwise,,A=ijalpha1≤,i≤m, 1≤j≤n,i≠jand, for alluplo,,A=ijbeta1≤.i≤min(m,n)
Return Values
This function returns a value
info
.If , the execution is successful.
info
= 0If , the
info
= i
< 0i
-th parameter had an illegal value.If
, memory allocation error occurred.info
= -1011