.termsEQ(
)
Among the terms in
, select the terms (weight + itemset) where the weight is the same as the constant defined at
.
is a ZDD constant object generated by the constant method, or specified Ruby integer.
The methods used in this package are as follows.
zdd1.termsEQ(zdd2) : equal to comparison
zdd1.termsGE(zdd2) : greater than or equal to comparison
zdd1.termsGT(zdd2) : greater than comparison
zdd1.termsLE(zdd2) : less than comparison
zdd1.termsLT(zdd2) : less than or equal to comparison
zdd1.termsNE(zdd2) : not equal to comparison
> require 'zdd'
> a=ZDD::itemset("a")
> b=ZDD::itemset("b")
> c=ZDD::itemset("c")
> f=5*a + 3*b + c
> f.show
5 a + 3 b + c
# Select terms with weight of 3.
> f.termsEQ(3).show
3 b
# Select terms with weight greater than or equal to 3.
> f.termsGE(3).show
5 a + 3 b
# Select terms with weight not equal to 3.
> f.termsNE(3).show
5 a + c
# Return 0 if none of the terms herein matches the condition.
> f.termsGT(10).show
0
termsGE : Select terms by weight comparison (greater than or equal to comparison)
termsGT : Select terms by weight comparison (greater than comparison)
termsLE : Select terms by weight comparison (less than or equal to comparison)
termsLT : Select terms by weight comparison (less than comparison)
termsNE : Select terms by weight comparison (not equal to comparison)