==
Compare terms in and
, select terms with equal weight (terms with same weight and itemset), and return the itemset. Note that the resulting weight of the itemset returned is 1.
The iif function can be used in cases where weight is also selected.
This package can be used with the following comparison operators (functions).
zdd1 == zdd2 : Equal to operator
zdd1 = zdd2 : Greater than or equal to operator
zdd1 zdd2 : Greater than operator
zdd1 = zdd2 : Less than or equal to operator
zdd1 zdd2 : Less than operator
zdd1.ne?(zdd2) : Not equal to function
In addition, same?(==) and diff? can be used to evaluate the equivalence on the complete expression.
> require 'zdd' > a=ZDD::itemset("a") > b=ZDD::itemset("b") > c=ZDD::itemset("c") > x=3*a + 2*b + 2*c > y=2*a + 2*b + 4*c > x.show 3 a + 2 b + 2 c > y.show 2 a + 2 b + 4 c # (x,y is defined above) # Compare x and y, select itemsets with equal weight. > (x==y).show b # Compare x and y, select itemsets with weight that is greater than or equal to y. > (x>=y).show a + b # Compare x and y, select itemsets with unequal weights. > (x.ne?(y)).show a + c # For itemsets present in zdd1 but absent in zdd2 (or vice versa), # the weight is considered as 0. > z=2*a + 2*b > z.show 2 a + 2 b # Since itemset c does not exists in z, the weight is considered as 0. > (x>z).show a + c > (x.ne?(z)).show a + c > (x==z).show b
==, ,
,
,
, ne? : Various comparison operations
iif : Select by comparison of items
same? : Same comparison operator
diff? : Not equal to comparison operator