/** * Typed Set Functions * * Polymorphic set (multiset) operations using typed-function for runtime dispatch. * Supports `Array` inputs; Matrix inputs are treated as flat arrays. * * All operations follow the mathjs convention: * - Multi-dimension arrays are flattened before the operation. * - Set operations respect multiplicity (multiset semantics), matching * the mathjs `setUnion`, `setIntersect`, etc. behaviour. * - The "natural" comparison used for identity is strict equality (`===`) * for primitives and structural for objects (via JSON-stable stringify), * matching the relevant subset of mathjs's `compareNatural`. * * @packageDocumentation */ /** * Create the union of two (multi)sets. * Multi-dimension arrays will be flattened before the operation. * * Union = symDifference ∪ intersection (elements from both sets, respecting multiplicity). * * @example * ```typescript * setUnion([1, 2, 3, 4], [3, 4, 5, 6]) // [1, 2, 3, 4, 5, 6] * setUnion([1, 2, 2], [2, 3]) // [1, 2, 2, 3] * ``` */ export declare const setUnion: import("@danielsimonjr/mathts-core").TypedFunction; /** * Create the intersection of two (multi)sets. * Multi-dimension arrays will be flattened before the operation. * * @example * ```typescript * setIntersect([1, 2, 3, 4], [3, 4, 5, 6]) // [3, 4] * setIntersect([1, 2, 2], [2, 2, 3]) // [2, 2] * ``` */ export declare const setIntersect: import("@danielsimonjr/mathts-core").TypedFunction; /** * Create the difference of two (multi)sets: elements of a1 not in a2. * Multi-dimension arrays will be flattened before the operation. * * @example * ```typescript * setDifference([1, 2, 3, 4], [3, 4, 5, 6]) // [1, 2] * setDifference([1, 2, 2], [2]) // [1, 2] * ``` */ export declare const setDifference: import("@danielsimonjr/mathts-core").TypedFunction; /** * Create the symmetric difference of two (multi)sets. * Multi-dimension arrays will be flattened before the operation. * * @example * ```typescript * setSymDifference([1, 2, 3, 4], [3, 4, 5, 6]) // [1, 2, 5, 6] * ``` */ export declare const setSymDifference: import("@danielsimonjr/mathts-core").TypedFunction; /** * Check whether a (multi)set is a subset of another (multi)set. * Every element of a1 (with multiplicity) must appear in a2. * * @example * ```typescript * setIsSubset([1, 2], [1, 2, 3]) // true * setIsSubset([1, 4], [1, 2, 3]) // false * setIsSubset([], [1, 2]) // true * ``` */ export declare const setIsSubset: import("@danielsimonjr/mathts-core").TypedFunction; /** * Count how many times a value appears in a multiset. * * @example * ```typescript * setMultiplicity(2, [1, 2, 2, 4]) // 2 * setMultiplicity(1, [1, 2, 2, 4]) // 1 * setMultiplicity(5, [1, 2, 2, 4]) // 0 * ``` */ export declare const setMultiplicity: import("@danielsimonjr/mathts-core").TypedFunction; /** * Create the powerset of a (multi)set. * Returns all possible subsets ordered by size, then lexicographically. * A multi-dimension array will be flattened before the operation. * * @example * ```typescript * setPowerset([1, 2, 3]) * // [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]] * ``` */ export declare const setPowerset: import("@danielsimonjr/mathts-core").TypedFunction; /** * Collect the distinct elements of a multiset. * A multi-dimension array will be flattened before the operation. * * @example * ```typescript * setDistinct([1, 1, 1, 2, 2, 3]) // [1, 2, 3] * ``` */ export declare const setDistinct: import("@danielsimonjr/mathts-core").TypedFunction; /** * Count the number of elements of a (multi)set. * When the second argument is `true`, count only unique values. * A multi-dimension array will be flattened before the operation. * * @example * ```typescript * setSize([1, 2, 2, 4]) // 4 * setSize([1, 2, 2, 4], true) // 3 * ``` */ export declare const setSize: import("@danielsimonjr/mathts-core").TypedFunction; /** * Create the Cartesian product of two (multi)sets. * Multi-dimension arrays will be flattened and values will be sorted before the operation. * * @example * ```typescript * setCartesian([1, 2], [3, 4]) * // [[1, 3], [1, 4], [2, 3], [2, 4]] * ``` */ export declare const setCartesian: import("@danielsimonjr/mathts-core").TypedFunction; /** * All typed set functions. */ export declare const typedSet: { setUnion: import("@danielsimonjr/mathts-core").TypedFunction; setIntersect: import("@danielsimonjr/mathts-core").TypedFunction; setDifference: import("@danielsimonjr/mathts-core").TypedFunction; setSymDifference: import("@danielsimonjr/mathts-core").TypedFunction; setIsSubset: import("@danielsimonjr/mathts-core").TypedFunction; setMultiplicity: import("@danielsimonjr/mathts-core").TypedFunction; setPowerset: import("@danielsimonjr/mathts-core").TypedFunction; setDistinct: import("@danielsimonjr/mathts-core").TypedFunction; setSize: import("@danielsimonjr/mathts-core").TypedFunction; setCartesian: import("@danielsimonjr/mathts-core").TypedFunction; }; //# sourceMappingURL=set.d.ts.map