A set of benchmarks to compare a new prototype MiniZinc implementation
at develop 57 lines 1.7 kB view raw
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */ 2 3/* 4 * Main authors: 5 * Guido Tack <guido.tack@monash.edu> 6 */ 7 8/* This Source Code Form is subject to the terms of the Mozilla Public 9 * License, v. 2.0. If a copy of the MPL was not distributed with this 10 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 11 12#ifndef __MINIZINC_mipDOMAINS_HH__ 13#define __MINIZINC_mipDOMAINS_HH__ 14 15#include <minizinc/flatten.hh> 16#include <minizinc/hash.hh> 17#include <minizinc/utils.hh> 18 19#include <array> 20#include <set> 21 22#ifdef _MSC_VER 23#define _CRT_SECURE_NO_WARNINGS 24#undef ERROR // MICROsoft. 25#undef min 26#undef max 27#endif 28 29#define MZN_MIPD__assert_soft(c, e) \ 30 do { \ 31 static int nn = 0; \ 32 if (!(c)) \ 33 if (++nn <= 1) std::cerr << e << std::endl; \ 34 } while (0) 35#define MZN_MIPD__assert_hard(c) MZN_ASSERT_HARD(c) 36#define MZN_MIPD__assert_hard_msg(c, e) MZN_ASSERT_HARD_MSG(c, e) 37struct MIPD_Infeasibility_Exception { 38 std::string msg; 39 MIPD_Infeasibility_Exception(const std::string& s) : msg(s) {} 40}; 41#define MZN_MIPD__assert_for_feas(c, e) \ 42 do { \ 43 if (!(c)) { \ 44 std::ostringstream oss; \ 45 oss << e; \ 46 throw MIPD_Infeasibility_Exception(oss.str()); \ 47 } \ 48 } while (0) 49 50namespace MiniZinc { 51 52/// Linearize domain constraints in \a env 53void MIPdomains(Env& env, bool fVerbose = false, int = 0, double = 3.0); 54 55} // namespace MiniZinc 56 57#endif