Initialize, Copy, Convert APIs#

LASET#

group laset

Functions

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).

LARNV#

group larnv

Functions

template<typename T>
void larnv(integer *idist, integer *iseed, integer *n, T *x)#

LARNV returns a vector of random numbers from a uniform or normal distribution.

Purpose:

  LARNV returns a vector of n random real numbers from a uniform or
  normal distribution.

Parameters:
  • IDIST – [in]

    IDIST is INTEGER

    Specifies the distribution of the random numbers:

    = 1: uniform (0,1)

    = 2: uniform (-1,1)

    = 3: normal (0,1)

  • ISEED – [inout]

    ISEED is INTEGER array, dimension (4)

    On entry, the seed of the random number generator; the array elements must be between 0 and 4095, and ISEED(4) must be odd.

    On exit, the seed is updated.

  • N – [in]

    N is INTEGER

    The number of random numbers to be generated.

  • X – [out]

    X is REAL array, dimension (N)

    The generated random numbers.

LARUV#

group laruv

Functions

template<typename T>
void laruv(integer *iseed, integer *n, T *x)#

LARUV returns a vector of n random real numbers from a uniform distribution.

Purpose:

 LARUV returns a vector of n random real numbers from a uniform (0,1)
 distribution (n <= 128).

 This is an auxiliary routine called by SLARNV and CLARNV.

Parameters:
  • ISEED – [inout]

    ISEED is INTEGER array, dimension (4)

    On entry, the seed of the random number generator; the array elements must be between 0 and 4095, and ISEED(4) must be odd.

    On exit, the seed is updated.

  • N – [in]

    N is INTEGER

    The number of random numbers to be generated. N <= 128.

  • X – [out]

    X is REAL array, dimension (N)

    The generated random numbers.

LACPY#

group lacpy

Functions

template<typename T>
void lacpy(char *uplo, integer *m, integer *n, T *a, integer *lda, T *b, integer *ldb)#

LACPY copies all or part of one two-dimensional array to another.

Purpose:

  LACPY copies all or part of a two-dimensional matrix A to another
  matrix B.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    Specifies the part of the matrix A to be copied to B.

    = ‘U’: Upper triangular part

    = ‘L’: Lower triangular part

    Otherwise: All of the matrix A

  • 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.

  • A – [in]

    A is REAL array, dimension (LDA,N)

    The m by n matrix A. If UPLO = ‘U’, only the upper triangle or trapezoid is accessed; if UPLO = ‘L’, only the lower triangle or trapezoid is accessed.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • B – [out]

    B is REAL array, dimension (LDB,N)

    On exit, B = A in the locations specified by UPLO.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,M).

LACP2#

group lacp2

Functions

template<typename T, typename Ta>
void lacp2(char *uplo, integer *m, integer *n, T *a, integer *lda, Ta *b, integer *ldb)#

LACP2 copies all or part of a real two-dimensional array to a complex array.

Purpose:

  LACP2 copies all or part of a real two-dimensional matrix A to a
  complex matrix B.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    Specifies the part of the matrix A to be copied to B.

    = ‘U’: Upper triangular part

    = ‘L’: Lower triangular part

    Otherwise: All of the matrix A

  • 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.

  • A – [in]

    A is REAL array, dimension (LDA,N)

    The m by n matrix A. If UPLO = ‘U’, only the upper trapezium is accessed; if UPLO = ‘L’, only the lower trapezium is accessed.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • B – [out]

    B is COMPLEX array, dimension (LDB,N)

    On exit, B = A in the locations specified by UPLO.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,M).

TFTTP#

group tfttp

Functions

template<typename T>
void tfttp(char *transr, char *uplo, integer *n, T *arf, T *ap, integer *info)#

TFTTP copies a triangular matrix from the rectangular full

packed format (TF) to the standard packed format (TP).

Purpose:

  TFTTP copies a triangular matrix A from rectangular full packed
  format (TF) to standard packed format (TP).

Parameters:
  • TRANSR – [in]

    TRANSR is CHARACTER*1

    = ‘N’: ARF is in Normal format;

    = ‘T’: ARF is in Transpose format;

  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: A is upper triangular;

    = ‘L’: A is lower triangular.

  • N – [in]

    N is INTEGER

    The order of the matrix A. N >= 0.

  • ARF – [in]

    ARF is REAL array, dimension ( N*(N+1)/2),

    On entry, the upper or lower triangular matrix A stored in RFP format. For a further discussion see Notes below.

  • AP – [out]

    AP is REAL array, dimension ( N*(N+1)/2),

    On exit, the upper or lower triangular matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows:

    if UPLO = ‘U’, AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;

    if UPLO = ‘L’, AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

TFTTR#

group tfttr

Functions

template<typename T>
void tfttr(char *transr, char *uplo, integer *n, T *arf, T *a, integer *lda, integer *info)#

TFTTR copies a triangular matrix from the rectangular full

packed format (TF) to the standard full format (TR).

Purpose:

  TFTTR copies a triangular matrix A from rectangular full packed
  format (TF) to standard full format (TR).

