Public Member Functions | Related Functions
Sundance::MultiSet< Key > Class Template Reference
Inheritance diagram for Sundance::MultiSet< Key >:
multiset

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 60 of file SundanceMultiSet.hpp.


Constructor & Destructor Documentation

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

Definition at line 64 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 67 of file SundanceMultiSet.hpp.

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

Write into an array

Definition at line 100 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 114 of file SundanceMultiSet.hpp.

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

Referenced by Sundance::ExprWithChildren::indexSetProduct().

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 128 of file SundanceMultiSet.hpp.

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

Definition at line 92 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 140 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 155 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 Key &  k) [related]

Create a multiset

Definition at line 182 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 191 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 200 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 209 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 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,
const Key &  k6 
) [related]

Create a multiset

Definition at line 230 of file SundanceMultiSet.hpp.

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

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

Create a multiset

Definition at line 241 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 256 of file SundanceMultiSet.hpp.

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

Site Contact