summaryrefslogtreecommitdiff
path: root/CBLAS/testing/auxiliary.c
blob: 4449b33d3ba29971b542786dae924931280ea246 (plain)
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"

void get_transpose_type(char *type, CBLAS_TRANSPOSE *trans) {
  if( (strncmp( type,"n",1 )==0)||(strncmp( type,"N",1 )==0) )
        *trans = CblasNoTrans;
  else if( (strncmp( type,"t",1 )==0)||(strncmp( type,"T",1 )==0) )
        *trans = CblasTrans;
  else if( (strncmp( type,"c",1 )==0)||(strncmp( type,"C",1 )==0) )
        *trans = CblasConjTrans;
  else *trans = UNDEFINED;
}

void get_uplo_type(char *type, CBLAS_UPLO *uplo) {
  if( (strncmp( type,"u",1 )==0)||(strncmp( type,"U",1 )==0) )
        *uplo = CblasUpper;
  else if( (strncmp( type,"l",1 )==0)||(strncmp( type,"L",1 )==0) )
        *uplo = CblasLower;
  else *uplo = UNDEFINED;
}
void get_diag_type(char *type, CBLAS_DIAG *diag) {
  if( (strncmp( type,"u",1 )==0)||(strncmp( type,"U",1 )==0) )
        *diag = CblasUnit;
  else if( (strncmp( type,"n",1 )==0)||(strncmp( type,"N",1 )==0) )
        *diag = CblasNonUnit;
  else *diag = UNDEFINED;
}
void get_side_type(char *type, CBLAS_SIDE *side) {
  if( (strncmp( type,"l",1 )==0)||(strncmp( type,"L",1 )==0) )
        *side = CblasLeft;
  else if( (strncmp( type,"r",1 )==0)||(strncmp( type,"R",1 )==0) )
        *side = CblasRight;
  else *side = UNDEFINED;
}