Set (topology v0.1.4)
Operations for sets.
Link to this section Summary
Functions
Returns a function set of the given sets.
Returns a intersection of the given sets.
Returns a power set of the given set.
Returns a union of the given sets.
Link to this section Functions
Link to this function
function_set(domain_set, codomain_set)
Returns a function set of the given sets.
examples
Examples
iex> Set.function_set(MapSet.new([:a, :b, :c]), MapSet.new([1, 2, 3]))
MapSet.new([%{a: 1}, %{a: 2}, %{a: 3}, %{b: 1}, %{b: 2}, %{b: 3}, %{c: 1}, %{c: 2}, %{c: 3}])
Link to this function
intersection(set)
Returns a intersection of the given sets.
examples
Examples
iex> Set.intersection(MapSet.new([MapSet.new([3, 4, 6]), MapSet.new([1, 4, 3]), MapSet.new([5, 2, 3])]))
MapSet.new([3])
Link to this function
power_set(set)
Returns a power set of the given set.
examples
Examples
iex> Set.power_set(MapSet.new([1, 2, 3]))
MapSet.new([MapSet.new([]), MapSet.new([1]), MapSet.new([2]), MapSet.new([3]), MapSet.new([1, 2]), MapSet.new([1, 3]), MapSet.new([2, 3]), MapSet.new([1, 2, 3])])
Link to this function
union(set)
Returns a union of the given sets.
examples
Examples
iex> Set.union(MapSet.new([MapSet.new([3, 4, 6]), MapSet.new([1, 4, 3]), MapSet.new([5, 2, 3])]))
MapSet.new([1, 2, 3, 4, 5, 6])