MCPcopy Create free account
hub / github.com/numpy/numpy / horner1

Function horner1

numpy/random/src/mt19937/mt19937-jump.c:65–96  ·  view source on GitHub ↗

compute pf(ss) using standard Horner method */

Source from the content-addressed store, hash-verified

63
64/* compute pf(ss) using standard Horner method */
65void horner1(unsigned long *pf, mt19937_state *state) {
66 int i = MEXP - 1;
67 mt19937_state *temp;
68
69 temp = (mt19937_state *)calloc(1, sizeof(mt19937_state));
70
71 while (get_coef(pf, i) == 0)
72 i--;
73
74 if (i > 0) {
75 copy_state(temp, state);
76 gen_next(temp);
77 i--;
78 for (; i > 0; i--) {
79 if (get_coef(pf, i) != 0)
80 add_state(temp, state);
81 else
82 ;
83 gen_next(temp);
84 }
85 if (get_coef(pf, 0) != 0)
86 add_state(temp, state);
87 else
88 ;
89 } else if (i == 0)
90 copy_state(temp, state);
91 else
92 ;
93
94 copy_state(state, temp);
95 free(temp);
96}
97
98void mt19937_jump_state(mt19937_state *state) {
99 unsigned long *pf;

Callers 1

mt19937_jump_stateFunction · 0.85

Calls 4

get_coefFunction · 0.85
copy_stateFunction · 0.85
gen_nextFunction · 0.85
add_stateFunction · 0.85

Tested by

no test coverage detected