1*1858f998SYi Kong /*
2*1858f998SYi Kong * Written by T. H. Do, 1/23/98, SGI/CRAY Research.
3*1858f998SYi Kong */
4*1858f998SYi Kong #include <string.h>
5*1858f998SYi Kong #include "cblas.h"
6*1858f998SYi Kong #include "cblas_test.h"
7*1858f998SYi Kong
get_transpose_type(char * type,enum CBLAS_TRANSPOSE * trans)8*1858f998SYi Kong void get_transpose_type(char *type, enum CBLAS_TRANSPOSE *trans) {
9*1858f998SYi Kong if( (strncmp( type,"n",1 )==0)||(strncmp( type,"N",1 )==0) )
10*1858f998SYi Kong *trans = CblasNoTrans;
11*1858f998SYi Kong else if( (strncmp( type,"t",1 )==0)||(strncmp( type,"T",1 )==0) )
12*1858f998SYi Kong *trans = CblasTrans;
13*1858f998SYi Kong else if( (strncmp( type,"c",1 )==0)||(strncmp( type,"C",1 )==0) )
14*1858f998SYi Kong *trans = CblasConjTrans;
15*1858f998SYi Kong else *trans = UNDEFINED;
16*1858f998SYi Kong }
17*1858f998SYi Kong
get_uplo_type(char * type,enum CBLAS_UPLO * uplo)18*1858f998SYi Kong void get_uplo_type(char *type, enum CBLAS_UPLO *uplo) {
19*1858f998SYi Kong if( (strncmp( type,"u",1 )==0)||(strncmp( type,"U",1 )==0) )
20*1858f998SYi Kong *uplo = CblasUpper;
21*1858f998SYi Kong else if( (strncmp( type,"l",1 )==0)||(strncmp( type,"L",1 )==0) )
22*1858f998SYi Kong *uplo = CblasLower;
23*1858f998SYi Kong else *uplo = UNDEFINED;
24*1858f998SYi Kong }
get_diag_type(char * type,enum CBLAS_DIAG * diag)25*1858f998SYi Kong void get_diag_type(char *type, enum CBLAS_DIAG *diag) {
26*1858f998SYi Kong if( (strncmp( type,"u",1 )==0)||(strncmp( type,"U",1 )==0) )
27*1858f998SYi Kong *diag = CblasUnit;
28*1858f998SYi Kong else if( (strncmp( type,"n",1 )==0)||(strncmp( type,"N",1 )==0) )
29*1858f998SYi Kong *diag = CblasNonUnit;
30*1858f998SYi Kong else *diag = UNDEFINED;
31*1858f998SYi Kong }
get_side_type(char * type,enum CBLAS_SIDE * side)32*1858f998SYi Kong void get_side_type(char *type, enum CBLAS_SIDE *side) {
33*1858f998SYi Kong if( (strncmp( type,"l",1 )==0)||(strncmp( type,"L",1 )==0) )
34*1858f998SYi Kong *side = CblasLeft;
35*1858f998SYi Kong else if( (strncmp( type,"r",1 )==0)||(strncmp( type,"R",1 )==0) )
36*1858f998SYi Kong *side = CblasRight;
37*1858f998SYi Kong else *side = UNDEFINED;
38*1858f998SYi Kong }
39