From b19bd8d8a41664328f33c9b459b2b0100f0b303f Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Fri, 9 Nov 2012 12:17:46 +1100 Subject: Add an MCF operator to the separate solver For the solver utility it'd be good to have MCF problems, so here they are! Format is: MCF(cost*) Supplies is a [int,int,int,...], where each int represents a new node Arcs is [int:int, int:int, int:int, ...] where each int:int pair represents an edge from the first to the second (1 indexed from the "supplies" array). Costs is the argument to the function. There must be as many costs as arcs, and they are set from left to right, in order. --- impl/Makefile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'impl/Makefile') diff --git a/impl/Makefile b/impl/Makefile index ca0b37d..492528d 100644 --- a/impl/Makefile +++ b/impl/Makefile @@ -2,7 +2,8 @@ CC=gcc CPP=g++ BUILD=build PARSER=parser -FLAGS=-Wall -Werror -Wextra -pedantic -lantlr3c -fno-exceptions -lrt +FLAGS= -lantlr3c -fno-exceptions -lrt +#-Wall -Werror -Wextra -pedantic -lantlr3c -fno-exceptions -lrt NORMAL_FLAGS=$(FLAGS) -g -pg OPTIMISED_FLAGS=$(FLAGS) -O3 @@ -16,16 +17,19 @@ check-syntax: $(PARSER) -$(CPP) $(FLAGS) -o /tmp/null -x c++ $(CHK_SOURCES) # the - is to ignore the return code. -$(BUILD)/main: $(BUILD) $(PARSER) main.cpp *.hpp - $(CPP) main.cpp $(PARSER)/*.o -o $(BUILD)/main $(NORMAL_FLAGS) +$(BUILD)/main: $(BUILD) $(PARSER) main.o MCFSimplex.o + $(CPP) main.o MCFSimplex.o $(PARSER)/*.o -o $(BUILD)/main $(NORMAL_FLAGS) -$(BUILD)/fast: $(BUILD) $(PARSER) main.cpp *.hpp - $(CPP) main.cpp $(PARSER)/*.o -o $(BUILD)/fast $(OPTIMISED_FLAGS) +main.o: main.cpp *.hpp *.h + $(CPP) -c main.cpp $(NORMAL_FLAGS) + +MCFSimplex.o: MCFSimplex.cpp *.h + $(CPP) -c MCFSimplex.cpp $(NORMAL_FLAGS) $(PARSER): EquationSystem.g mkdir -p $(PARSER) java -jar ../antlr/antlr-3.4-complete.jar -o $(PARSER) EquationSystem.g - cd $(PARSER); $(CC) *.c -c -lantrl3c + cd $(PARSER); $(CC) *.c -c -lantlr3c $(BUILD): mkdir -p $(BUILD) @@ -37,3 +41,4 @@ test: $(BUILD)/main clean: rm -rf $(BUILD) rm -rf $(PARSER) + rm -rf *.o -- cgit v1.2.3