petsc-3.7.1 2016-05-15
Report Typos and Errors

# PetscRandomSetFromOptions

Configures the random number generator from the options database.

### Synopsis

    #include "petscsys.h"
    PetscErrorCode  PetscRandomSetFromOptions(PetscRandom rnd)

Collective on PetscRandom Many br

### Input Parameter

rnd -The random number generator context Many br

### Options Database

| -random_seed <integer> | - provide a seed to the random number generater Many br
| -random_no_imaginary_part | - makes the imaginary part of the random number zero, this is useful when you want the Many brsame code to produce the same result when run with real numbers or complex numbers for regression testing purposes Many br

Notes: To see all options, run your program with the -help option. Many brMust be called after PetscRandomCreate() but before the rnd is used. Many br

Many br

### Keywords

PetscRandom, set, options, database

### See Also

PetscRandomCreate(), PetscRandomSetType()

Level:beginner
Location:src/sys/classes/random/interface/randomc.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/sys/classes/random/examples/tutorials/ex1.c.html
src/sys/classes/random/examples/tutorials/ex2.c.html
src/ksp/ksp/examples/tutorials/ex2.c.html
src/ksp/ksp/examples/tutorials/ex11.c.html
src/ksp/ksp/examples/tutorials/ex18.c.html
src/ksp/ksp/examples/tutorials/ex46.c.html
src/ksp/ksp/examples/tutorials/ex52.c.html
src/ksp/ksp/examples/tutorials/ex2f.F.html
src/ksp/ksp/examples/tutorials/ex11f.F.html
src/ts/examples/tutorials/ex42.c.html