libvata2  [unstable] git snapshot
Classes | Functions
Vata2::util Namespace Reference

Classes

struct  TuplePrinter
 
struct  TuplePrinter< Tuple, 1 >
 

Functions

template<class T >
bool are_disjoint (const std::set< T > &lhs, const std::set< T > &rhs)
 Are two sets disjoint? More...
 
template<class T >
size_t hash_combine (size_t lhs, const T &rhs)
 Combine two hash values. More...
 
template<typename It >
size_t hash_range (It first, It last)
 Hashes a range. More...
 
template<class T , class K >
bool haskey (const T &cont, const K &key)
 checks whether a container with find contains a key More...
 
template<template< class, class, class...> class Map, class T1 , class T2 , class... Args>
Map< T2, T1 > invert_map (const Map< T1, T2 > &mp)
 inverts a map (should work for std::map and std::unordered_map) More...
 

Function Documentation

bool Vata2::util::are_disjoint ( const std::set< T > &  lhs,
const std::set< T > &  rhs 
)

Are two sets disjoint?

Definition at line 44 of file util.hh.

size_t Vata2::util::hash_combine ( size_t  lhs,
const T &  rhs 
)
inline

Combine two hash values.

Values taken from http://www.boost.org/doc/libs/1_64_0/boost/functional/hash/hash.hpp

TODO: fix to be more suitable for 64b

Definition at line 67 of file util.hh.

Referenced by hash_range(), hash< std::pair< A, B > >::operator()(), and hash< Vata2::Nfa::Trans >::operator()().

size_t Vata2::util::hash_range ( It  first,
It  last 
)
bool Vata2::util::haskey ( const T &  cont,
const K &  key 
)
inline

checks whether a container with find contains a key

Definition at line 96 of file util.hh.

Referenced by Nfa::has_final(), and Nfa::has_initial().

Map<T2, T1> Vata2::util::invert_map ( const Map< T1, T2 > &  mp)

inverts a map (should work for std::map and std::unordered_map)

Definition at line 103 of file util.hh.