this repo has no description
at develop 870 B view raw
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */ 2 3/* 4 * Main authors: 5 * Kevin Leo <kevin.leo@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#include <minizinc/passes/gecode_pass.hh> 13#include <minizinc/solvers/gecode_solverinstance.hh> 14 15namespace MiniZinc { 16 17GecodePass::GecodePass(GecodeOptions* gopts) : _gopts(gopts) {} 18 19Env* GecodePass::run(Env* env, std::ostream& log) { 20 try { 21 GecodeSolverInstance gecode(*env, log, new GecodeOptions(*_gopts)); 22 gecode.processFlatZinc(); 23 gecode.presolve(env->flat()); 24 } catch (const InternalError& e) { 25 std::cerr << "Warning during presolve: " << e.msg() << std::endl; 26 } 27 return env; 28} 29} // namespace MiniZinc