-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paths_m_mat.c
51 lines (43 loc) · 1.31 KB
/
s_m_mat.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
39
40
41
42
43
44
45
46
47
48
49
50
51
/****************** s_m_mat.c (in su3.a) ******************************
* *
* void scalar_mult_su3_matrix( su3_matrix *a, Real s, su3_matrix *b) *
* B <- s*A *
*/
#include "../include/config.h"
#include "../include/complex.h"
#include "../include/su3.h"
/* b <- s*a, matrices */
void scalar_mult_su3_matrix( su3_matrix *a, Real s, su3_matrix *b ){
#ifndef FAST
register int i,j;
for(i=0;i<3;i++)for(j=0;j<3;j++){
b->e[i][j].real = s*a->e[i][j].real;
b->e[i][j].imag = s*a->e[i][j].imag;
}
#else
#ifdef NATIVEDOUBLE
register double ss;
#else
register Real ss;
#endif
ss = s;
b->e[0][0].real = ss*a->e[0][0].real;
b->e[0][0].imag = ss*a->e[0][0].imag;
b->e[0][1].real = ss*a->e[0][1].real;
b->e[0][1].imag = ss*a->e[0][1].imag;
b->e[0][2].real = ss*a->e[0][2].real;
b->e[0][2].imag = ss*a->e[0][2].imag;
b->e[1][0].real = ss*a->e[1][0].real;
b->e[1][0].imag = ss*a->e[1][0].imag;
b->e[1][1].real = ss*a->e[1][1].real;
b->e[1][1].imag = ss*a->e[1][1].imag;
b->e[1][2].real = ss*a->e[1][2].real;
b->e[1][2].imag = ss*a->e[1][2].imag;
b->e[2][0].real = ss*a->e[2][0].real;
b->e[2][0].imag = ss*a->e[2][0].imag;
b->e[2][1].real = ss*a->e[2][1].real;
b->e[2][1].imag = ss*a->e[2][1].imag;
b->e[2][2].real = ss*a->e[2][2].real;
b->e[2][2].imag = ss*a->e[2][2].imag;
#endif
}