int UsedElements () const
  {
    int n = hash.Size();
    int cnt = 0;
    for (int i = 0; i < n; i++)
      if (hash[i].I1() != invalid)
	cnt++;
    return cnt;
  }
  int Position (const INDEX_3 & ind) const
  {
    int i = HashValue(ind);
    while (1)
      {
	if (hash[i] == ind) return i;
	if (hash[i].I1() == invalid) return -1;
        i = (i+1) % hash.Size();
      }
  }
  int Position (const INDEX_2 & ind) const
  {
    int i = HashValue(ind);
    while (1)
      {
	if (hash.Get(i) == ind) return i;
	if (hash.Get(i).I1() == invalid) return 0;
	i++;
	if (i > hash.Size()) i = 1;
      }
  }
  int Costs (const INDEX_3 & ind) const
  {
    int i = HashValue(ind);
    int c = 1;
    while (1)
      {
	if (hash[i] == ind) return c;
	if (hash[i].I1() == invalid) return c;
        i = (i+1) % hash.Size();
        c++;
      }
  }
Example #5
0
 int GetNFaces () const
 { return face2vert.Size(); }
Example #6
0
 int GetNEdges () const
 { return edge2vert.Size(); }
Example #7
0
 int GetNSurfedges() const {return surfedges.Size();}
 void DeleteData ()
 { 
   SetSize (cont.Size()); 
 }
 int HashValue (const INDEX_3 & ind) const
 {
   return (ind.I1() + 15 * ind.I2() + 41 * ind.I3()) % hash.Size();
 }
 int Size() const 
 {
   return hash.Size(); 
 }
 int HashValue (const INDEX_2 & ind) const
   {
     return (ind.I1() + 71 * ind.I2()) % hash.Size() + 1;
   }
 int HashValue (const INDEX & ind) const
 {
   return ind % hash.Size() + 1;
 }