Lines Matching +full:- +full:r

17   PetscRandomGetValue - Generates a random number.  Call this after first calling
23 . r - the random number generator context
26 . val - the value
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()
63 PetscRandomGetValueReal - Generates a real random number. Call this after first calling
69 . r - the random number generator context
72 . val - the value
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()
102 PetscRandomGetValues - Generates a sequence of random numbers. Call this after first calling
108 + r - the random number generator context
109 - n - number of random numbers to generate
112 . val - the array to hold the values
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()
139 …PetscRandomGetValuesReal - Generates a sequence of real random numbers. Call this after first cal…
145 + r - the random number generator context
146 - n - number of random numbers to generate
149 . val - the array to hold the values
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()
172 PetscRandomGetInterval - Gets the interval over which the random numbers
178 . r - the random number generator context
181 + low - The lower bound of the interval
182 - high - The upper bound of the interval
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()
204 PetscRandomSetInterval - Sets the interval over which the random numbers
210 + r - the random number generator context
211 . low - The lower bound of the interval
212 - high - The upper bound of the interval
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()