Lines Matching +full:- +full:r

21   PetscRandomDestroy - Destroys a `PetscRandom` object that was created by `PetscRandomCreate()`.
26 . r - the random number generator object
32 PetscErrorCode PetscRandomDestroy(PetscRandom *r) in PetscRandomDestroy() argument
35 if (!*r) PetscFunctionReturn(PETSC_SUCCESS); in PetscRandomDestroy()
36 PetscValidHeaderSpecific(*r, PETSC_RANDOM_CLASSID, 1); in PetscRandomDestroy()
37 if (--((PetscObject)*r)->refct > 0) { in PetscRandomDestroy()
38 *r = NULL; in PetscRandomDestroy()
41 PetscTryTypeMethod(*r, destroy); in PetscRandomDestroy()
42 PetscCall(PetscHeaderDestroy(r)); in PetscRandomDestroy()
47 PetscRandomGetSeed - Gets the random seed.
52 . r - The random number generator context
55 . seed - The random seed
61 PetscErrorCode PetscRandomGetSeed(PetscRandom r, PetscInt64 *seed) in PetscRandomGetSeed() argument
64 PetscValidHeaderSpecific(r, PETSC_RANDOM_CLASSID, 1); in PetscRandomGetSeed()
67 *seed = (PetscInt64)r->seed; in PetscRandomGetSeed()
73 …PetscRandomSetSeed - Sets the random seed. You MUST call `PetscRandomSeed()` after this call to ha…
78 + r - The random number generator context
79 - seed - The random seed
85 PetscRandomSetSeed(r,a positive integer);
86 PetscRandomSeed(r);
89 PetscRandomSeed(r) without a call to PetscRandomSetSeed() re-initializes
95 PetscErrorCode PetscRandomSetSeed(PetscRandom r, PetscInt64 seed) in PetscRandomSetSeed() argument
98 PetscValidHeaderSpecific(r, PETSC_RANDOM_CLASSID, 1); in PetscRandomSetSeed()
99 r->seed = (unsigned long)seed; in PetscRandomSetSeed()
105 …PetscRandomSetTypeFromOptions_Private - Sets the type of random generator from user options. Defau…
110 . rnd - The random number generator context
123 if (((PetscObject)rnd)->type_name) { in PetscRandomSetTypeFromOptions_Private()
124 defaultType = ((PetscObject)rnd)->type_name; in PetscRandomSetTypeFromOptions_Private()
130 …PetscCall(PetscOptionsFList("-random_type", "PetscRandom type", "PetscRandomSetType", PetscRandomL… in PetscRandomSetTypeFromOptions_Private()
140 PetscRandomSetFromOptions - Configures the random number generator from the options database.
145 . rnd - The random number generator context
148 + -random_seed <integer> - provide a seed to the random number generator
149 - -random_no_imaginary_part - makes the imaginary part of the random number zero, this is useful wh…
174 …PetscCall(PetscOptionsInt("-random_seed", "Seed to use to generate random numbers", "PetscRandomSe… in PetscRandomSetFromOptions()
179 …PetscCall(PetscOptionsBool("-random_no_imaginary_part", "The imaginary part of the random number w… in PetscRandomSetFromOptions()
185 low = low - PetscImaginaryPart(low); in PetscRandomSetFromOptions()
186 high = high - PetscImaginaryPart(high); in PetscRandomSetFromOptions()
192 PetscCall(PetscRandomViewFromOptions(rnd, NULL, "-random_view")); in PetscRandomSetFromOptions()
197 PetscRandomSetOptionsPrefix - Sets the prefix used for searching for all
203 + r - the random number generator context
204 - prefix - the prefix to prepend to all option names
209 A hyphen (-) must NOT be given at the beginning of the prefix name.
214 PetscErrorCode PetscRandomSetOptionsPrefix(PetscRandom r, const char prefix[]) in PetscRandomSetOptionsPrefix() argument
217 PetscValidHeaderSpecific(r, PETSC_RANDOM_CLASSID, 1); in PetscRandomSetOptionsPrefix()
218 PetscCall(PetscObjectSetOptionsPrefix((PetscObject)r, prefix)); in PetscRandomSetOptionsPrefix()
227 PetscRandomViewFromOptions - View a `PetscRandom` object based on the options database
232 + A - the random number generator context
233 . obj - Optional object
234 - name - command line option
249 PetscRandomView - Views a random number generator object.
254 + rnd - The random number generator context
255 - viewer - an optional visualization context
261 + `PETSC_VIEWER_STDOUT_SELF` - standard output (default)
262 - `PETSC_VIEWER_STDOUT_WORLD` - synchronized standard
291 …Printf(viewer, "[%d] Random type %s, seed %lu\n", rank, ((PetscObject)rnd)->type_name, rnd->seed)); in PetscRandomView()
301 if (!((PetscObject)rnd)->amsmem && rank == 0) { in PetscRandomView()
306 PetscCallSAWs(SAWs_Register, (dir, &rnd->low, 1, SAWs_READ, SAWs_DOUBLE)); in PetscRandomView()
314 PetscRandomCreate - Creates an object for generating random numbers,
315 and initializes the random-number generator.
320 . comm - MPI communicator
323 . r - the random number generator object
343 PetscRandomCreate(PETSC_COMM_SELF,&r);
344 PetscRandomSetType(r,PETSCRAND48);
345 PetscRandomGetValue(r,&value1);
346 PetscRandomGetValueReal(r,&value2);
347 PetscRandomDestroy(&r);
353 PetscErrorCode PetscRandomCreate(MPI_Comm comm, PetscRandom *r) in PetscRandomCreate() argument
359 PetscAssertPointer(r, 2); in PetscRandomCreate()
364 rr->data = NULL; in PetscRandomCreate()
365 rr->low = 0.0; in PetscRandomCreate()
366 rr->width = 1.0; in PetscRandomCreate()
367 rr->iset = PETSC_FALSE; in PetscRandomCreate()
368 rr->seed = 0x12345678 + 76543 * rank; in PetscRandomCreate()
370 *r = rr; in PetscRandomCreate()
375 PetscRandomSeed - Seed the random number generator.
380 . r - The random number generator context
386 PetscRandomSetSeed(r,a positive integer);
387 PetscRandomSeed(r);
390 PetscRandomSeed(r) without a call to PetscRandomSetSeed() re-initializes
396 PetscErrorCode PetscRandomSeed(PetscRandom r) in PetscRandomSeed() argument
399 PetscValidHeaderSpecific(r, PETSC_RANDOM_CLASSID, 1); in PetscRandomSeed()
400 PetscValidType(r, 1); in PetscRandomSeed()
402 PetscUseTypeMethod(r, seed); in PetscRandomSeed()
403 PetscCall(PetscObjectStateIncrease((PetscObject)r)); in PetscRandomSeed()