#include "petscvec.h" PetscErrorCode VecSetRandom(Vec x,PetscRandom rctx)Logically Collective on Vec
x | - the vector | |
rctx | - the random number context, formed by PetscRandomCreate(), or NULL and it will create one internally. |
x | - the vector |
PetscRandomCreate(PETSC_COMM_WORLD,&rctx); VecSetRandom(x,rctx); PetscRandomDestroy(&rctx);