From af2585c5be539e76e4584d4bf885c5b7fe1bd331 Mon Sep 17 00:00:00 2001 From: Brian Drawert Date: Mon, 25 Jul 2022 13:03:55 -0700 Subject: [PATCH] Closes #289 --- .../NRMConstant/README_NRMConstant.txt | 16 ----- .../NRMConstant/demo_NRMConstant_v5.cpp | 66 ------------------- 2 files changed, 82 deletions(-) delete mode 100644 spatialpy/solvers/c_base/ssa_sdpd-c-simulation-engine/external/NRMConstant/README_NRMConstant.txt delete mode 100644 spatialpy/solvers/c_base/ssa_sdpd-c-simulation-engine/external/NRMConstant/demo_NRMConstant_v5.cpp diff --git a/spatialpy/solvers/c_base/ssa_sdpd-c-simulation-engine/external/NRMConstant/README_NRMConstant.txt b/spatialpy/solvers/c_base/ssa_sdpd-c-simulation-engine/external/NRMConstant/README_NRMConstant.txt deleted file mode 100644 index 009cf10e..00000000 --- a/spatialpy/solvers/c_base/ssa_sdpd-c-simulation-engine/external/NRMConstant/README_NRMConstant.txt +++ /dev/null @@ -1,16 +0,0 @@ -Sanft added NRMConstant_v4 class (NRMConstant_v4.hpp, .cpp) -The class is a priority queue that should scale roughly O(1) -for large discrete stochastic reaction-diffusion models. - -demo_NRMConstant.cpp shows how to use it. Compile with: -g++ demo_NRMConstant.cpp NRMConstant_v4.cpp - -Note the key functions: -NRMConstant_v4 reactionGenerator; // constructor -reactionGenerator.build(propensities, gen, propensitySum, activeChannels); // set up priority queue from initial propensities -reactionGenerator.selectReaction(); // get the item (next reaction or diffusion event) that will occur next -reactionGenerator.update(reactionIndex,propensities[reactionIndex],currentTime,gen); // update event time - -Note that the event that fires and all affected propensities should have a corresponding call to update before -calling selectReaction - diff --git a/spatialpy/solvers/c_base/ssa_sdpd-c-simulation-engine/external/NRMConstant/demo_NRMConstant_v5.cpp b/spatialpy/solvers/c_base/ssa_sdpd-c-simulation-engine/external/NRMConstant/demo_NRMConstant_v5.cpp deleted file mode 100644 index ef15692e..00000000 --- a/spatialpy/solvers/c_base/ssa_sdpd-c-simulation-engine/external/NRMConstant/demo_NRMConstant_v5.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// compile: g++ *.cpp -// run: a.out -#include -#include -#include "NRMConstant_v5.hpp" - -int main() { - std::cout << "testing v5...(doesn't use ParticleSystem!)" << "\n"; - - /* SET UP RANDOM NUMBER GENERATOR AND "MODEL" */ - // gen is the random number generator - std::mt19937 gen; - // gen.seed(123); - std::random_device rd; - gen.seed(rd()); - - // create a "MODEL" (just some random propensity values) - std::size_t modelsize=10;//total number of propensities - std::vector propensities(modelsize); //vector of all propensities (reaction and diffusion) - double propensitySum=0.0; - std::size_t activeChannels=0; // initial number of nonzero propensities (typically improves initial performance) - - - //let's fill the propensities with random values using a uniform continuous distribution from 0 to 100 (mean 50) - std::uniform_real_distribution uniform100(0.0,100.0); - for (int i=0; i timeRxnPair; - int reactionIndex; - double currentTime=0; - double endTime=.1; - while (currentTime