-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.cpp
More file actions
53 lines (42 loc) · 1.24 KB
/
test.cpp
File metadata and controls
53 lines (42 loc) · 1.24 KB
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
#include "pyrochlore.h"
//#include "diamond.h"
//#include "honeycomb.h"
#include <iostream>
using namespace std;
using namespace boost;
void print_run_error(void);
int main(int argc, char* argv[])
{
if (argc != 5)
{
print_run_error();
exit(0);
}
unsigned int N = atoi(argv[1]);
unsigned int SAMPLE = atoi(argv[2]);
double p = strtod(argv[3],0);
double Q = strtod(argv[4],0);
cout << "# n=" << N << endl;
Diamond DM(N);
//Pyrochlore PC(N);
//Honeycomb H(N); // virgin honeycomb
unsigned ncrossed = 0;
for (unsigned j=0;j<SAMPLE;j++)
{
//Pyrochlore P = PC;
Diamond P = DM;
//P.percolate(p, Q); //Jan 21:still to do
ncrossed += P.is_crossable();
}
cout << "#Crossed " << ncrossed << "/" << SAMPLE << endl;
}
void print_run_error(void)
{
cerr << "Usage: main.exe N Sample p q" << endl << endl << "where" << endl
<< "N means and NxN pyrochlore lattice" << endl
<< "Sample is the number of trials" << endl
<< "p is the probability of vertex being there"<<endl
<< "q is the probability of the edge being there" << endl;
cerr << "\nThe algorithm then tries a range of vertex occupation probabilities"
"\np to establish the threshold for this q.\n";
}