SetUtils
Value members
Concrete methods
Tail recursive pSet pSet s generates the power set of s, pairing each subset with its complement. Example: pSet(Set(1,2)) = Stream((Set(1,2),Set()),(Set(1),Set(2)),(Set(2),Set(1)),(Set(),Set(1,2))).
Tail recursive pSet pSet s generates the power set of s, pairing each subset with its complement. Example: pSet(Set(1,2)) = Stream((Set(1,2),Set()),(Set(1),Set(2)),(Set(2),Set(1)),(Set(),Set(1,2))).
paritition of a set in n sets whose union give that set again Example: partition(Set(1,2),2) = Stream( List(Set(1, 2), SetInt), List(Set(2), Set(1)), List(Set(1), Set(2)), List(SetInt, Set(1, 2)) )
paritition of a set in n sets whose union give that set again Example: partition(Set(1,2),2) = Stream( List(Set(1, 2), SetInt), List(Set(2), Set(1)), List(Set(1), Set(2)), List(SetInt, Set(1, 2)) )
partition(Set(1,2),3) = Stream( List(Set(1, 2), SetInt, SetInt), List(Set(2), Set(1), SetInt), List(Set(2), SetInt, Set(1)), List(Set(1), Set(2), SetInt), List(Set(1), SetInt, Set(2)), List(SetInt, Set(1, 2), SetInt), List(SetInt, Set(2), Set(1)), List(SetInt, Set(1), Set(2)), List(SetInt, SetInt, Set(1, 2)) )
- Type Params
- A
type of values
- Value Params
- n
number of sets to generate
- set
set of elements
- Returns
a list of sets