Changeset - c8ca6f9c1b20
[Not reviewed]
0 1 1
Tom Bannink - 8 years ago 2017-03-13 13:01:35
tom.bannink@cwi.nl
Add makefile and remove forgotten debug line
2 files changed with 11 insertions and 1 deletions:
0 comments (0 inline, 0 general)
cpp/Makefile
Show inline comments
 
new file 100644
 

	
 
INCLUDES += -I.
 

	
 
CXXFLAGS += -std=c++14 -O3 -Wall -Wextra -Wfatal-errors -Wno-deprecated-declarations $(INCLUDES)
 

	
 
switchchain:
 

	
 
# target : dep1 dep2 dep3
 
# 	$@ = target
 
# 	$< = dep1
 
# 	$^ = dep1 dep2 dep3
cpp/graph.hpp
Show inline comments
 
@@ -142,25 +142,24 @@ class Graph {
 
    // Returns false if the switch is not possible
 
    bool exchangeEdges(unsigned int e1index, unsigned int e2index, bool switchType) {
 
        StoredEdge &se1 = edges[e1index];
 
        StoredEdge &se2 = edges[e2index];
 
        const Edge &e1 = se1.e;
 
        const Edge &e2 = se2.e;
 

	
 
        // The new edges configuration is one of these two
 
        // A) e1.u - e2.u and e1.v - e2.v
 
        // B) e1.u - e2.v and e2.u - e1.v
 
        // Note that to do (B) instead of (A), simply swap e2.u <-> e2.v
 
        // Now we can just consider switch type (A)
 
        switchType = false;
 
        if (switchType) {
 
            std::swap(se2.e.u, se2.e.v);
 
            std::swap(se2.u2vindex, se2.v2uindex);
 
        }
 

	
 
        // First check if the move is possible
 
        if (hasEdge({e1.u, e2.u}) || hasEdge({e1.v, e2.v}))
 
            return false; // conflicting edges
 

	
 
        // Clear old edges
 
        badj[e1.u][e1.v] = false;
 
        badj[e1.v][e1.u] = false;
0 comments (0 inline, 0 general)