PLASMA 2.8.0 PLASMA - Parallel Linear Algebra for Scalable Multi-core Architectures

- Main Page
- Modules
- Data Types List

random.h
1
16 #ifndef _PLASMA_RANDOM_H_
17 #define _PLASMA_RANDOM_H_
18
19 #define Rnd64_A 6364136223846793005ULL
20 #define Rnd64_C 1ULL
21 #define RndF_Mul 5.4210108624275222e-20f
22 #define RndD_Mul 5.4210108624275222e-20
23
24 static inline unsigned long long int
25 Rnd64_jump(unsigned long long int n, unsigned long long int seed ) {
26 unsigned long long int a_k, c_k, ran;
27 int i;
28
29 a_k = Rnd64_A;
30 c_k = Rnd64_C;
31
32 ran = seed;
33 for (i = 0; n; n >>= 1, ++i) {
34 if (n & 1)
35 ran = a_k * ran + c_k;
36 c_k *= (a_k + 1);
37 a_k *= a_k;
38 }
39
40 return ran;
41 }
42
43 #endif /* _PLASMA_RANDOM_H_ */