3.26 hashout : Hash output

Format

$obj$.hashout $\rightarrow $ $hash$

Description

Convert contents in $zdd$ to Ruby $hash$ object and return the object.

Each hash key corresponds to weight of item set.

However, there is an upper limit to the maximum number of itemsets that can be returned, if it exceeds 4,096,000 itemsets, the output process will be forced to stop.

The partly method can be used to check whether the process stopped during processing.

Example

Example 1: Basic Example

> require 'zdd'
> a=ZDD::itemset("a")
> b=ZDD::itemset("b")
> c=ZDD::itemset("c")
> d=ZDD::itemset("d")
> f=a*b + 2*b*c + 3*d + 4
> h=f.hashout
> p h
{"a b"=>1, "b c"=>2, "d"=>3, ""=>4}

See Also

partly : Partial Hash output flag

to_a : Convert to itemset array

csvout : CSV file output

export : Serialized output of ZDD