Parameters:
  • TRANSR – [in]

    TRANSR is CHARACTER*1

    = ‘N’: ARF is in Normal format;

    = ‘T’: ARF is in Transpose format.

  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: A is upper triangular;

    = ‘L’: A is lower triangular.

  • N – [in]

    N is INTEGER

    The order of the matrices ARF and A. N >= 0.

  • ARF – [in]

    ARF is REAL array, dimension (N*(N+1)/2).

    On entry, the upper (if UPLO = ‘U’) or lower (if UPLO = ‘L’) matrix A in RFP format. See the “Notes” below for more details.

  • A – [out]

    A is REAL array, dimension (LDA,N)

    On exit, the triangular matrix A. If UPLO = ‘U’, the leading N-by-N upper triangular part of the array A contains the upper triangular matrix, and the strictly lower triangular part of A is not referenced. If UPLO = ‘L’, the leading N-by-N lower triangular part of the array A contains the lower triangular matrix, and the strictly upper triangular part of A is not referenced.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,N).

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

TPTTF#

group tpttf

Functions

template<typename T>
void tpttf(char *transr, char *uplo, integer *n, T *ap, T *arf, integer *info)#

TPTTF copies a triangular matrix from the standard packed

format (TP) to the rectangular full packed format (TF).

Purpose:

  TPTTF copies a triangular matrix A from standard packed format (TP)
  to rectangular full packed format (TF).

Parameters:
  • TRANSR – [in]

    TRANSR is CHARACTER*1

    = ‘N’: ARF in Normal format is wanted;

    = ‘T’: ARF in Conjugate-transpose format is wanted.

  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: A is upper triangular;

    = ‘L’: A is lower triangular.

  • N – [in]

    N is INTEGER

    The order of the matrix A. N >= 0.

  • AP – [in]

    AP is REAL array, dimension ( N*(N+1)/2),

    On entry, the upper or lower triangular matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows:

    if UPLO = ‘U’, AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;

    if UPLO = ‘L’, AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.

  • ARF – [out]

    ARF is REAL array, dimension ( N*(N+1)/2),

    On exit, the upper or lower triangular matrix A stored in RFP format. For a further discussion see Notes below.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

TPTTR#

group tpttr

Functions

template<typename T>
void tpttr(char *uplo, integer *n, T *ap, T *a, integer *lda, integer *info)#

TPTTR copies a triangular matrix from the standard

packed format (TP) to the standard full format (TR).

Purpose:

  TPTTR copies a triangular matrix A from standard packed format (TP)
  to standard full format (TR).

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: A is upper triangular.

    = ‘L’: A is lower triangular.

  • N – [in]

    N is INTEGER

    The order of the matrix A. N >= 0.

  • AP – [in]

    AP is REAL array, dimension ( N*(N+1)/2),

    On entry, the upper or lower triangular matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows:

    if UPLO = ‘U’, AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;

    if UPLO = ‘L’, AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.

  • A – [out]

    A is REAL array, dimension ( LDA, N)

    On exit, the triangular matrix A. If UPLO = ‘U’, the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = ‘L’, the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,N).

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

TRTTF#

group trttf

Functions

template<typename T>
void trttf(char *transr, char *uplo, integer *n, T *a, integer *lda, T *arf, integer *info)#

TRTTF copies a triangular matrix from the standard full

format (TR) to the rectangular full packed format (TF).

Purpose:

  TRTTF copies a triangular matrix A from standard full format (TR)
  to rectangular full packed format (TF) .

Parameters:
  • TRANSR – [in]

    TRANSR is CHARACTER*1

    = ‘N’: ARF in Normal form is wanted;

    = ‘T’: ARF in Transpose form is wanted.

  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: Upper triangle of A is stored;

    = ‘L’: Lower triangle of A is stored.

  • N – [in]

    N is INTEGER

    The order of the matrix A. N >= 0.

  • A – [in]

    A is REAL array, dimension (LDA,N).

    On entry, the triangular matrix A. If UPLO = ‘U’, the leading N-by-N upper triangular part of the array A contains the upper triangular matrix, and the strictly lower triangular part of A is not referenced. If UPLO = ‘L’, the leading N-by-N lower triangular part of the array A contains the lower triangular matrix, and the strictly upper triangular part of A is not referenced.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the matrix A. LDA >= fla_max(1,N).

  • ARF – [out]

    ARF is REAL array, dimension (NT).

    NT=N*(N+1)/2. On exit, the triangular matrix A in RFP format.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

TRTTP#

group trttp

Functions

template<typename T>
void trttp(char *uplo, integer *n, T *a, integer *lda, T *ap, integer *info)#

TRTTP copies a triangular matrix from the standard full

format (TR) to the standard packed format (TP).

Purpose:

 TRTTP copies a triangular matrix A from full format (TR) to standard
 packed format (TP).

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: A is upper triangular.

    = ‘L’: A is lower triangular.

  • N – [in]

    N is INTEGER

    The order of the matrices AP and A. N >= 0.

  • A – [in]

    A is REAL array, dimension (LDA,N)

    On exit, the triangular matrix A. If UPLO = ‘U’, the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = ‘L’, the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,N).

  • AP – [out]

    AP is REAL array, dimension (N*(N+1)/2)

    On exit, the upper or lower triangular matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows:

    if UPLO = ‘U’, AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;

    if UPLO = ‘L’, AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value