3.48 termsEQ : Select terms by weight comparison (equal to comparison)

Format

$obj$.termsEQ($zdd1$) $\rightarrow $ $zdd2$

Description

Among the terms in $obj$, select the terms (weight + itemset) where the weight is the same as the constant defined at $zdd1$.

$zdd1$ is a ZDD constant object generated by the constant method, or specified Ruby integer.

The methods used in this package are as follows.

Example

Example 1: Basic Example

> 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

See Also

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)