Rate This Document
Findability
Accuracy
Completeness
Readability

?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

  • A single-precision floating-point array for spttrf/cpttrf
  • A double-precision floating-point array for dpttrf/zpttrf

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 D after factorization.

Input, output

E

  • A single-precision floating-point array for spttrf
  • A double-precision floating-point array for dpttrf
  • A single-precision complex array for cpttrf
  • A double-precision complex array for zpttrf

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 a sub-diagonal element of matrix A after factorization.

Input, output

INFO

Integer

  • 0: The exit is successful.
  • Smaller than 0: The -INFO-th parameter is invalid.
  • Greater than 0: The INFO-th principal minor is not positive definite.

Output

Dependency

#include "klapack.h"

Examples

C interface:

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