-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.cpp
67 lines (58 loc) · 2.19 KB
/
test.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
66
67
/* system example : DIR */
#include <stdio.h> /* printf */
#include <stdlib.h> /* system, NULL, EXIT_FAILURE */
#include <iostream>
#include <vector>
#include <string>
#include <ctime>
#include "prettyPrint.h"
using namespace std;
int main ()
{
int i;
printf ("Checking if processor is available...");
int max_num_partitions = 8;
if (system(NULL)) puts ("Ok");
else exit (EXIT_FAILURE);
vector<char> sample;
sample.push_back('A');
sample.push_back('B');
sample.push_back('C');
string filename,filename2;
string output ("output.csv");
string command;
clock_t start;
system("echo File Name,Algorithim,Number of Partitions,Vertices, Edges,Weights of Partitions,Weight of MST,Multiplicative Spread,Elapsed Time >> testData.csv");
for (int i = 40; i <= 100; i+=10)
{
//do stuff "graph"+i+"Afull.txt"
for (int j = 0; j < sample.size(); ++j)
{
for (int k = 2; k <= max_num_partitions; k++)
{
filename = "graph" +to_string(i) + sample[j] + "half.txt";
command = "echo -n "+filename+",Dynamic Programming Approach with All Trees," + to_string(k)+", >> "+output;
system(command.c_str());
command = "./newdp graphs/"+filename + " " +to_string(k)+ " >> "+ output;
system(command.c_str());
filename = "graph" +to_string(i) + sample[j] + "full.txt";
command = "echo -n "+filename+",Dynamic Programming Approach with All Trees," + to_string(k)+", >> "+output;
system(command.c_str());
command = "./newdp graphs/"+filename + " " +to_string(k)+ " >> "+ output;
system(command.c_str());
filename = "graph" +to_string(i) + sample[j] + "half.txt";
command = "echo -n "+filename+",Segmantation Based Clustring with Modified Kruskal," + to_string(k)+", >> "+output;
system(command.c_str());
command = "./ncut graphs/"+filename + " " +to_string(k)+ " >> "+ output;
system(command.c_str());
cout<<"We are at: "<<filename<<endl;
filename = "graph" +to_string(i) + sample[j] + "full.txt";
command = "echo -n "+filename+",Segmantation Based Clustring with Modified Kruskal," + to_string(k)+", >> "+output;
system(command.c_str());
command = "./ncut graphs/"+filename + " " +to_string(k)+ " >> "+ output;
system(command.c_str());
}
}
}
return 0;
}