Adding GraphEdgeSet and GraphNodeSet classes to graph_utils.h.
2 * src/lemon/extended_pair.h - Part of LEMON, a generic C++ optimization library
4 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
5 * (Egervary Combinatorial Optimization Research Group, EGRES).
7 * Permission to use, modify and distribute this software is granted
8 * provided that this copyright notice appears in all copies. For
9 * precise terms see the accompanying LICENSE file.
11 * This software is provided "AS IS" with no warranty of any kind,
12 * express or implied, and with no claim as to its suitability for any
17 #ifndef LEMON_EXTENDED_PAIR_H
18 #define LEMON_EXTENDED_PAIR_H
20 template <typename T1, typename A1, typename T2, typename A2>
21 struct extended_pair {
22 typedef T1 first_type;
23 typedef T2 second_type;
25 extended_pair() : first(), second() {}
27 extended_pair(A1 f, A2 s) : first(f), second(s) {}
30 extended_pair(const Pair& pair) : first(pair.first), second(pair.second) {}
36 template <typename T1, typename T2,
37 typename LA1, typename LA2, typename RA1, typename RA2>
38 bool operator==(const extended_pair<T1, LA1, T2, LA2>& left,
39 const extended_pair<T1, RA1, T2, RA2>& right) {
40 return left.first == right.first && left.second == right.second;
43 template <typename T1, typename T2,
44 typename LA1, typename LA2, typename RA1, typename RA2>
45 bool operator!=(const extended_pair<T1, LA1, T2, LA2>& left,
46 const extended_pair<T1, RA1, T2, RA2>& right) {
47 return !(left == right);
50 template <typename T1, typename T2,
51 typename LA1, typename LA2, typename RA1, typename RA2>
52 bool operator<(const extended_pair<T1, LA1, T2, LA2>& left,
53 const extended_pair<T1, RA1, T2, RA2>& right) {
54 return left.first < right.first ||
55 (!(right.first<left.first) && left.second < right.second);
58 template <typename T1, typename T2,
59 typename LA1, typename LA2, typename RA1, typename RA2>
60 bool operator>(const extended_pair<T1, LA1, T2, LA2>& left,
61 const extended_pair<T1, RA1, T2, RA2>& right) {
65 template <typename T1, typename T2,
66 typename LA1, typename LA2, typename RA1, typename RA2>
67 bool operator<=(const extended_pair<T1, LA1, T2, LA2>& left,
68 const extended_pair<T1, RA1, T2, RA2>& right) {
69 return !(right > left);
72 template <typename T1, typename T2,
73 typename LA1, typename LA2, typename RA1, typename RA2>
74 bool operator>=(const extended_pair<T1, LA1, T2, LA2>& left,
75 const extended_pair<T1, RA1, T2, RA2>& right) {
76 return !(right < left);