Rate This Document
Findability
Accuracy
Completeness
Readability

?tpsv

Solving linear equations. The coefficient matrix is a triangular matrix expanded according to the triangle.

, or

b and x are vectors including n elements, and A is a triangular matrix of n x n units or non-units expanded according to a triangle.

Interface Definition

C interface:

void cblas_stpsv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const BLASINT N, const float *Ap, float *X, const BLASINT incX);

void cblas_dtpsv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const BLASINT N, const double *Ap, double *X, const BLASINT incX);

void cblas_ctpsv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const BLASINT N, const void *Ap, void *X, const BLASINT incX);

void cblas_ztpsv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const BLASINT N, const void *Ap, void *X, const BLASINT incX);

Fortran interface:

CALL STPSV(UPLO, TRANS, DIAG, N, AP, X, INCX)

CALL DTPSV(UPLO, TRANS, DIAG, N, AP, X, INCX)

CALL CTPSV(UPLO, TRANS, DIAG, N, AP, X, INCX)

CALL ZTPSV(UPLO, TRANS, DIAG, N, AP, X, INCX)

Parameters

Parameter

Type

Description

Input/Output

order

Enumeration type CBLAS_ORDER

Indicates whether the matrix is in row- or column-major order.

Input

Uplo

Enumeration type CBLAS_UPLO

Indicates that matrix A is used to store the upper triangle or lower triangle.

  • If Uplo=CblasUpper, the upper triangle of A is used for expansion.
  • If Uplo=CblasLower, the lower triangle part of A is used for expansion.

Input

TransA

Enumeration type CBLAS_TRANSPOSE

The matrix A is a conventional matrix, a transposed matrix, or a conjugate matrix.

  • If trans=CblasNoTrans, then .
  • If trans=CblasTrans, then .
  • If trans=CblasConjTrans, then .

Input

Diag

Enumeration type CBLAS_DIAG

Indicates whether A is a unit trigonometric array.

  • If Diag=CblasUnit, A is a unit triangular matrix.
  • If Diag=CblasNonUnit, A is not a unit triangular matrix.

Input

N

Integer

Order of the matrix A, and N is required to be greater than or equal to zero.

Input

Ap

  • For stpmv, Ap is of single-precision floating-point type.
  • For dtpmv, Ap is of double-precision floating-point type.
  • For ctpmv, Ap is of single-precision complex number type.
  • For ztpmv, Ap is of double-precision complex number type.

The size of a compressed triangular matrix is at least (N*(N+1)/2).

Input

X

  • For stpmv, X is of single-precision floating-point type.
  • For dtpmv, X is of double-precision floating-point type.
  • For ctpmv, X is of single-precision complex number type.
  • For ztpmv, X is of double-precision complex number type.

Vector X. The vector scale is at least (1+(N-1)*abs(incX)).

The output is updated after the equation is solved.

Input/Output

incX

Integer

Vector increase step in X. The value cannot be 0.

Input

Dependencies

#include "kblas.h"

Examples

C interface:

    int  n = 4,incx = 1; 
    float x[4] = {4.0, 3.0, 2.0, 1.0}; 
    /** 
     *        |  1.0 1.0  1.0  3.0 | 
     * A   =  |  .   3.0  3.0  2.0 | 
     *        |  .    .   2.0  3.0 | 
     *        |  .    .    .   1.0 | 
     */ 
    float ap[10] = {1.0, 1.0, 3.0, 1.0, 3.0, 2.0, 3.0, 2.0, 3.0, 1.0}; 
 
    cblas_stpsv(CblasColMajor, CblasUpper, CblasTrans, CblasNonUnit, n, ap, x, incx); 
    /** 
     * Output x = |4.000000, -0.333333, -0.500000, -8.833333| 
     */

Fortran interface:

      INTEGER :: N=4, INCX=1 
      REAL(4) :: X(4), AP(10) 
      DATA X/4.0, 3.0, 2.0, 1.0/ 
      DATA AP/1.0, 1.0, 3.0, 1.0, 3.0, 2.0, 3.0, 2.0, 3.0, 1.0/ 
      EXTERNAL STPSV 
      CALL STPSV('U', 'T', 'N', N, AP, X, INCX) 
 
*     Output X = |4.000000, -0.333333, -0.500000, -8.833333|