3.15 count : Count the number of terms

Format

$obj$.count $\rightarrow $ $numItemsets$

  $numItemsets$ : integer

Description

Return the number of terms (number of itemsets) stored in $obj$.

Example

Example 1: Basic Example

> require 'zdd'
> a=ZDD::itemset("a")
> b=ZDD::itemset("b")
> f=a+b+a*b
> f.show
 a b + a + b
> puts f.count
3

> g=a+b+a*b+1
> g.show
 a b + a + b + 1
> puts g.count
4

> c=ZDD::constant(0)
> puts c.count
0

> d=ZDD::constant(1)
> puts d.count
1

See Also