LASET - 5.2 English - 68552

AOCL API Guide (68552)

Document ID
68552
Release Date
2025-12-29
Version
5.2 English
template<typename T>
void laset(char *uplo, integer *m, integer *n, T *alpha, T *beta, T *a, integer *lda)#

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

Purpose:

  Initialize an m-by-n matrix a to beta on the diagonal and alpha on the offdiagonals.
Parameters:
  • uplo[in]

    uplo is char*

    Specifies the part of the matrix a to be set.

    = ‘U’: Upper triangular part is set; the strictly lower triangular part of a is not changed.

    = ‘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[in]

    m is integer*

    The number of rows of the matrix a. m >= 0.

  • n[in]

    n is integer*

    The number of columns of the matrix a. n >= 0.

  • alpha[in]

    alpha is float/double/COMPLEX/COMPLEX*16*

    The constant to which the offdiagonal elements are to be set.

  • beta[in]

    beta is float/double/COMPLEX/COMPLEX*16*

    The constant to which the diagonal elements are to be set.

  • a[out]

    a is float/double/COMPLEX/COMPLEX*16 array, dimension (lda,n)

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

    if uplo = ‘U’, A(i,j) = alpha, 1<=i<=j-1, 1<=j<=n,

    if uplo = ‘L’, A(i,j) = alpha, j+1<=i<=m, 1<=j<=n,

    otherwise, A(i,j) = alpha, 1<=i<=m, 1<=j<=n, i.ne.j,

    and, for all uplo, A(i,i) = beta, 1<=i<=min(m,n).

  • lda[in]

    lda is integer*

    The leading dimension of the array a. lda >= fla_max(1,m).