- Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathauxiliary.c
38 lines (36 loc) · 1.28 KB
/
auxiliary.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* Written by T. H. Do, 1/23/98, SGI/CRAY Research.
*/
#include<string.h>
#include"cblas.h"
#include"cblas_test.h"
voidget_transpose_type(char*type, CBLAS_TRANSPOSE*trans) {
if( (strncmp( type,"n",1 )==0)||(strncmp( type,"N",1 )==0) )
*trans=CblasNoTrans;
elseif( (strncmp( type,"t",1 )==0)||(strncmp( type,"T",1 )==0) )
*trans=CblasTrans;
elseif( (strncmp( type,"c",1 )==0)||(strncmp( type,"C",1 )==0) )
*trans=CblasConjTrans;
else*trans=UNDEFINED;
}
voidget_uplo_type(char*type, CBLAS_UPLO*uplo) {
if( (strncmp( type,"u",1 )==0)||(strncmp( type,"U",1 )==0) )
*uplo=CblasUpper;
elseif( (strncmp( type,"l",1 )==0)||(strncmp( type,"L",1 )==0) )
*uplo=CblasLower;
else*uplo=UNDEFINED;
}
voidget_diag_type(char*type, CBLAS_DIAG*diag) {
if( (strncmp( type,"u",1 )==0)||(strncmp( type,"U",1 )==0) )
*diag=CblasUnit;
elseif( (strncmp( type,"n",1 )==0)||(strncmp( type,"N",1 )==0) )
*diag=CblasNonUnit;
else*diag=UNDEFINED;
}
voidget_side_type(char*type, CBLAS_SIDE*side) {
if( (strncmp( type,"l",1 )==0)||(strncmp( type,"L",1 )==0) )
*side=CblasLeft;
elseif( (strncmp( type,"r",1 )==0)||(strncmp( type,"R",1 )==0) )
*side=CblasRight;
else*side=UNDEFINED;
}