?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 |
|
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 |
|
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 |
|
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 |
|
When as an output value, it is the second super-diagonal element of U. |
Output |
IPIV |
Integer |
Transposed array. |
Output |
INFO |
Integer |
|
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