PetscRandomSetInterval#

Sets the interval over which the random numbers will be distributed. By default, this interval is [0,1).

Synopsis#

Not Collective

Input Parameters#

  • r - the random number generator context

  • low - The lower bound of the interval

  • high - The upper bound of the interval

Notes#

for complex numbers either the real part or the imaginary part of high must be greater than its low part; or both of them can be greater.

If the real or imaginary part of low and high are the same then that value is always returned in the real or imaginary part.

See Also#

PetscRandomCreate(), PetscRandomGetInterval()

Level#

intermediate

Location#

src/sys/classes/random/interface/random.c

Examples#

src/dm/field/tutorials/ex1.c
src/dm/tutorials/swarm_ex3.c
src/ksp/ksp/tutorials/ex11.c
src/ksp/ksp/tutorials/ex11f.F90
src/ksp/ksp/tutorials/ex60.c
src/ksp/ksp/tutorials/ex70.c
src/snes/tutorials/ex12.c
src/sys/classes/random/tutorials/ex1.c
src/tao/unconstrained/tutorials/spectraladjointassimilation.c
src/ts/tutorials/ex42.c


Edit on GitLab

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages