Back to index

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

Go to the source code of this file.

Defines

#define HASHSET_CC

Functions

template<class T >
static Tsearch (list< T > l, T x)
template<class T >
bool operator<= (hashset< T > h1, hashset< T > h2)
template<class T >
bool operator< (hashset< T > h1, hashset< T > h2)
template<class T >
bool operator== (hashset< T > h1, hashset< T > h2)
template<class T >
tm_ostreamoperator<< (tm_ostream &out, hashset< T > h)

Define Documentation

#define HASHSET_CC

Definition at line 13 of file hashset.cpp.


Function Documentation

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:

template<class T >
static T* search ( list< T l,
T  x 
) [static]

Definition at line 35 of file hashset.cpp.

                        {
  while (!is_nil (l)) {
    if (l->item==x) return &(l->item);
    l= l->next;
  }
  return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function: