R: Calculate a Set's Powerset

powerset {set6} | R Documentation

## Calculate a Set's Powerset

### Description

Calculates and returns the powerset of a Set.

### Usage

    powerset(x, simplify = FALSE)

### Arguments

`x` | Set
`simplify` | logical, if `TRUE` then tries to simplify the result to a `Set` otherwise creates an object of class PowersetSet.

### Details

A powerset of a set, S, is defined as the set of all subsets of S, including S itself and the empty set.

### Value

Set

### See Also

Other operators: `setcomplement()`, `setintersect()`, `setpower()`, `setproduct()`, `setsymdiff()`, `setunion()`

### Examples

    # simplify = FALSE is default
    powerset(Set$new(1, 2))
    powerset(Set$new(1, 2), simplify = TRUE)

    # powerset of intervals
    powerset(Interval$new())

    # powerset of powersets
    powerset(powerset(Reals$new()))
    powerset(powerset(Reals$new()))$properties$cardinality

[Package set6 version 0.2.0 Index]