Logo Search packages:      
Sourcecode: lttoolbox version File versions  Download package

bool Transducer::isEmptyIntersection ( set< int > const &  s1,
set< int > const &  s2 
) [static, private]

Test if the intersection of two sets is empty

Parameters:
s1 first set
s2 second set
Returns:
true if the intersection is empty

Definition at line 257 of file transducer.cc.

Referenced by determinize().

{

  if(s1.size() < s2.size())
  {
    for(set<int>::iterator it = s1.begin(), limit = s1.end(); it != limit; it++)
    {
      if(s2.find(*it) != s2.end())
      {
      return false;
      }
    }    
  }
  else
  {
    for(set<int>::iterator it = s2.begin(), limit = s2.end(); it != limit; it++)
    {
      if(s1.find(*it) != s1.end())
      {
        return false;
      }
    }
  }

  return true;
}


Generated by  Doxygen 1.6.0   Back to index