Actual source code: randomimpl.h


  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 (*getvalues)(PetscRandom,PetscInt,PetscScalar*);
 17:   PetscErrorCode (*getvaluesreal)(PetscRandom,PetscInt,PetscReal*);
 18:   PetscErrorCode (*destroy)(PetscRandom);
 19:   PetscErrorCode (*setfromoptions)(PetscOptionItems*,PetscRandom);
 20: };

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

 32: #endif