Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.
Syntax
setCartesian(set1 | set2)
Type Signatures
Array | Matrix, Array | Matrix
Parameters
Name
Type
Description
a1
Array | Matrix
A (multi)set
a2
Array | Matrix
A (multi)set
Returns
Array | Matrix — The cartesian product of two (multi)sets
Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.
Syntax
setDifference(set1 | set2)
Type Signatures
Array | Matrix, Array | Matrix
Parameters
Name
Type
Description
a1
Array | Matrix
A (multi)set
a2
Array | Matrix
A (multi)set
Returns
Array | Matrix — The difference of two (multi)sets
Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.
Syntax
setIsSubset(set1 | set2)
Type Signatures
Array | Matrix, Array | Matrix
Parameters
Name
Type
Description
a1
Array | Matrix
A (multi)set
a2
Array | Matrix
A (multi)set
Returns
boolean — Returns true when a1 is a subset of a2, returns false otherwise
Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.
Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.
Syntax
setSize(set) | setSize(set | unique)
Type Signatures
Array | Matrix, Array | Matrix, boolean
Parameters
Name
Type
Description
a
Array | Matrix
A multiset
unique
boolean
If true, only the unique values are counted. False by default