bpp-core3  3.0.0
ContingencyTableGenerator.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef BPP_NUMERIC_RANDOM_CONTINGENCYTABLEGENERATOR_H
6 #define BPP_NUMERIC_RANDOM_CONTINGENCYTABLEGENERATOR_H
7 
8 
9 #include "../Matrix/Matrix.h"
10 #include "RandomTools.h"
11 
12 // From the STL:
13 #include <cmath>
14 #include <vector>
15 
16 namespace bpp
17 {
35 {
36 private:
37  std::vector<size_t> nrowt_;
38  std::vector<size_t> ncolt_;
39  size_t nrow_;
40  size_t ncol_;
41  size_t nrowm_;
42  size_t ncolm_;
43  std::vector<size_t> jwork_; // workspace
44  size_t ntot_; // total number of observations
45  std::vector<double> fact_; // log factorial
46 
47 public:
48  ContingencyTableGenerator(const std::vector<size_t>& nrowt, const std::vector<size_t>& ncolt);
49 
50 public:
52 };
53 } // end of namespace bpp.
54 #endif // BPP_NUMERIC_RANDOM_CONTINGENCYTABLEGENERATOR_H
Matrix storage by row.
Definition: Matrix.h:92
Generate a random contingency matrix with given marginal counts.
ContingencyTableGenerator(const std::vector< size_t > &nrowt, const std::vector< size_t > &ncolt)