OKlibrary  0.2.1.6
MinimumTransversals_VanderWaerden.cpp
Go to the documentation of this file.
00001 // Oliver Kullmann, 14.6.2009 (Swansea)
00002 /* Copyright 2009 Oliver Kullmann
00003 This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
00004 it and/or modify it under the terms of the GNU General Public License as published by
00005 the Free Software Foundation and included in this library; either version 3 of the
00006 License, or any later version. */
00007 
00030 #include <set>
00031 #include <vector>
00032 #include <stdexcept>
00033 
00034 #include <OKlib/Combinatorics/Hypergraphs/Generators/VanderWaerden.hpp>
00035 
00036 #include <OKlib/Combinatorics/Hypergraphs/Transversals/Bounded/MinimumTransversalsMongen.hpp>
00037 
00038 namespace OKlib {
00039  namespace Combinatorics {
00040   namespace Hypergraphs {
00041    namespace Transversals {
00042     namespace Bounded {
00043 
00044       OKlib::Combinatorics::Hypergraphs::Generators::Arithprog_finish<hyperedge_type, hyperedge_list_type, vertex_type> prog_gen;
00045 
00046       void initialise(const vertex_type, const parameter_type& P) {
00047         if (P.empty())
00048           throw std::runtime_error
00049             ("ERROR[MinimumTransversals_VanderWaerden]: "
00050              "The progression-length must be provided as parameter.");
00051         prog_gen.set(P.front());
00052       }
00053 
00054       hyperedge_list_type generator(const vertex_type n) {
00055         return prog_gen(n);
00056       }
00057 
00058     }
00059    }
00060   }
00061  }
00062 }
00063