1 /*
2  * cblas_dtpsv.c
3  * The program is a C interface to dtpsv.
4  *
5  * Keita Teranishi  5/20/98
6  *
7  */
8 #include "cblas.h"
9 #include "cblas_f77.h"
cblas_dtpsv(const enum CBLAS_ORDER order,const enum CBLAS_UPLO Uplo,const enum CBLAS_TRANSPOSE TransA,const enum CBLAS_DIAG Diag,const CBLAS_INT_TYPE N,const double * Ap,double * X,const CBLAS_INT_TYPE incX)10 void cblas_dtpsv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo,
11                  const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
12                  const CBLAS_INT_TYPE N, const double  *Ap, double  *X, const CBLAS_INT_TYPE incX)
13 {
14    char TA;
15    char UL;
16    char DI;
17 #ifdef F77_CHAR
18    F77_CHAR F77_TA, F77_UL, F77_DI;
19 #else
20    #define F77_TA &TA
21    #define F77_UL &UL
22    #define F77_DI &DI
23 #endif
24 #ifdef F77_INT
25    F77_INT F77_N=N, F77_incX=incX;
26 #else
27    #define F77_N N
28    #define F77_incX incX
29 #endif
30 
31    if (order == CblasColMajor)
32    {
33       if (Uplo == CblasUpper) UL = 'U';
34       else if (Uplo == CblasLower) UL = 'L';
35       else
36       {
37          cblas_xerbla(2, "cblas_dtpsv","Illegal Uplo setting, %d\n", Uplo);
38          return;
39       }
40       if (TransA == CblasNoTrans) TA = 'N';
41       else if (TransA == CblasTrans) TA = 'T';
42       else if (TransA == CblasConjTrans) TA = 'C';
43       else
44       {
45          cblas_xerbla(3, "cblas_dtpsv","Illegal TransA setting, %d\n", TransA);
46          return;
47       }
48       if (Diag == CblasUnit) DI = 'U';
49       else if (Diag == CblasNonUnit) DI = 'N';
50       else
51       {
52          cblas_xerbla(4, "cblas_dtpsv","Illegal Diag setting, %d\n", Diag);
53          return;
54       }
55       #ifdef F77_CHAR
56          F77_UL = C2F_CHAR(&UL);
57          F77_TA = C2F_CHAR(&TA);
58          F77_DI = C2F_CHAR(&DI);
59       #endif
60       F77_dtpsv( F77_UL, F77_TA, F77_DI, &F77_N, Ap, X, &F77_incX);
61    }
62    else if (order == CblasRowMajor)
63    {
64       if (Uplo == CblasUpper) UL = 'L';
65       else if (Uplo == CblasLower) UL = 'U';
66       else
67       {
68          cblas_xerbla(2, "cblas_dtpsv","Illegal Uplo setting, %d\n", Uplo);
69          return;
70       }
71 
72       if (TransA == CblasNoTrans) TA = 'T';
73       else if (TransA == CblasTrans) TA = 'N';
74       else if (TransA == CblasConjTrans) TA = 'N';
75       else
76       {
77          cblas_xerbla(3, "cblas_dtpsv","Illegal TransA setting, %d\n", TransA);
78          return;
79       }
80 
81       if (Diag == CblasUnit) DI = 'U';
82       else if (Diag == CblasNonUnit) DI = 'N';
83       else
84       {
85          cblas_xerbla(4, "cblas_dtpsv","Illegal Diag setting, %d\n", Diag);
86          return;
87       }
88       #ifdef F77_CHAR
89          F77_UL = C2F_CHAR(&UL);
90          F77_TA = C2F_CHAR(&TA);
91          F77_DI = C2F_CHAR(&DI);
92       #endif
93 
94       F77_dtpsv( F77_UL, F77_TA, F77_DI, &F77_N, Ap, X,&F77_incX);
95 
96    }
97    else cblas_xerbla(1, "cblas_dtpsv", "Illegal Order setting, %d\n", order);
98    return;
99 }
100