GraphLab: Distributed Graph-Parallel API  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
graphlab::small_set< MAX_DIM, T, Less > Class Template Reference

#include <graphlab/util/small_set.hpp>

List of all members.

Public Types

enum  sizes { max_dim_type = MAX_DIM }
typedef T value_type
typedef T & reference
typedef const T & const_reference
typedef ptrdiff_t difference_type
typedef size_t size_type
typedef T * iterator
typedef const T * const_iterator

Public Member Functions

 small_set ()
 Construct an empty set.
 small_set (const T &elem)
 Create a stack set with just one element.
template<typename OtherT >
 small_set (const std::set< OtherT > &other)
template<size_t OtherSize>
 small_set (const small_set< OtherSize, T, Less > &other)
T * begin ()
 Get the begin iterator.
T * end ()
 get the end iterator
const T * begin () const
 Get the begin iterator.
const T * end () const
 Get the end iterator.
size_t size () const
 get the size of the set
bool empty () const
 determine if there are any elements in the set
bool contains (const T &elem) const
 test whether the set contains the given element
template<size_t OtherDim>
bool contains (const small_set< OtherDim, T, Less > &other) const
 test whether the set contains the given set of element
template<size_t OtherDim>
bool operator<= (const small_set< OtherDim, T, Less > &other) const
template<size_t OtherDim>
bool operator< (const small_set< OtherDim, T, Less > &other) const
template<size_t OtherDim>
bool operator== (const small_set< OtherDim, T, Less > &other) const
void insert (const T &elem)
 insert an element into this set
void insert (const T *begin, const T *end)
 insert a range of elements into this set
void erase (const T &elem)
 remove an element from the set
virtual const T & operator[] (size_t index) const
 get the element at a particular location
small_set operator+ (const T &elem) const
 Take the union of two sets.
template<size_t OtherDim>
small_set< max_type< OtherDim,
MAX_DIM >::value, T, Less > 
operator+ (const small_set< OtherDim, T, Less > &other) const
 Take the union of two sets.
template<size_t OtherDim>
small_setoperator+= (const small_set< OtherDim, T, Less > &other)
 Add the other set to this set.
small_setoperator+= (const T &elem)
template<size_t OtherDim>
small_setoperator-= (const small_set< OtherDim, T, Less > &other)
 Remove the other set from this set.
template<size_t OtherDim>
small_set operator- (const small_set< OtherDim, T, Less > &other) const
 subtract the right set form the left set
template<size_t OtherDim>
small_set operator* (const small_set< OtherDim, T, Less > &other) const
 Take the intersection of two sets.
template<size_t OtherDim>
small_set operator*= (const small_set< OtherDim, T, Less > &other)
 Take the intersection of two sets.
void load (iarchive &arc)
 Load the set form file.
void save (oarchive &arc) const
 Save the set to file.

Detailed Description

template<size_t MAX_DIM, typename T, typename Less = std::less<T>>
class graphlab::small_set< MAX_DIM, T, Less >

This class implements a dense set of fixed maximum size which support quick operations with stack allocation.

Definition at line 47 of file small_set.hpp.


Constructor & Destructor Documentation

template<size_t MAX_DIM, typename T, typename Less = std::less<T>>
template<typename OtherT >
graphlab::small_set< MAX_DIM, T, Less >::small_set ( const std::set< OtherT > &  other)
inline

Create a stack from an std set by adding each element one at a time

Definition at line 80 of file small_set.hpp.

template<size_t MAX_DIM, typename T, typename Less = std::less<T>>
template<size_t OtherSize>
graphlab::small_set< MAX_DIM, T, Less >::small_set ( const small_set< OtherSize, T, Less > &  other)
inline

Create a stack from an std set by adding each element one at a time

Definition at line 92 of file small_set.hpp.


Member Function Documentation

template<size_t MAX_DIM, typename T, typename Less = std::less<T>>
small_set& graphlab::small_set< MAX_DIM, T, Less >::operator+= ( const T &  elem)
inline

Add an element to this set. This is "optimized" since it is used frequently

Definition at line 263 of file small_set.hpp.

template<size_t MAX_DIM, typename T, typename Less = std::less<T>>
template<size_t OtherDim>
bool graphlab::small_set< MAX_DIM, T, Less >::operator< ( const small_set< OtherDim, T, Less > &  other) const
inline

Test if this set is contained in other. If so this returns true.

Definition at line 149 of file small_set.hpp.

template<size_t MAX_DIM, typename T, typename Less = std::less<T>>
template<size_t OtherDim>
bool graphlab::small_set< MAX_DIM, T, Less >::operator<= ( const small_set< OtherDim, T, Less > &  other) const
inline

Test if this set is contained in other. If so this returns true.

Definition at line 139 of file small_set.hpp.


The documentation for this class was generated from the following file: