-
Notifications
You must be signed in to change notification settings - Fork 3
/
get_k_within.cpp
55 lines (45 loc) · 1.22 KB
/
get_k_within.cpp
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <iostream>
#include <fstream>
#include <vector>
#include <cstdlib>
#include <string>
#include <algorithm> // std::sort
#include <math.h>
#include <iomanip>
#include <ctime>
#include <time.h>
#include "boost/random/mersenne_twister.hpp"
#include "boost/random/gamma_distribution.hpp"
#include "boost/random/normal_distribution.hpp"
#include <boost/math/distributions/beta.hpp>
#include <boost/random.hpp>
#include <boost/math/special_functions/digamma.hpp> //needed for computing the modified Dirichlet bound
#include <boost/math/special_functions/gamma.hpp>
#include <boost/foreach.hpp>
#include "omp.h"
#include "infiles.h"
//#include "boost/program_options.hpp"
//#include <iterator>
using namespace std;
using namespace boost::math::policies;
using namespace boost::math;
int read()
{
//cout<<prob_file<<endl;
ifstream inFile;
string line;
int K, i;
inFile.open(vb_file, ifstream::in);
if (!inFile) {
cerr << "Unable to open "<< vb_file<<" file"<<endl;
exit(1); // call system to stop
}
//cout<< "Reading "<< vb_file<<" file"<<endl;
//getline( inFile, line );
inFile.ignore(2);
inFile >> i;
inFile >> K;
cout<< "number of components = "<< K<<endl;
inFile.close();
return(K);
}