Actual source code: randomimpl.h

petsc-3.11.4 2019-09-28
Report Typos and Errors

  2: #if !defined(PETSCRANDOMIMPL_H)
  3: #define PETSCRANDOMIMPL_H

  5:  #include <petsc/private/petscimpl.h>

  7: PETSC_EXTERN PetscBool PetscRandomRegisterAllCalled;
  8: PETSC_EXTERN PetscErrorCode PetscRandomRegisterAll(void);

 10: typedef struct _PetscRandomOps *PetscRandomOps;
 11: struct _PetscRandomOps {
 12:   /* 0 */
 13:   PetscErrorCode (*seed)(PetscRandom);
 14:   PetscErrorCode (*getvalue)(PetscRandom,PetscScalar*);
 15:   PetscErrorCode (*getvaluereal)(PetscRandom,PetscReal*);
 16:   PetscErrorCode (*destroy)(PetscRandom);
 17:   PetscErrorCode (*setfromoptions)(PetscOptionItems*,PetscRandom);
 18: };

 20: struct _p_PetscRandom {
 21:   PETSCHEADER(struct _PetscRandomOps);
 22:   void          *data;         /* implementation-specific data */
 23:   unsigned long seed;
 24:   PetscScalar   low,width;     /* lower bound and width of the interval over
 25:                                   which the random numbers are distributed */
 26:   PetscBool iset;              /* if true, indicates that the user has set the interval */
 27:   /* array for shuffling ??? */
 28: };

 30: #endif