?pttrf
Compute the LDL* or U*DU factorization of a real (conjugate) symmetric positive definite tridiagonal matrix A, where D is a diagonal block matrix, L is a lower triangular matrix, and U is an upper triangular matrix.
Interface Definition
C interface:
void spttrf_(const int *N, float *D, float *E, int *INFO);
void dpttrf_(const int *N, double *D, double *E, int *INFO);
void cpttrf_(const int *N, float *D, float _Complex *E, int *INFO);
void zpttrf_(const int *N, double *D, double _Complex *E, int *INFO);
Fortran interface:
SPTTRF(N, D, E, INFO);
DPTTRF(N, D, E, INFO);
CPTTRF(N, D, E, INFO);
ZPTTRF(N, D, E, INFO);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
N |
Integer |
Number of dimensions in matrix A, N ≥ 0. |
Input |
D |
|
As an input value, it represents a diagonal element of tridiagonal matrix A, with a dimension of N. As an output value, it represents a diagonal element D after factorization. |
Input, output |
E |
|
As an input value, it represents a sub-diagonal element of tridiagonal matrix A, with a dimension of N-1. As an output value, it represents a sub-diagonal element of matrix A after factorization. |
Input, output |
INFO |
Integer |
|
Output |
Dependency
#include "klapack.h"
Examples
C interface:
1 2 3 4 5 6 7 8 9 10 | const int n = 4; double d[] = {103.608696, 103.739130, 103.347826, 100.652174}; double e[] = {0.352941, 0.000000, 0.823529}; int info = 0; dpttrf_(&n, d, e, &info); /* * Output: * d: 103.608696 103.737928 103.347826 100.645612 * e: 0.003406 0.000000 0.007969 */ |
Fortran interface:
PARAMETER (n = 4) INTEGER :: info = 0 REAL(8) :: d(n) REAL(8) :: e(n-1) DATA d / 103.608696, 103.739130, 103.347826, 100.652174 / DATA e / 0.352941,0.000000,0.823529/ EXTERNAL DPTTRF CALL DPTTRF (n, d, e, info) * Output: * d: 103.608696 103.737928 103.347826 100.645612 * e: 0.003406 0.000000 0.007969