39#include <unordered_map>
42namespace matching_blossom {
45template<
class TWeight>
47 return std::numeric_limits<TWeight>::has_infinity ? std::numeric_limits<TWeight>::infinity()
48 : std::numeric_limits<TWeight>::max();
53template<
class K,
class V>
55 auto it = map.find(key);
56 if (it != map.end()) {
64template<
class TWeight>
70template<
class TWeight>
72 if (std::numeric_limits<TWeight>::is_integer) {
83template<
typename Key,
typename Value>
85 using MapIterator =
typename std::unordered_map<Key, Value>::iterator;
91 Key*
operator->() {
return (Key*
const)&(MapIterator::operator->()->first); }
93 Key
operator*() {
return MapIterator::operator*().first; }
97template<
typename Key,
typename Value>
99 using MapIterator =
typename std::unordered_map<Key, Value>::iterator;
105 Value*
operator->() {
return (Value*
const)&(MapIterator::operator->()->second); }
107 Value
operator*() {
return MapIterator::operator*().second; }
111template<
template<
typename,
typename>
class Iterator,
typename Key,
typename Value>
115 std::unordered_map<Key, Value>&
m_map;
127template<
typename Key,
typename Value>
130template<
typename Key,
typename Value>
Includes declaration of graph class.
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Class for the representation of edges.
Stores additional attributes of a graph (like layout information).
int intWeight(edge e) const
Returns the (integer) weight of edge e.
double doubleWeight(edge e) const
Returns the (real number) weight of edge e.
bool has(long attr) const
Returns true iff all attributes in attr are available.
static const long edgeIntWeight
Corresponds to edge attribute intWeight(edge).
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Dummy class for scoped iteration of a std::unordered_map.
BaseIteratorContainer(std::unordered_map< Key, Value > &map)
std::unordered_map< Key, Value > & m_map
Iterator< Key, Value > iterator
Iterator to access the keys of a std::unordered_map.
typename std::unordered_map< Key, Value >::iterator MapIterator
MapKeyIterator(MapIterator it_)
Iterator to access the values of a std::unordered_map.
typename std::unordered_map< Key, Value >::iterator MapIterator
MapValueIterator(MapIterator it_)
TWeight getWeight(edge e, const EdgeArray< TWeight > &weights)
Helper function to get the edge weight of e from the EdgeArray weights.
V * tryGetPointerFromMap(const std::unordered_map< K, V * > &map, const K &key)
Return the pointer belonging to key key int the given map map, or nullptr if key does not exist.
TWeight infinity()
Helper function to get the maximum value for a given weight type.
The namespace for all OGDF objects.