Refactor for robustness and clarity
This commit is contained in:
@@ -11,9 +11,8 @@ public:
|
||||
graph() {}
|
||||
// Initializers:
|
||||
// Read a graph from a file
|
||||
void read(std::string filename);
|
||||
// TODO: generate a random graph
|
||||
void random(int processes, int resources);
|
||||
int read(std::string filename);
|
||||
|
||||
// check functions:
|
||||
// is the graph...
|
||||
bool reducible();// ?
|
||||
@@ -23,17 +22,13 @@ public:
|
||||
// print the graph
|
||||
void print ();
|
||||
|
||||
struct m{
|
||||
int x, y;
|
||||
std::vector<std::vector<int>> data;
|
||||
};
|
||||
typedef std::vector<std::vector<int>> matrix;
|
||||
|
||||
private:
|
||||
int num_processes = 0;
|
||||
int num_resources = 0;
|
||||
std::vector<int> resource_counts;
|
||||
struct m matrix; // Tell me, Mr. Anderson, what good is a phone call if you are unable to speak?
|
||||
bool is_blocked(int process_id);
|
||||
matrix m; // Tell me, Mr. Anderson, what good is a phone call if you are unable to speak?
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user