-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nicolas Cornu
committed
Jan 31, 2024
1 parent
764070a
commit 2fc44a4
Showing
12 changed files
with
33 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ add_library( | |
Geom.cpp | ||
HypGeom.cpp | ||
LogNorm.cpp | ||
mcran4.cpp | ||
NegExp.cpp | ||
Normal.cpp | ||
NrnRandom123RNG.cpp | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,33 @@ | ||
#include "hocdec.h" | ||
#include "mcran4.h" | ||
#include "nrnran123.h" | ||
|
||
int use_mcell_ran4_; | ||
|
||
void set_use_mcran4(bool value) { | ||
use_mcell_ran4_ = value ? 1 : 0; | ||
} | ||
|
||
bool use_mcran4() { | ||
return use_mcell_ran4_ != 0; | ||
} | ||
static const nrnran123_State* state = nrnran123_newstream(0, 0); | ||
|
||
void hoc_mcran4() { | ||
uint32_t idx; | ||
double* xidx; | ||
double x; | ||
xidx = hoc_pgetarg(1); | ||
idx = (uint32_t) (*xidx); | ||
x = mcell_ran4a(&idx); | ||
*xidx = idx; | ||
nrnran123_setseq(state, idx, 0); | ||
x = nrnran123_dblpick(state); | ||
*xidx = idx + 1; | ||
hoc_ret(); | ||
hoc_pushx(x); | ||
} | ||
void hoc_mcran4init() { | ||
double prev = mcell_lowindex(); | ||
std::uint32_t seq; | ||
char which; | ||
nrnran123_getseq(state, &seq, &which); | ||
double prev = static_cast<double>(seq); | ||
if (ifarg(1)) { | ||
uint32_t idx = (uint32_t) chkarg(1, 0., 4294967295.); | ||
mcell_ran4_init(idx); | ||
nrnran123_setseq(state, idx, 0); | ||
} | ||
hoc_ret(); | ||
hoc_pushx(prev); | ||
} | ||
void hoc_usemcran4() { | ||
double prev = (double) use_mcell_ran4_; | ||
if (ifarg(1)) { | ||
use_mcell_ran4_ = (int) chkarg(1, 0., 1.); | ||
} | ||
hoc_ret(); | ||
hoc_pushx(prev); | ||
hoc_pushx(0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
void set_use_mcran4(bool value); | ||
bool use_mcran4(); | ||
void hoc_mcran4(); | ||
void hoc_mcran4init(); | ||
void hoc_usemcran4(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.