- Notifications
You must be signed in to change notification settings - Fork0
Simple as it gets Gillespie library in C++, as a stepping stone for your own Gillespie codes
License
physics-based-ml/gillespie-cpp
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Useful libraries are simple to understand for use in your own project.
This library is as simple as it gets and should serve as a simple stepping stone for other Gillespie codes in C++.
Hopefully, because it's entirely C++, it will beat out some other Python variants out there.
- Simple STL +
C++ 17standard. - Gillespie algorithm.
- Tau leaping, with adaptive tau step as inCao 2006.
- Clone the repo.
mkdir build && cd buildcmake ..make && make install
The default install location is/usr/local/lib.
It requiresstd==c++17 to work with the filesystem for i/o.The namespace isgilsp.
Here is a simple snippet for the reactonA -> 0 (note: bimolecular and higher order reactionsare also supported). It is in theexample directory.
#include <iostream>#include <vector>#include <gilsp>using namespace gilsp;using namespace std;int main() { // Random seed srand (time(NULL)); // Make the reaction A->0 with rate 3 Rxn rxn = Rxn("rxn", 3.0, {"A"}, {}); // Initial counts of particles Counts counts = Counts(); counts.set_count("A", 100); // Run Gillespie g; vector<Rxn> rxn_list({rxn}); double dt_st_every = 0.1; double t_max = 100.0; CountsHist counts_hist = g.run(rxn_list, counts, dt_st_every, t_max); // Print it counts_hist.print(); // Write it counts_hist.write_all_count_hist("../data"); return 0;}About
Simple as it gets Gillespie library in C++, as a stepping stone for your own Gillespie codes
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Languages
- Mathematica61.3%
- C++36.5%
- CMake2.2%


