-
Notifications
You must be signed in to change notification settings - Fork 0
/
frag_count.cpp
65 lines (55 loc) · 1.6 KB
/
frag_count.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
55
56
57
58
59
60
61
62
63
64
65
#include <iostream>
#include <fstream>
#include <limits>
#include <cstdlib>
#include "Cluster.hpp"
#include "makemesh.hpp"
#include "declassifybroken.hpp"
#include "reclassify.hpp"
#include "classifybroken.hpp"
int main()
{
std::vector<Node *> nodelist;
std::vector<Quad *> quadlist;
makemesh(nodelist,quadlist);
//for(size_t c=1;c<17;c++)
//{
// std::cout<<"qaud "<<c<<" has "<<quadlist[c-1]->neighbors().size()<<" neighbors"<<std::endl;
//}
Cluster _all=Cluster(quadlist.size());
Cluster _broken=Cluster(quadlist.size());
//Cluster _candi=Cluster(quadlist.size());
std::list<size_t> _candi;
Cluster * acluster=new Cluster(quadlist);
std::vector<Cluster *> clusterlist;
clusterlist.push_back(acluster);
//std::cout<<clusterlist[0]->quads()[0]->id()<<std::endl;
declassifybroken(clusterlist, _broken, _all);
//while(_all.num_quads()!=0)
//{
reclassify(_all, _candi, _broken,clusterlist);
std::cout<<"obtained "<<clusterlist.size()<<" fragments"<<std::endl;
//}
classifybroken(_broken,clusterlist);
/*
ifstream fin;
fin.open("input.txt");
int score;
for (int i=0;i<5;i++){
fin>>score;
cout<<"the score is"<<score<<endl;
}
double dist = std::numeric_limits<double>::max();
cout<<dist<<endl;
cout << "Hello world!" << endl;
for(unsigned i=0;i<16;i++){
free (nodelist[i]);
}
for(unsigned i=0;i<9;i++){
free (quadlist[i]);
}
*/
//free(acluster);
//free(_broken);
return 0;
}