-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into rxd_react_mem
- Loading branch information
Showing
70 changed files
with
1,109 additions
and
2,119 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
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
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 |
---|---|---|
|
@@ -13,6 +13,3 @@ pytest-cov | |
mpi4py | ||
numpy | ||
find_libpython | ||
|
||
# For python 3.12 | ||
setuptools |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include "Isaac64RNG.hpp" | ||
|
||
uint32_t Isaac64::cnt_ = 0; | ||
|
||
Isaac64::Isaac64(std::uint32_t seed) { | ||
if (cnt_ == 0) { | ||
cnt_ = 0xffffffff; | ||
} | ||
--cnt_; | ||
seed_ = seed; | ||
if (seed_ == 0) { | ||
seed_ = cnt_; | ||
} | ||
rng_ = nrnisaac_new(); | ||
reset(); | ||
} | ||
|
||
Isaac64::~Isaac64() { | ||
nrnisaac_delete(rng_); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#pragma once | ||
|
||
#include <cstdint> | ||
|
||
#include "RNG.h" | ||
#include "nrnisaac.h" | ||
|
||
class Isaac64: public RNG { | ||
public: | ||
Isaac64(std::uint32_t seed = 0); | ||
~Isaac64(); | ||
std::uint32_t asLong() { | ||
return nrnisaac_uint32_pick(rng_); | ||
} | ||
void reset() { | ||
nrnisaac_init(rng_, seed_); | ||
} | ||
double asDouble() { | ||
return nrnisaac_dbl_pick(rng_); | ||
} | ||
std::uint32_t seed() { | ||
return seed_; | ||
} | ||
void seed(std::uint32_t s) { | ||
seed_ = s; | ||
reset(); | ||
} | ||
|
||
private: | ||
std::uint32_t seed_; | ||
void* rng_; | ||
static std::uint32_t cnt_; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "MCellRan4RNG.hpp" | ||
|
||
MCellRan4::MCellRan4(std::uint32_t ihigh, std::uint32_t ilow) { | ||
++cnt_; | ||
ilow_ = ilow; | ||
ihigh_ = ihigh; | ||
if (ihigh_ == 0) { | ||
ihigh_ = cnt_; | ||
ihigh_ = (std::uint32_t) asLong(); | ||
} | ||
orig_ = ihigh_; | ||
} | ||
MCellRan4::~MCellRan4() {} | ||
|
||
std::uint32_t MCellRan4::cnt_ = 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#pragma once | ||
|
||
#include <cstdint> | ||
|
||
#include "RNG.h" | ||
#include "mcran4.h" | ||
|
||
// The decision that has to be made is whether each generator instance | ||
// should have its own seed or only one seed for all. We choose separate | ||
// seed for each but if arg not present or 0 then seed chosen by system. | ||
|
||
// the addition of ilow > 0 means that value is used for the lowindex | ||
// instead of the mcell_ran4_init global 32 bit lowindex. | ||
|
||
class MCellRan4: public RNG { | ||
public: | ||
MCellRan4(std::uint32_t ihigh = 0, std::uint32_t ilow = 0); | ||
virtual ~MCellRan4(); | ||
virtual std::uint32_t asLong() { | ||
return (std::uint32_t) (ilow_ == 0 ? mcell_iran4(&ihigh_) : nrnRan4int(&ihigh_, ilow_)); | ||
} | ||
virtual void reset() { | ||
ihigh_ = orig_; | ||
} | ||
virtual double asDouble() { | ||
return (ilow_ == 0 ? mcell_ran4a(&ihigh_) : nrnRan4dbl(&ihigh_, ilow_)); | ||
} | ||
std::uint32_t ihigh_; | ||
std::uint32_t orig_; | ||
std::uint32_t ilow_; | ||
|
||
private: | ||
static std::uint32_t cnt_; | ||
}; |
Empty file.
Oops, something went wrong.