graph::print
Create function to print a graph
This commit is contained in:
parent
51fbacb024
commit
654fb751e6
@ -5,12 +5,19 @@ public:
|
|||||||
graph() {}
|
graph() {}
|
||||||
graph(const int processes, const int resources);
|
graph(const int processes, const int resources);
|
||||||
// Initializers:
|
// Initializers:
|
||||||
|
// Read a graph from a file
|
||||||
void read(std::string filename);
|
void read(std::string filename);
|
||||||
|
// TODO: generate a random graph
|
||||||
|
void random(int processes, int resources);
|
||||||
// check functions:
|
// check functions:
|
||||||
// is the graph...
|
// is the graph...
|
||||||
bool reducible();// ?
|
bool reducible();// ?
|
||||||
bool knotted();// ?
|
bool knotted();// ?
|
||||||
|
|
||||||
|
// miscellaneous functions:
|
||||||
|
// print the graph
|
||||||
|
void print ();
|
||||||
|
|
||||||
struct m{
|
struct m{
|
||||||
int x, y;
|
int x, y;
|
||||||
std::vector<std::vector<int>> data;
|
std::vector<std::vector<int>> data;
|
||||||
|
@ -21,3 +21,9 @@ graph::graph (const int processes, const int resources) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void graph::print () {
|
||||||
|
printf("np: %d\tnr: %d\n", num_processes, num_resources);
|
||||||
|
printf("resource_counts:\n"); for (auto e: resource_counts) printf("%d\t", e); printf("\n");
|
||||||
|
printf("matrix:\n"); for (auto x: matrix.data) {for (auto y: x) printf("%d\t", y); printf("\n");}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user