Commit a9a791c5 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 82e47bc1
......@@ -160,7 +160,15 @@ func (A PPTreeSubSet) UnionInplace(B PPTreeSubSet) {
A.xUnionInplace(B)
}
// XXX Difference
// Difference returns D = PP(A.leafs \ B.leafs)
//
// In other words ... XXX
func (A PPTreeSubSet) Difference(B PPTreeSubSet) PPTreeSubSet {
D := A.Clone()
D.DifferenceInplace(B)
return D
}
// DifferenceInplace sets A = PP(A.leafs \ B.leafs)
//
......
......@@ -128,8 +128,6 @@ func (S *RangeSet) verify() {
}
}
// XXX Equal
// Clone returns copy of the set.
func (orig *RangeSet) Clone() *RangeSet {
klon := &RangeSet{}
......@@ -137,6 +135,20 @@ func (orig *RangeSet) Clone() *RangeSet {
return klon
}
// Equal returns whether A == B.
func (A *RangeSet) Equal(B *RangeSet) bool {
if len(A.rangev) != len(B.rangev) {
return false
}
for i, ra := range A.rangev {
rb := B.rangev[i]
if ra != rb {
return false
}
}
return true
}
func (S RangeSet) String() string {
s := "{"
for i, r := range S.rangev {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment