Lines Matching full:r
23 . r - the random number generator context
42 PetscRandomCreate(PETSC_COMM_WORLD,&r);
43 PetscRandomGetValue(r,&value1);
44 PetscRandomGetValue(r,&value2);
45 PetscRandomGetValue(r,&value3);
46 PetscRandomDestroy(&r);
51 PetscErrorCode PetscRandomGetValue(PetscRandom r, PetscScalar *val) in PetscRandomGetValue() argument
54 PetscValidHeaderSpecific(r, PETSC_RANDOM_CLASSID, 1); in PetscRandomGetValue()
55 PetscValidType(r, 1); in PetscRandomGetValue()
56 if (!r->ops->getvalue) PetscUseTypeMethod(r, getvalues, 1, val); in PetscRandomGetValue()
57 else PetscUseTypeMethod(r, getvalue, val); in PetscRandomGetValue()
58 PetscCall(PetscObjectStateIncrease((PetscObject)r)); in PetscRandomGetValue()
69 . r - the random number generator context
81 PetscRandomCreate(PETSC_COMM_WORLD,&r);
82 PetscRandomGetValueReal(r,&value1);
83 PetscRandomGetValueReal(r,&value2);
84 PetscRandomGetValueReal(r,&value3);
85 PetscRandomDestroy(&r);
90 PetscErrorCode PetscRandomGetValueReal(PetscRandom r, PetscReal *val) in PetscRandomGetValueReal() argument
93 PetscValidHeaderSpecific(r, PETSC_RANDOM_CLASSID, 1); in PetscRandomGetValueReal()
94 PetscValidType(r, 1); in PetscRandomGetValueReal()
95 if (!r->ops->getvaluereal) PetscUseTypeMethod(r, getvaluesreal, 1, val); in PetscRandomGetValueReal()
96 else PetscUseTypeMethod(r, getvaluereal, val); in PetscRandomGetValueReal()
97 PetscCall(PetscObjectStateIncrease((PetscObject)r)); in PetscRandomGetValueReal()
108 + r - the random number generator context
124 PetscErrorCode PetscRandomGetValues(PetscRandom r, PetscInt n, PetscScalar *val) in PetscRandomGetValues() argument
127 PetscValidHeaderSpecific(r, PETSC_RANDOM_CLASSID, 1); in PetscRandomGetValues()
128 PetscValidType(r, 1); in PetscRandomGetValues()
129 if (!r->ops->getvalues) { in PetscRandomGetValues()
130 PetscErrorCode (*const getvalue)(PetscRandom, PetscScalar *) = r->ops->getvalue; in PetscRandomGetValues()
132 for (PetscInt i = 0; i < n; ++i) PetscCall(getvalue(r, val + i)); in PetscRandomGetValues()
133 } else PetscUseTypeMethod(r, getvalues, n, val); in PetscRandomGetValues()
134 PetscCall(PetscObjectStateIncrease((PetscObject)r)); in PetscRandomGetValues()
145 + r - the random number generator context
158 PetscErrorCode PetscRandomGetValuesReal(PetscRandom r, PetscInt n, PetscReal *val) in PetscRandomGetValuesReal() argument
161 PetscValidHeaderSpecific(r, PETSC_RANDOM_CLASSID, 1); in PetscRandomGetValuesReal()
162 PetscValidType(r, 1); in PetscRandomGetValuesReal()
163 if (!r->ops->getvaluesreal) { in PetscRandomGetValuesReal()
165 for (i = 0; i < n; i++) PetscUseTypeMethod(r, getvaluereal, val + i); in PetscRandomGetValuesReal()
166 } else PetscUseTypeMethod(r, getvaluesreal, n, val); in PetscRandomGetValuesReal()
167 PetscCall(PetscObjectStateIncrease((PetscObject)r)); in PetscRandomGetValuesReal()
178 . r - the random number generator context
188 PetscErrorCode PetscRandomGetInterval(PetscRandom r, PetscScalar *low, PetscScalar *high) in PetscRandomGetInterval() argument
191 PetscValidHeaderSpecific(r, PETSC_RANDOM_CLASSID, 1); in PetscRandomGetInterval()
194 *low = r->low; in PetscRandomGetInterval()
198 *high = r->low + r->width; in PetscRandomGetInterval()
210 + r - the random number generator context
223 PetscErrorCode PetscRandomSetInterval(PetscRandom r, PetscScalar low, PetscScalar high) in PetscRandomSetInterval() argument
226 PetscValidHeaderSpecific(r, PETSC_RANDOM_CLASSID, 1); in PetscRandomSetInterval()
233 r->low = low; in PetscRandomSetInterval()
234 r->width = high - low; in PetscRandomSetInterval()
235 r->iset = PETSC_TRUE; in PetscRandomSetInterval()