int PetscRandomCreate(MPI_Comm comm,PetscRandomType type,PetscRandom *r)Collective on MPI_Comm
| comm | - MPI communicator |
| type | - the type of random numbers to be generated, usually RANDOM_DEFAULT |
Use VecSetRandom() to set the elements of a vector to random numbers.
PetscRandomCreate(PETSC_COMM_SELF,RANDOM_DEFAULT,&r);
PetscRandomGetValue(r,&value1);
PetscRandomGetValue(r,&value2);
PetscRandomGetValue(r,&value3);
PetscRandomDestroy(r);
Location: src/sys/src/utilsrandom.c
System Index
Table of Contents