-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChi2Table.H
35 lines (31 loc) · 962 Bytes
/
Chi2Table.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/***********************************************************************
Chi2Table.H
BOOM : Bioinformatics Object Oriented Modules
Copyright (C)2012 William H. Majoros ([email protected]).
This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
License (GPL) version 3, as described at www.opensource.org.
***********************************************************************/
#ifndef INCL_BOOM_Chi2Table_H
#define INCL_BOOM_Chi2Table_H
#include "String.H"
#include "Array1D.H"
#include "Array2D.H"
using namespace std;
static const char *DEFAULT_PATH="";
namespace BOOM {
class Chi2Table
{
public:
Chi2Table(BOOM::String filename=DEFAULT_PATH);
float lookupChi(int df,float alpha);
float lookupP(int df,float chiSquared);
private:
void loadFromStream(istream &);
BOOM::IntArray1D DFs;
BOOM::Array2D<float> table;
BOOM::FloatArray1D alphas;
unsigned alphaToIndex(float alpha);
unsigned dfToIndex(int df);
};
}
#endif