BranchControl.hh

00001 /*00002 * Copyright 2007 Martin von Gagern00003 *00004 *00005 * This file is part of bande.00006 *00007 * bande is free software; you can redistribute it and/or modify00008 * it under the terms of the GNU General Public License as published by00009 * the Free Software Foundation; either version 3 of the License, or00010 * (at your option) any later version.00011 *00012 * bande is distributed in the hope that it will be useful,00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the00015 * GNU General Public License for more details.00016 *00017 * You should have received a copy of the GNU General Public License00018 * along with this program. If not, see <http://www.gnu.org/licenses/>.00019 */00020
00021 00022 /**00023 * @file00024 * Interface of class bande::BranchControl.00025 */00026
00027 namespace bande {
00028 00029 /**00030 * Central control of branching algorithm00031 *00032 * This class coordinates the search for solutions. It is probably00033 * the most interesting class of the whole project.00034 */00035class BranchControl {
00036 public:
00037 00038 /**00039 * Constructor.00040 *00041 * @param sols the object where solutions will be collected.00042 */00043BranchControl(Solutions& sols) : sols(sols) { }
00044 00045 /**00046 * Destructor.00047 */00048virtual~BranchControl() { }
00049 00050 /**00051 * Public access to private ip member.00052 */00053IntegerProgram& getIP() { returnip; }
00054
00055 voidrun();
00056
00057 private:
00058 00059 /**00060 * Current integer program.00061 *00062 * Initially this corresponds to the input program, but as the00063 * algorithm proceeds, tighter bounds will be placed on the00064 * variables, to reflect branching decisions.00065 *00066 * The ip is part of BranchControl, not initialized as a separate00067 * object in Settings::run(), in order to avoid one pointer00068 * indirection when accessing this object. It can still be00069 * accessed fully through getIP().00070 */00071IntegerProgramip;
00072 00073 /**00074 * Keep track of changes, used for switching between branches.00075 */00076UndoManagerum;
00077 00078 /**00079 * Record solutions.00080 */00081Solutions& sols;
00082 00083 /**00084 * Collect some statistical informations.00085 */00086Statisticsstatistics;
00087
00088 voidbranch(int depth);
00089 intbranchCol();
00090 };
00091
00092 }