X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=kaps.c;h=88dbebde3e6bdf7e246b4f3a5d2315d508d2ed6e;hb=cb161014c2c988034c79ec3b029a28871d5ad6b2;hp=577649362fa3e601241af1a15c4510a1b2d9a93c;hpb=42c981c6b53e8474a41b053247d90dcb6059b850;p=libfirm diff --git a/kaps.c b/kaps.c index 577649362..88dbebde3 100644 --- a/kaps.c +++ b/kaps.c @@ -1,3 +1,31 @@ +/* + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * + * This file is part of libFirm. + * + * This file may be distributed and/or modified under the terms of the + * GNU General Public License version 2 as published by the Free Software + * Foundation and appearing in the file LICENSE.GPL included in the + * packaging of this file. + * + * Licensees holding valid libFirm Professional Edition licenses may use + * this file in accordance with the libFirm Commercial License. + * Agreement provided with the Software. + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ + +/** + * @file + * @brief Partitioned Boolean Quadratic Problem (PBQP) solver. + * @date 02.10.2008 + * @author Sebastian Buchwald + * @version $Id$ + */ +#include "config.h" + #include "adt/array.h" #include "kaps.h" @@ -49,10 +77,21 @@ pbqp *alloc_pbqp(unsigned number_nodes) pbqp->solution = 0; pbqp->num_nodes = number_nodes; +#if KAPS_DUMP pbqp->dump_file = NULL; +#endif pbqp->nodes = obstack_alloc(&pbqp->obstack, number_nodes * sizeof(*pbqp->nodes)); memset(pbqp->nodes, 0, number_nodes * sizeof(*pbqp->nodes)); +#if KAPS_STATISTIC + pbqp->num_bf = 0; + pbqp->num_edges = 0; + pbqp->num_r0 = 0; + pbqp->num_r1 = 0; + pbqp->num_r2 = 0; + pbqp->num_rm = 0; + pbqp->num_rn = 0; +#endif return pbqp; } @@ -106,8 +145,10 @@ num get_solution(pbqp *pbqp) return pbqp->solution; } +#if KAPS_DUMP void set_dumpfile(pbqp *pbqp, FILE *f) { assert(pbqp); pbqp->dump_file = f; } +#endif