Move reducible into its own file

This commit is contained in:
John 2022-04-22 14:08:28 -05:00
parent 476aec5734
commit b4a3beda69
2 changed files with 20 additions and 17 deletions

View File

@ -1,23 +1,6 @@
#include <cstdlib>
#include "graph.hpp"
/* reducible:
Perform the graph reduction algorithm on the adjacency matrix to detect deadlocks
This algorithm is described in section 5.2 of the Zybook
(!THIS MODIFIES THE GRAPH!)
@params: none, uses class-internal data
@returns:
bool:
false if graph is not reducible (deadlock)
true if graph is reducible (no deadlock)
*/
bool graph::reducible() {
// TODO: Implement a function which checks if a process is blocked
// TODO: Use that function to implement the graph reduction algorithm
//? Make sure when reducing the graph, you don't try to delete the
return false;
}
/* knotted:
Perform the knot detection algorithm on the adjacency matrix to detect deadlocks
(!THIS MODIFIES THE GRAPH!)

20
src/reducible.cpp Normal file
View File

@ -0,0 +1,20 @@
#include <cstdlib>
#include "graph.hpp"
/* reducible:
Perform the graph reduction algorithm on the adjacency matrix to detect deadlocks
This algorithm is described in section 5.2 of the Zybook
(!THIS MODIFIES THE GRAPH!)
@params: none, uses class-internal data
@returns:
bool:
false if graph is not reducible (deadlock)
true if graph is reducible (no deadlock)
*/
bool graph::reducible()
{
// TODO: Implement a function which checks if a process is blocked
// TODO: Use that function to implement the graph reduction algorithm
//? Make sure when reducing the graph, you don't try to delete the
return false;
}