/* Copyright (c) 2018
   Charles Jordan (Hokkaido University, Sapporo, Japan),
   Michael Joswig, Lars Kastner (Technische Universitaet Berlin, Germany)

   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 3, or (at your option) any
   later version: http://www.gnu.org/licenses/gpl.txt.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
-----------------------------------------------------------------------------
*/
#include "RegularityCheckCache.hh"


void RegularityCheckCache::init(const std::string& lp_client){
   static polymake::Main pmm("none");
   pmm.set_application("polytope");
#ifndef NO_LP_SOLVE
   static polymake::Scope s = pmm.newScope();
   try{
      s.prefer_now(lp_client);
   } catch(const pm::perl::exception& e){
      throw std::runtime_error("polymake error: Failed to set lp client preference to \"" + lp_client + "\".");
   }
#endif
}
