Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Simple as it gets Gillespie library in C++, as a stepping stone for your own Gillespie codes

License

NotificationsYou must be signed in to change notification settings

physics-based-ml/gillespie-cpp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

drawing

drawing

Features

  • Simple STL +C++ 17 standard.
  • Gillespie algorithm.
  • Tau leaping, with adaptive tau step as inCao 2006.

Installing

  • Clone the repo.
  • mkdir build && cd build
  • cmake ..
  • 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.

Example

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;}

drawing

About

Simple as it gets Gillespie library in C++, as a stepping stone for your own Gillespie codes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Mathematica61.3%
  • C++36.5%
  • CMake2.2%

[8]ページ先頭

©2009-2025 Movatter.jp