private static bool MatchLocation(BitPointSet locationPointSet, BitPointSet queryPointSet) { if (!locationPointSet.IsEmpty && locationPointSet.IsSubsetOf(queryPointSet)) { return(true); } return(false); }
private short Distance(BitPointSet pSet, BitPointSet qSet) { if (pSet.Overlaps(qSet)) // it's faster than comparing distances { return(0); } var minDistance = short.MaxValue; for (var p = pSet.GetNextPoint(0); p != -1; p = pSet.GetNextPoint(p + 1)) { for (var q = qSet.GetNextPoint(0); q != -1; q = qSet.GetNextPoint(q + 1)) { var distance = Distance(p, q); if (distance < minDistance) { minDistance = distance; } } } return(minDistance); }
private static bool MatchRelocation(BitPointSet relocationPointSet, BitPointSet queryPointSet) { return(relocationPointSet.Overlaps(queryPointSet)); }
public bool IsSubsetOf(BitPointSet other) { return(_cardinality == OpenBitSet.intersectionCount(_points, other._points)); }
public bool Overlaps(BitPointSet other) { return(_points.intersects(other._points)); }
public void UnionWith(BitPointSet other) { _points.union(other._points); _cardinality = (int)_points.cardinality(); }