#include "petscsys.h" PetscErrorCode PetscRandomGetValue(PetscRandom r,PetscScalar *val)Not Collective Many br
Many br
When PETSc is compiled for complex numbers this returns a complex number with random real and complex parts. Many brUse PetscGetValueReal() to get a random real number. Many br
To get a complex number with only a random real part, first call PetscRandomSetInterval() with a equal Many brlow and high imaginary part. Similarly to get a complex number with only a random imaginary part call Many brPetscRandomSetInterval() with a equal low and high real part. Many br
PetscRandomCreate(PETSC_COMM_WORLD,&r); PetscRandomGetValue(r,&value1); PetscRandomGetValue(r,&value2); PetscRandomGetValue(r,&value3); PetscRandomDestroy(&r);Many br
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