25 lines
574 B
C++
25 lines
574 B
C++
|
|
class graph {
|
|
public:
|
|
// Constructors
|
|
graph() {}
|
|
graph(const int processes, const int resources);
|
|
// Initializers:
|
|
void read(std::string filename);
|
|
// check functions:
|
|
// is the graph...
|
|
bool reducible();// ?
|
|
bool knotted();// ?
|
|
|
|
struct m{
|
|
int x, y;
|
|
std::vector<std::vector<int>> data;
|
|
};
|
|
|
|
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);
|
|
}; |