PetscRandomGetValueImaginary

Generates a random number. Call this after first calling PetscRandomCreate().

Synopsis

#include "petscsys.h" 
PetscErrorCode  PetscRandomGetValueImaginary(PetscRandom r,PetscScalar *val)
Not Collective

Intput Parameter

r - the random number generator context

Output Parameter

val - the value

Options Database Keys

-random_type petscrand48- . -random_type petscrand
-random_type sprng, uses SPRNG package-

Notes

Use VecSetRandom() to set the elements of a vector to random numbers.

Example of Usage

      PetscRandomCreate(PETSC_COMM_WORLD,&r);
      PetscRandomGetValueImaginary(r,&value1);
      PetscRandomGetValueImaginary(r,&value2);
      PetscRandomGetValueImaginary(r,&value3);
      PetscRandomDestroy(r);

See Also

PetscRandomCreate(), PetscRandomDestroy(), VecSetRandom()

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

Examples

src/ksp/ksp/examples/tutorials/ex11.c.html
src/ksp/ksp/examples/tutorials/ex11f.F.html