All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Pages
2_local_search_solution_adapter.hpp
Go to the documentation of this file.
1 //=======================================================================
2 // Copyright (c) 2013 Piotr Wygocki
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 //=======================================================================
15 #ifndef PAAL_2_LOCAL_SEARCH_SOLUTION_ADAPTER_HPP
16 #define PAAL_2_LOCAL_SEARCH_SOLUTION_ADAPTER_HPP
17 
19 
20 namespace paal {
21 namespace local_search {
22 
28 template <typename Cycle> class two_local_search_adapter {
29  public:
30  typedef typename Cycle::vertex_iterator vertex_iterator;
32 
38  two_local_search_adapter(Cycle &cm) : m_cycle(cm) {}
39 
45  Iterator begin() const {
46  return data_structures::make_vertex_to_edge_iterator(m_cycle.vbegin(),
47  m_cycle.vend());
48  }
49 
55  Iterator end() const {
56  auto end = m_cycle.vend();
58  }
59 
65  Cycle &get_cycle() { return m_cycle; }
66 
72  const Cycle &get_cycle() const { return m_cycle; }
73 
74  private:
75 
76  Cycle &m_cycle;
77 };
78 
79 } // local_search
80 } // paal
81 
82 #endif // PAAL_2_LOCAL_SEARCH_SOLUTION_ADAPTER_HPP
adapts cycle to have begin and end pointing to edge collection
const Cycle & get_cycle() const
gets adopted cycle const version
bool local_search(Solution &solution, SearchStrategy searchStrategy, ContinueOnSuccess succ, ContinueOnFail fail, components...comps)
detail
transforms collection to collection of pairs consecutive elements of the input collection. The last element and the first element are considered consecutive.
vertex_to_edge_iterator< vertex_iterator > make_vertex_to_edge_iterator(vertex_iterator b, vertex_iterator e)
make for vertex_to_edge_iterator