3.34 maxweight : Value of maximum weight

Format

$obj$.maxweight $\rightarrow $ $zdd$

Description

Among all terms (including constant terms) contained in ZDD object $obj$, return the maximum weight as ZDD constant object.

Example

Example 1: Basic Example

> require 'zdd'
> a=ZDD::itemset("a")
> b=ZDD::itemset("b")
> c=ZDD::itemset("c")
> x=5*a+3*b+c
> x.show
 5 a + 3 b + c
> x.maxweight.show
 5

# Obtain the maximum value including constant terms. 
> x=5*a+3*b+c+10
> x.show
 5 a + 3 b + c + 10
> x.maxweight.show
 10

# Select the term with the maximum weight. 
> x=5*a+3*b+5*c+2
> x.show
 5 a + 3 b + 5 c + 2
> x.termsEQ(x.maxweight).show
 5 a + 5 c

See Also

minweight : Value of minimum weight

totalweight : Sum of weight