Refactor for robustness and clarity

This commit is contained in:
2022-04-23 04:47:55 -05:00
parent 8c04650caf
commit 6603f96d69
6 changed files with 97 additions and 72 deletions

View File

@@ -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