コード例 #1
0
  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;
      }
  }
コード例 #2
0
  // returns 1, if new postion is created
  int PositionCreate (const INDEX_2 & ind, int & apos)
  {
    int i = HashValue (ind);
    if (hash.Get(i) == ind) 
      {
	apos = i;
	return 0;
      }
    if (hash.Get(i).I1() == invalid)
      {
	hash.Elem(i) = ind; 
	apos = i;
	return 1;
      }
    return PositionCreate2 (ind, apos);    
  }
コード例 #3
0
ファイル: topology.hpp プロジェクト: SangitaSingh/elmerfem
 void GetSurface2VolumeElement (int selnr, int & elnr1, int & elnr2) const
 { 
   elnr1 = surf2volelement.Get(selnr)[0];
   elnr2 = surf2volelement.Get(selnr)[1];
 }
コード例 #4
0
ファイル: topology.hpp プロジェクト: SangitaSingh/elmerfem
 void GetSegmentEdge (int segnr, int & enr, int & orient) const
 {
   enr = abs(segedges.Get(segnr));
   orient = segedges.Get(segnr) > 0 ? 1 : -1;
 }
コード例 #5
0
 const T & GetData (int pos) { return cont.Get(pos); }
コード例 #6
0
 int UsedPos (int pos) const { return ! (hash.Get(pos).I1() == invalid); }
コード例 #7
0
 void GetData (int pos, T & acont) const
 {
   acont = cont.Get(pos);
 }
コード例 #8
0
 void GetData (int pos, INDEX & ahash, T & acont) const
 {
   ahash = hash.Get(pos);
   acont = cont.Get(pos);
 }
コード例 #9
0
 const T & Get (const INDEX & ahash) const
 {
   int pos = Position (ahash);
   return cont.Get(pos);
 }