Sundance::MultiSet< Key > Class Template Reference

List of all members.

Public Member Functions

 MultiSet ()
bool contains (const Key &key) const
void put (const Key &key)
Array< Key > elements () const
std::ostream & toStream (std::ostream &os) const
MultiSet< Key > merge (const MultiSet< Key > &other) const
void mergeFrom (const MultiSet< Key > &other)
Set< Key > toSet () const
std::string toString () const
bool operator== (const MultiSet< int > &other) const

Related Functions

(Note that these are not member functions.)

template<class Key >
MultiSet< Key > makeMultiSet (const Key &k)
template<class Key >
MultiSet< Key > makeMultiSet (const Key &k1, const Key &k2)
template<class Key >
MultiSet< Key > makeMultiSet (const Key &k1, const Key &k2, const Key &k3)
template<class Key >
MultiSet< Key > makeMultiSet (const Key &k1, const Key &k2, const Key &k3, const Key &k4)
template<class Key >
MultiSet< Key > makeMultiSet (const Key &k1, const Key &k2, const Key &k3, const Key &k4, const Key &k5)
template<class Key >
MultiSet< Key > makeMultiSet (const Key &k1, const Key &k2, const Key &k3, const Key &k4, const Key &k5, const Key &k6)
template<class Key >
MultiSet< Key > makeMultiSet (const Array< Key > &k)
template<class Key >
ostream & operator<< (std::ostream &os, const Sundance::MultiSet< Key > &m)


Detailed Description

template<class Key>
class Sundance::MultiSet< Key >

Extension of STL multiset, adding some nicer syntax and an iostream insertion operator.

Definition at line 49 of file SundanceMultiSet.hpp.


Constructor & Destructor Documentation

template<class Key>
Sundance::MultiSet< Key >::MultiSet (  )  [inline]

Definition at line 53 of file SundanceMultiSet.hpp.


Member Function Documentation

template<class Key>
bool Sundance::MultiSet< Key >::contains ( const Key &  key  )  const [inline]

Test whether the specified key is present in the set

Definition at line 56 of file SundanceMultiSet.hpp.

template<class Key >
Array< Key > Sundance::MultiSet< Key >::elements (  )  const [inline]

Write into an array

Definition at line 89 of file SundanceMultiSet.hpp.

Referenced by Sundance::multisetSubsets().

template<class Key>
MultiSet< Key > Sundance::MultiSet< Key >::merge ( const MultiSet< Key > &  other  )  const [inline]

Merge with another multiset, returning the merged set

Definition at line 103 of file SundanceMultiSet.hpp.

References Sundance::MultiSet< Key >::put().

template<class Key>
void Sundance::MultiSet< Key >::mergeFrom ( const MultiSet< Key > &  other  )  [inline]

Take another set and merge into this one, overwriting the original with the merged set

Definition at line 117 of file SundanceMultiSet.hpp.

References Sundance::MultiSet< Key >::put().

template<class Key>
bool Sundance::MultiSet< Key >::operator== ( const MultiSet< int > &  other  )  const [inline]

Definition at line 81 of file SundanceMultiSet.hpp.

template<class Key>
void Sundance::MultiSet< Key >::put ( const Key &  key  )  [inline]

template<class Key >
Set< Key > Sundance::MultiSet< Key >::toSet (  )  const [inline]

Write into a set, i.e., collapsing repeated entries

Definition at line 129 of file SundanceMultiSet.hpp.

References Sundance::Set< Key, Compare >::put().

template<class Key >
std::ostream & Sundance::MultiSet< Key >::toStream ( std::ostream &  os  )  const [inline]

Write to stream

Definition at line 144 of file SundanceMultiSet.hpp.

Referenced by Sundance::MultiSet< Key >::operator<<().

template<class Key >
string Sundance::MultiSet< Key >::toString (  )  const [inline]


Friends And Related Function Documentation

template<class Key >
MultiSet< Key > makeMultiSet ( const Array< Key > &  k  )  [related]

Create a multiset

Definition at line 230 of file SundanceMultiSet.hpp.

References Sundance::MultiSet< Key >::put().

template<class Key >
MultiSet< Key > makeMultiSet ( const Key &  k1,
const Key &  k2,
const Key &  k3,
const Key &  k4,
const Key &  k5,
const Key &  k6 
) [related]

Create a multiset

Definition at line 219 of file SundanceMultiSet.hpp.

References Sundance::MultiSet< Key >::put().

template<class Key >
MultiSet< Key > makeMultiSet ( const Key &  k1,
const Key &  k2,
const Key &  k3,
const Key &  k4,
const Key &  k5 
) [related]

Create a multiset

Definition at line 208 of file SundanceMultiSet.hpp.

References Sundance::MultiSet< Key >::put().

template<class Key >
MultiSet< Key > makeMultiSet ( const Key &  k1,
const Key &  k2,
const Key &  k3,
const Key &  k4 
) [related]

Create a multiset

Definition at line 198 of file SundanceMultiSet.hpp.

References Sundance::MultiSet< Key >::put().

template<class Key >
MultiSet< Key > makeMultiSet ( const Key &  k1,
const Key &  k2,
const Key &  k3 
) [related]

Create a multiset

Definition at line 189 of file SundanceMultiSet.hpp.

References Sundance::MultiSet< Key >::put().

template<class Key >
MultiSet< Key > makeMultiSet ( const Key &  k1,
const Key &  k2 
) [related]

Create a multiset

Definition at line 180 of file SundanceMultiSet.hpp.

References Sundance::MultiSet< Key >::put().

template<class Key >
MultiSet< Key > makeMultiSet ( const Key &  k  )  [related]

Create a multiset

Definition at line 171 of file SundanceMultiSet.hpp.

References Sundance::MultiSet< Key >::put().

template<class Key >
ostream & operator<< ( std::ostream &  os,
const Sundance::MultiSet< Key > &  m 
) [related]

Write to a stream

Definition at line 245 of file SundanceMultiSet.hpp.

References Sundance::MultiSet< Key >::toStream().

Site Contact