virtual void SetUp(){
    //SetUp is called before every test
    LOG_INIT("test.log", NULL, 0);
    creator.set_file_name("data/1dc.128.txt");
    creator.set_graph_type("DIMACS");
    mg = creator.create_mutable_graph();

    //disconnected graph for testing
    creator.set_file_name("data/1et.64.txt");
    creator.set_graph_type("DIMACS");
    mg_dis = creator.create_mutable_graph();
}
Esempio n. 2
0
int main(int argc, char **argv){
    if((argc != 2) || (strcmp(argv[1],"-h") == 0) || (strcmp(argv[1],"--help") == 0) ){
        usage(argv[0]);
    }

    Graph::VertexWeightedGraph *G;

    Graph::GraphCreatorFile creator;
    creator.set_file_name(argv[1]);
    creator.set_graph_type("DIMACS");
    G = creator.create_weighted_mutable_graph();
    G->complement();
    Graph::GraphWriter writer;

    char comp_DIMACS_file[200];
    char normalized_comp_DIMACS_file[200];
    sprintf(comp_DIMACS_file,"%s.comp",argv[1]);
    writer.write_graph(G,comp_DIMACS_file,"DIMACS",true,false);
    // Now normalize it
    sprintf(normalized_comp_DIMACS_file,"%s.norm",comp_DIMACS_file);
    normalize_DIMACS_file(comp_DIMACS_file,normalized_comp_DIMACS_file);
    fprintf(stderr,"Complement graph of %s written to %s in normalized DIMACS form\n",
            argv[1],normalized_comp_DIMACS_file);

    delete G;
    return 1;
} // main
Esempio n. 3
0
void parmetis_with_metmmd(){
    DEBUG("########## Testing Function : %s #################\n", __FUNCTION__);
    int size, rank;
    MPI_Comm comm;
    Graph::GraphEOUtil eoutil;
    Graph::VertexWeightedGraph *wmg;
    Graph::GraphCreatorFile creator;

    int output[] =
    {
        102,58,128,121,86,64,96,112,103,117,120,87,124,126,127,63,95,108,110,111,91,107,109,119,123,125,115,59,61,62,90,93,122,114,106,118,32,116,55,100,16,79,84,78,24,48,52,56,44,54,60,80,28,30,31,40,46,47,72,76,88,92,94,104,8,101,1,42,4,25,97,81,6,7,3,2,73,49,13,5,9,11,17,33,65,66,67,69,10,18,19,21,34,35,37,41,113,15,68,105,77,50,14,43,20,57,12,70,53,51,23,22,36,38,82,83,98,99,74,26,27,29,39,45,71,75,85,89
    };

    MPI_Comm_dup(MPI_COMM_WORLD, &comm);
    MPI_Comm_size(MPI_COMM_WORLD, &size);
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);

    creator.set_file_name("data/1dc.128.txt");
    creator.set_graph_type("DIMACS");
    wmg = creator.create_weighted_mutable_graph();

    vector<int> ordering(wmg->get_num_nodes(), -1);
    eoutil.parmetis_elimination_ordering(wmg, ordering, GD_METIS_MMD, false, comm);
    if(rank == 0){
        int n = wmg->get_num_nodes();
        for(int i = 0; i < n; i++){
            assert (output[i] == ordering[i]);
        }
        cout << "Parmetis Test " << ++testcount << " : Passed" << endl;
    }
} // parmetis_with_metmmd
virtual void SetUp(){
    //SetUp is called before every test
    LOG_INIT("test.log", NULL, 0);
    creator.set_file_name("data/1dc.128.txt");
    creator.set_graph_type("DIMACS");
    wmg = creator.create_weighted_mutable_graph();
}
Esempio n. 5
0
virtual void SetUp(){
    LOG_INIT("test.log", NULL, 0);
    //creator.set_file_name("../data/1dc.128.txt");
    creator.set_file_name("data/1dc.128.txt");
    creator.set_graph_type("DIMACS");
    g = creator.create_graph();
    g_five = new Graph::Graph(5);
}
virtual void SetUp(){
    //SetUp is called before every test
    LOG_INIT("test.log", NULL, 0);
    creator.set_file_name("data/1dc.128.adj");
    creator.set_graph_type("adjmatrix");
    g = creator.create_graph();

    in_file = ("data/1dc.128.met");
}
	virtual void SetUp()
	{
		LOG_INIT("test.log", NULL, 0);
		gr = factory.create_reader("DIMACS");
		gr->read_graph("data/1dc.128.txt");

		creator.set_file_name("data/1dc.128.txt");
		creator.set_graph_type("DIMACS");
		g = creator.create_graph();
	}
Esempio n. 8
0
	virtual void SetUp()
	{
		//SetUp is called before every test
		LOG_INIT("test.log", NULL, 0);
		creator.set_file_name("../data/1dc.128.adj");
		creator.set_graph_type("adjmatrix");
		g = creator.create_graph();

		string out_file("../data/1dc.128.out");
		dim_writer = new Graph::DIMACSGraphWriter(out_file);
	}
Esempio n. 9
0
	virtual void SetUp()
	{
		//SetUp is called before every test
		LOG_INIT("test.log", NULL, 0);
		creator.set_file_name("data/1dc.128.adj");
		creator.set_graph_type("adjmatrix");
		g = creator.create_graph();

		string in_file("data/1dc.128.met");
		mr = new Graph::MetisGraphReader(in_file);
	}