Skip to content

Commit

Permalink
Remove Binomial
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Cornu committed Nov 18, 2024
1 parent c84f391 commit 78fba04
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 84 deletions.
33 changes: 0 additions & 33 deletions src/gnu/Binomial.cpp

This file was deleted.

49 changes: 0 additions & 49 deletions src/gnu/Binomial.h

This file was deleted.

1 change: 0 additions & 1 deletion src/gnu/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
add_library(
nrngnu STATIC
Binomial.cpp
DiscUnif.cpp
Erlang.cpp
Geom.cpp
Expand Down
17 changes: 17 additions & 0 deletions src/gnu/distributions.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once
#include <random>
#include "Random.h"

class Binomial: public Random {
public:
Binomial(int n, double u, RNG *gen)
: Random(gen)
, d(n, u)
{}

double operator()() override {
return d(*generator());
}
private:
std::binomial_distribution<> d;
};
2 changes: 1 addition & 1 deletion src/ivoc/ivocrand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
#include <nrnran123.h>

#include <Random.h>
#include <distributions.hpp>
#include <Poisson.h>
#include <Normal.h>
#include <Uniform.h>
#include <Binomial.h>
#include <DiscUnif.h>
#include <Erlang.h>
#include <Geom.h>
Expand Down

0 comments on commit 78fba04

Please sign in to comment.