Subset: subsets and maximal sets

SubsetR Documentation

subsets and maximal sets

Description

Given a list of positive integer vectors representing sets, return a vector of all pairwise intersections (allIntersect), return a vector of all pairwise unions (allUnion), or a vector indicating the sets that are maximal in the sense of not being a subset of any other set in the list (maximal). If the list contains duplicate sets, at most one of each class of duplicates is declared maximal.

Usage

allIntersect(sets, pow2)
allUnion(sets, pow2)
maximal(sets, pow2)

Arguments

sets

a list of vectors of storage.mode "integer". (Unlike most R functions we do not coerce real to integer.)

pow2

use hash table of size 2^pow2. May be missing.

Value

For allIntersect or allUnion a list of length choose(length(sets), 2) giving all pairwise intersections (resp. unions) of elements of sets. For maximal a logical vector of the same length as sets indicating the maximal elements.

Note: allIntersect and allUnion run over the pairs in the same order so they can be matched up.

Note

The functions allIntersect and allUnion were called all.intersect and all.union in previous versions of this package. The names were changed because the all function was made generic and these function are not methods of that one. These functions were originally intended to be used to find the faces of a convex set using the output of scdd but now the allfaces function does a better job and does it much more efficiently. Hence these functions have no known use, but have not been deleted for reasons of backwards compatibility.


rcdd documentation built on April 25, 2023, 1:09 a.m.