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

PetscRandomGetValueReal

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

Synopsis

#include "petscsys.h" 
PetscErrorCode  PetscRandomGetValueReal(PetscRandom r,PetscReal *val)
Not Collective Many br

Intput Parameter

r -the random number generator context Many br

Output Parameter

val -the value Many br

Many br

Notes

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

Example of Usage

      PetscRandomCreate(PETSC_COMM_WORLD,&r);
      PetscRandomGetValueReal(r,&value1);
      PetscRandomGetValueReal(r,&value2);
      PetscRandomGetValueReal(r,&value3);
      PetscRandomDestroy(&r);
Many br

See Also

PetscRandomCreate(), PetscRandomDestroy(), VecSetRandom(), PetscRandomGetValue()

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