我要评分
获取效率
正确性
完整性
易理解

?ptts2

Interface Definition

C interface:

void sptts2_(const int *N, const int *NRHS, float *D, float *E, float *B, const int *LDB);

void dptts2_(const int *N, const int *NRHS, double *D, double *E, double *B, const int *LDB);

void cptts2_(const int *IUPLO, const int *N, const int *NRHS, float *D, float _Complex *E, float _Complex *B, const int *LDB);

void zptts2_(const int *IUPLO, const int *N, const int *NRHS, double *D, double _Complex *E, double _Complex *B, const int *LDB);

Fortran interface:

SPTTS2(N, NRHS, D, E, B, LDB);

DPTTS2(N, NRHS, D, E, B, LDB);

CPTTS2(IUPLO, N, NRHS, D, E, B, LDB);

ZPTTS2(IUPLO, N, NRHS, D, E, B, LDB);

Parameters

Parameter

Type

Description

Input/Output

IUPLO (specific to complex numbers)

Integer

  • 1: A=U**H*D*U
  • 0: A=L*D*L**H

Input

N

Integer

Number of dimensions of matrix A, N ≥ 0.

Input

NRHS

Integer

Number of columns in matrix B, NRHS ≥ 0.

Input

D

  • For sptts2/cptts2, D is a single-precision floating-point array.
  • For dptts2/zptts2, D is a double-precision floating-point array.

Diagonal element of tridiagonal matrix A, with a dimension of N.

Input

E

  • A single-precision floating-point array for sptts2
  • A double-precision floating-point array for dptts2
  • A single-precision complex array for cptts2
  • A double-precision complex array for zptts2

Sub-diagonal element of tridiagonal matrix A, with a dimension of N-1.

Input

B

  • A single-precision floating-point array for sptts2
  • A double-precision floating-point array for dptts2
  • A single-precision complex array for cptts2
  • A double-precision complex array for zptts2

When as an input value, it is a right-hand side matrix, and the dimension is (LDB, NRHS).

When as an output value, it is the result X, and the dimension is (LDB, NRHS).

Input, output

LDB

Integer

Leading dimension of matrix B.

Input

Dependency

#include "klapack.h"

Examples

C interface:

    const int n = 4;
    const int ldb = n;
    const int nrhs = 1;
    double d[] = {7.608696,7.739130, 7.347826,4.652174};
    double e[] = {0.352941,0.000000,0.823529};
    double b[] = {0.300000,0.100000,0.700000,0.200000};
    
    dptts2_(&n, &nrhs, d, e, b, &ldb);
/* 
* Output: 
*   b: 0.039697        -0.000760       0.161909        -0.080924
*/

Fortran interface:

PARAMETER (n = 4) 
PARAMETER (ldb = 4)
PARAMETER (nrhs = 1) 
REAL(8) :: d(n) 
REAL(8) :: e(n-1)
REAL(8) :: b(ldb, nrhs)  
  
DATA d / 7.608696,7.739130, 7.347826,4.652174 / 
DATA e / 0.352941,0.000000,0.823529 /
DATA b / 0.300000,0.100000,0.700000,0.200000 /
 EXTERNAL DPTTS2 
 CALL DPTTS2(n, nrhs, d, e, b, ldb);
* 
* Output: 
*  b: 0.039697        -0.000760       0.161909        -0.080924