Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

PowersetSet

Set of Powersets


Description

PowersetSet class for symbolic powerset of mathematical sets.

Details

The purpose of this class is to provide a symbolic representation for the powerset of sets that cannot be represented in a simpler class. Whilst this is not an abstract class, it is not recommended to construct this class directly but via the set operation methods.

Super classes

Methods

Public methods


Method new()

Create a new PowersetSet object. It is not recommended to construct this class directly.

Usage
PowersetSet$new(set)
Arguments
set

Set to wrap.

Returns

A new PowersetSet object.


Method strprint()

Creates a printable representation of the object.

Usage
PowersetSet$strprint(n = 2)
Arguments
n

numeric. Number of elements to display on either side of ellipsis when printing.

Returns

A character string representing the object.


Method contains()

Tests if elements x are contained in self.

Usage
PowersetSet$contains(x, all = FALSE, bound = NULL)
Arguments
x

Set or vector of Sets.

x

Set or vector of Sets.

all

logical. If FALSE tests each x separately. Otherwise returns TRUE only if all x pass test.

all

logical. If FALSE tests each x separately. Otherwise returns TRUE only if all x pass test.

bound

logical

Returns

If all == TRUE then returns TRUE if all x are contained in self, otherwise FALSE. If all == FALSE returns a vector of logicals corresponding to the length of x, representing if each is contained in self. If bound == TRUE then an element is contained in self if it is on or within the (possibly-open) bounds of self, otherwise TRUE only if the element is within self or the bounds are closed.


Method isSubset()

Tests if x is a (proper) subset of self.

Usage
PowersetSet$isSubset(x, proper = FALSE, all = FALSE)
Arguments
x

Set or vector of Sets.

x

Set or vector of Sets.

proper

logical. If TRUE tests for proper subsets.

all

logical. If FALSE tests each x separately. Otherwise returns TRUE only if all x pass test.

all

logical. If FALSE tests each x separately. Otherwise returns TRUE only if all x pass test.

Returns

If all == TRUE then returns TRUE if all x are (proper) subsets of self, otherwise FALSE. If all == FALSE returns a vector of logicals corresponding to the length of x, representing if each is a (proper) subset of self.


Method clone()

The objects of this class are cloneable with this method.

Usage
PowersetSet$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also


set6

R6 Mathematical Sets Interface

v0.2.1
MIT + file LICENSE
Authors
Raphael Sonabend [aut, cre] (<https://orcid.org/0000-0001-9225-4654>), Franz Kiraly [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.