Lines Matching full:r

19 static PetscErrorCode PetscRandomSeed_Random123(PetscRandom r)  in PetscRandomSeed_Random123()  argument
22 PetscRandom123 *r123 = (PetscRandom123 *)r->data; in PetscRandomSeed_Random123()
25 ukey.v[0] = (R123_ULONG_LONG)r->seed; in PetscRandomSeed_Random123()
61 static PetscErrorCode PetscRandomGetValue_Random123(PetscRandom r, PetscScalar *val) in PetscRandomGetValue_Random123() argument
63 PetscRandom123 *r123 = (PetscRandom123 *)r->data; in PetscRandomGetValue_Random123()
72 if (r->iset) { in PetscRandomGetValue_Random123()
73 re = re * PetscRealPart(r->width) + PetscRealPart(r->low); in PetscRandomGetValue_Random123()
74 im = im * PetscImaginaryPart(r->width) + PetscImaginaryPart(r->low); in PetscRandomGetValue_Random123()
81 if (r->iset) rscal = rscal * r->width + r->low; in PetscRandomGetValue_Random123()
87 static PetscErrorCode PetscRandomGetValueReal_Random123(PetscRandom r, PetscReal *val) in PetscRandomGetValueReal_Random123() argument
89 PetscRandom123 *r123 = (PetscRandom123 *)r->data; in PetscRandomGetValueReal_Random123()
94 if (r->iset) rreal = rreal * PetscRealPart(r->width) + PetscRealPart(r->low); in PetscRandomGetValueReal_Random123()
99 static PetscErrorCode PetscRandomGetValuesReal_Random123(PetscRandom r, PetscInt n, PetscReal vals[… in PetscRandomGetValuesReal_Random123() argument
101 PetscRandom123 *r123 = (PetscRandom123 *)r->data; in PetscRandomGetValuesReal_Random123()
111 for (PetscInt i = 0; i < peel_start; i++) PetscCall(PetscRandomGetValueReal(r, &vals[i])); in PetscRandomGetValuesReal_Random123()
117 if (r->iset) { in PetscRandomGetValuesReal_Random123()
118 scale *= PetscRealPart(r->width); in PetscRandomGetValuesReal_Random123()
119 shift *= PetscRealPart(r->width); in PetscRandomGetValuesReal_Random123()
120 shift += PetscRealPart(r->low); in PetscRandomGetValuesReal_Random123()
136 for (PetscInt i = 0; i < rem; i++) PetscCall(PetscRandomGetValueReal(r, &vals[i])); in PetscRandomGetValuesReal_Random123()
140 static PetscErrorCode PetscRandomGetValues_Random123(PetscRandom r, PetscInt n, PetscScalar vals[]) in PetscRandomGetValues_Random123() argument
144 for (PetscInt i = 0; i < n; i++) PetscCall(PetscRandomGetValue_Random123(r, n, &vals[i])); in PetscRandomGetValues_Random123()
146 PetscCall(PetscRandomGetValuesReal_Random123(r, n, vals)); in PetscRandomGetValues_Random123()
151 static PetscErrorCode PetscRandomDestroy_Random123(PetscRandom r) in PetscRandomDestroy_Random123() argument
154 PetscCall(PetscFree(r->data)); in PetscRandomDestroy_Random123()
183 PETSC_EXTERN PetscErrorCode PetscRandomCreate_Random123(PetscRandom r) in PetscRandomCreate_Random123() argument
189 r->data = r123; in PetscRandomCreate_Random123()
190 r->ops[0] = PetscRandomOps_Values; in PetscRandomCreate_Random123()
191 PetscCall(PetscObjectChangeTypeName((PetscObject)r, PETSCRANDOM123)); in PetscRandomCreate_Random123()
192 PetscCall(PetscRandomSeed(r)); in PetscRandomCreate_Random123()