Rate This Document
Findability
Accuracy
Completeness
Readability

?gttrf

Interface Definition

C interface:

void sgttrf(const int *N, float *DL, float *D, float *DU, float *DU2, int *IPIV, int *INFO);

void dgttrf(const int *N, double *DL, double *D, double *DU, double *DU2, int *IPIV, int *INFO);

void cgttrf(const int *N, float _Complex *DL, float _Complex *D, float _Complex *DU, float _Complex *DU2, int *IPIV, int *INFO);

void zgttrf(const int *N, double _Complex *DL, double _Complex *D, double _Co mplex *DU, double _Complex *DU2, int *IPIV, int *INFO);

Fortran interface:

SGTTRF(N,DL,D,DU,DU2,IPIV,INFO);

DGTTRF(N,DL,D,DU,DU2,IPIV,INFO);

CGTTRF(N,DL,D,DU,DU2,IPIV,INFO);

ZGTTRF(N,DL,D,DU,DU2,IPIV,INFO);

Parameters

Parameter

Type

Description

Input/Output

N

Integer

Number of dimensions in matrix A, N ≥ 0.

Input

DL

  • A single-precision floating-point array for sgttrf
  • A double-precision floating-point array for dgttrf
  • A single-precision complex array for cgttrf
  • A double-precision complex array for zgttrf

When as an input value, it is a sub-diagonal element of tridiagonal matrix A, and its dimension is N-1.

When as an output value, it is matrix L.

Input, output

D

  • A single-precision floating-point array for sgttrf
  • A double-precision floating-point array for dgttrf
  • A single-precision complex array for cgttrf
  • A double-precision complex array for zgttrf

When as an input value, it is a diagonal element of tridiagonal matrix A, and its dimension is N.

When as an output value, it is a diagonal element of U.

Input, output

DU

  • A single-precision floating-point array for sgttrf
  • A double-precision floating-point array for dgttrf
  • A single-precision complex array for cgttrf
  • A double-precision complex array for zgttrf

When as an input value, it is a super-diagonal element of tridiagonal matrix A, and its dimension is N-1.

When as an output value, it is the first super-diagonal element of U.

Input, output

DU2

  • A single-precision floating-point array for sgttrf
  • A double-precision floating-point array for dgttrf
  • A single-precision complex array for cgttrf
  • A double-precision complex array for zgttrf

When as an output value, it is the second super-diagonal element of U.

Output

IPIV

Integer

Transposed array.

Output

INFO

Integer

  • 0: The exit is successful.
  • Smaller than 0: The value of the -info-th parameter is invalid.
  • Greater than 0: U(INFO, INFO) is 0 and the factorization fails.

Output

Dependency

#include "klapack.h"

Examples

C interface:

const int n = 4;
double dl[] = {0.923077, 0.153846, 0.153846};
double d[] = {0.521739, 0.043478, 0.304348, 0.086957};
double du[] = {0.924528, 0.150943, 0.566038};
double du2[] = {0.986301, 0.397260};
double ipiv[4];
int info = 0;
dgttrf_(&n, dl, d, du, du2, ipiv, &info);
if (info != 0) {
    printf("ERROR, info = %d\n", info);
}

/* 
* Output: 
*   d:    0.923077        0.899954        0.318932        -0.186088
*   dl:   0.565217        0.170949        0.482378
*   du:   0.043478        -0.085316       0.566038
*   du2:  0.150943        0.000000
*   ipiv: 2       2       3       4
*/

Fortran interface:

PARAMETER (n = 4)  
INTEGER :: info = 0 
REAL(8) :: d(n) 
REAL(8) :: dl(n-1)
REAL(8) :: du(n-1)
REAL(8) :: du2(n-2)
INTEGER :: ipiv(n)
  
DATA d / 0.521739, 0.043478, 0.304348, 0.086957 / 
DATA dl / 0.923077, 0.153846, 0.153846 /
DATA du / 0.924528, 0.150943, 0.566038 /
DATA du2 / 0.986301, 0.397260 /
 EXTERNAL DGTTRF 
 CALL DGTTRF(n, dl, d, du, du2, ipiv, info);
* 
* Output: 
*   d:    0.923077        0.899954        0.318932        -0.186088
*   dl:   0.565217        0.170949        0.482378
*   du:   0.043478        -0.085316       0.566038
*   du2:  0.150943        0.000000
*   ipiv: 2       2       3       4