Lines Matching refs:r123
22 PetscRandom123 *r123 = (PetscRandom123 *)r->data; in PetscRandomSeed_Random123() local
31 r123->key = threefry4x64keyinit(ukey); in PetscRandomSeed_Random123()
32 r123->counter.v[0] = 0; in PetscRandomSeed_Random123()
33 r123->counter.v[1] = 1; in PetscRandomSeed_Random123()
34 r123->counter.v[2] = 2; in PetscRandomSeed_Random123()
35 r123->counter.v[3] = 3; in PetscRandomSeed_Random123()
36 r123->result = threefry4x64(r123->counter, r123->key); in PetscRandomSeed_Random123()
37 r123->count = 0; in PetscRandomSeed_Random123()
41 static PetscReal PetscRandom123Step(PetscRandom123 *r123) in PetscRandom123Step() argument
45 PetscInt mod = (r123->count++) % 4; in PetscRandom123Step()
48 ret = r123->result.v[mod] * scale + shift; in PetscRandom123Step()
51 r123->counter.v[0] += 4; in PetscRandom123Step()
52 r123->counter.v[1] += 4; in PetscRandom123Step()
53 r123->counter.v[2] += 4; in PetscRandom123Step()
54 r123->counter.v[3] += 4; in PetscRandom123Step()
55 r123->result = threefry4x64(r123->counter, r123->key); in PetscRandom123Step()
63 PetscRandom123 *r123 = (PetscRandom123 *)r->data; in PetscRandomGetValue_Random123() local
69 PetscReal re = PetscRandom123Step(r123); in PetscRandomGetValue_Random123()
70 PetscReal im = PetscRandom123Step(r123); in PetscRandomGetValue_Random123()
80 rscal = PetscRandom123Step(r123); in PetscRandomGetValue_Random123()
89 PetscRandom123 *r123 = (PetscRandom123 *)r->data; in PetscRandomGetValueReal_Random123() local
93 rreal = PetscRandom123Step(r123); in PetscRandomGetValueReal_Random123()
101 PetscRandom123 *r123 = (PetscRandom123 *)r->data; in PetscRandomGetValuesReal_Random123() local
109 peel_start = (4 - (r123->count % 4)) % 4; in PetscRandomGetValuesReal_Random123()
112 PetscAssert((r123->count % 4) == 0, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Bad modular arithmetic"); in PetscRandomGetValuesReal_Random123()
122 r123_copy = *r123; in PetscRandomGetValuesReal_Random123()
132 r123_copy.result = threefry4x64(r123->counter, r123->key); in PetscRandomGetValuesReal_Random123()
135 *r123 = r123_copy; in PetscRandomGetValuesReal_Random123()
185 PetscRandom123 *r123; in PetscRandomCreate_Random123() local
188 PetscCall(PetscNew(&r123)); in PetscRandomCreate_Random123()
189 r->data = r123; in PetscRandomCreate_Random123()