NEURON
nrnrandom.h
Go to the documentation of this file.
1 #pragma once
2 #ifdef __cplusplus
3 #error "This version of nrnrandom.h should never be compiled as C++."
4 #endif
5 #include <stdint.h>
6 
7 /** Ideally the prototypes below would take Rand* in place of void*, but this
8  * would break several existing models. We do, however, want to declare the
9  * Rand type, as this makes it possible to write (for example)
10  * nrn_random_pick((Rand*)some_rand) now, which will be required to suppress
11  * deprecation warnings in NEURON 9+ where nrn_random_pick(void*) is a
12  * [[deprecated]] overload and the non-deprecated version takes Rand*.
13  */
14 typedef struct Rand Rand;
15 
16 /** These declarations are wrong, in the sense that they are inconsistent with
17  * the definitions in ivocrand.cpp. This is an intentional, but possibly
18  * unwise, decision.
19  */
21 void* nrn_random_arg(int);
22 int nrn_random_isran123(void* r, uint32_t* id1, uint32_t* id2, uint32_t* id3);
23 double nrn_random_pick(void* r);
24 void nrn_random_reset(void* r);
25 int nrn_random123_getseq(void* r, uint32_t* seq, char* which);
26 int nrn_random123_setseq(void* r, uint32_t seq, char which);
27 
28 /** Note that in addition to having void* in place of Rand*, this has int in
29  * place of long.
30  */
31 void nrn_set_random_sequence(void* r, int seq);
Definition: random1.h:9
void nrn_set_random_sequence(void *r, int seq)
Note that in addition to having void* in place of Rand*, this has int in place of long.
long nrn_get_random_sequence(void *r)
These declarations are wrong, in the sense that they are inconsistent with the definitions in ivocran...
void nrn_random_reset(void *r)
int nrn_random123_getseq(void *r, uint32_t *seq, char *which)
int nrn_random_isran123(void *r, uint32_t *id1, uint32_t *id2, uint32_t *id3)
double nrn_random_pick(void *r)
void * nrn_random_arg(int)
Definition: ivocrand.cpp:453
int nrn_random123_setseq(void *r, uint32_t seq, char which)