?sptrf
Interface Definition
C interface:
void ssptrf_(const char *uplo, const int *n, float *ap, int *ipiv, int *info);
void dsptrf_(const char *uplo, const int *n, double *ap, int *ipiv, int *info);
void csptrf_(const char *uplo, const int *n, float _Complex *ap, int *ipiv, int *info);
void zsptrf_(const char *uplo, const int *n, double _Complex *ap, int *ipiv, int *info);
Fortran interface:
SSPTRF(UPLO, N, AP, IPIV, INFO);
DSPTRF(UPLO, N, AP, IPIV, INFO);
CSPTRF(UPLO, N, AP, IPIV, INFO);
ZSPTRF(UPLO, N, AP, IPIV, INFO);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
UPLO |
Character |
|
Input |
N |
Integer |
Number of dimensions in matrix A, N ≥ 0. |
Input |
AP |
|
|
Input, output |
IPIV |
Integer |
A transposed array with a size of N, containing details of the interchanges and the block structure of diagonal matrix D.
|
Output |
INFO |
Integer |
|
Output |
Dependency
#include "klapack.h"
Examples
C interface:
const char uplo = 'U';
const int n = 4;
double ap[] = {0.521739, 0.043478, 0.304348, 0.130435, 0.304348, 0.043478, 0.652174, 0.086957, 0.521739, 0.086957};
double ipiv[4];
int info = 0;
dsptrf_(&uplo, &n, ap, ipiv, &info);
if (info != 0) {
printf("ERROR, info = %d\n", info);
}
/*
* Output:
* ap: -0.129534 1.024339 0.302185 -0.492537 -0.044777 -0.728261 1.250000 0.083333 0.250000 0.521739
* ipiv: 1 2 1 1
*/
Fortran interface:
CHARACTER::uplo = "U" PARAMETER (n = 4) INTEGER :: info = 0 REAL(8) :: ap(n*(n+1)/2) INTEGER :: ipiv(n) DATA ap / 0.521739, 0.043478, 0.304348, 0.130435, 0.304348, 0.043478, 0.652174, 0.086957, 0.521739, 0.086957 / EXTERNAL DSPTRF CALL DSPTRF(uplo, n, ap, ipiv, info); * * Output: * ap: -0.129534 1.024339 0.302185 -0.492537 -0.044777 -0.728261 1.250000 0.083333 0.250000 0.521739 * ipiv: 1 2 1 1