Back to index

texmacs  1.0.7.15
Classes | Functions
hashset.hpp File Reference
#include "list.hpp"
#include "hashset.cpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  hashset_rep< T >
class  hashset< T >

Functions

template<class T >
int N (hashset< T > h)
template<class T >
tm_ostreamoperator<< (tm_ostream &out, hashset< T > h)
template<class T >
bool operator<= (hashset< T > h1, hashset< T > h2)
 CONCRETE_TEMPLATE_CODE (hashset, class, T)
template<class T >
bool operator== (hashset< T > h1, hashset< T > h2)
template<class T >
bool operator< (hashset< T > h1, hashset< T > h2)

Function Documentation

CONCRETE_TEMPLATE_CODE ( hashset  ,
class  ,
T   
)
template<class T >
int N ( hashset< T h) [inline]

Definition at line 55 of file hashset.hpp.

{ return h->size; }
template<class T >
bool operator< ( hashset< T h1,
hashset< T h2 
)

Definition at line 83 of file hashset.cpp.

                                          {
  return (N(h1)<N(h2)) && (h1<=h2);
}

Here is the call graph for this function:

template<class T >
tm_ostream& operator<< ( tm_ostream out,
hashset< T h 
)

Definition at line 93 of file hashset.cpp.

                                            {
  int i=0, j=0, n=h->n, size=h->size;
  out << "{ ";
  for (; i<n; i++) {
    list<T> l=h->a[i];
    for (; !is_nil (l); l=l->next, j++) {
      out << l->item;
      if (j!=size-1) out << ", ";
    }
  }
  out << " }";
  return out;
}

Here is the call graph for this function:

template<class T >
bool operator<= ( hashset< T h1,
hashset< T h2 
)

Definition at line 71 of file hashset.cpp.

                                           {
  int i=0, j=0, n=h1->n;
  if (N(h1)>N(h2)) return false;
  for (; i<n; i++) {
    list<T> l=h1->a[i];
    for (; !is_nil (l); l=l->next, j++)
      if (!h2->contains (l->item)) return false;
  }
  return true;
}

Here is the call graph for this function:

template<class T >
bool operator== ( hashset< T h1,
hashset< T h2 
)

Definition at line 88 of file hashset.cpp.

                                           {
  return (N(h1)==N(h2)) && (h1<=h2);
}

Here is the call graph for this function: