示例#1
0
        private static bool MatchLocation(BitPointSet locationPointSet, BitPointSet queryPointSet)
        {
            if (!locationPointSet.IsEmpty && locationPointSet.IsSubsetOf(queryPointSet))
            {
                return(true);
            }

            return(false);
        }
示例#2
0
        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);
        }
示例#3
0
 private static bool MatchRelocation(BitPointSet relocationPointSet, BitPointSet queryPointSet)
 {
     return(relocationPointSet.Overlaps(queryPointSet));
 }
示例#4
0
 public bool IsSubsetOf(BitPointSet other)
 {
     return(_cardinality == OpenBitSet.intersectionCount(_points, other._points));
 }
示例#5
0
 public bool Overlaps(BitPointSet other)
 {
     return(_points.intersects(other._points));
 }
示例#6
0
 public void UnionWith(BitPointSet other)
 {
     _points.union(other._points);
     _cardinality = (int)_points.cardinality();
 }