algebraixlib.mathobjects.set module¶
Provide the class Set; it represents a set.
-
algebraixlib.mathobjects.set.make_set_unchecked(*args)[source]¶ Factory wrapper to create a
Set(unchecked version).
-
class
algebraixlib.mathobjects.set.Set(*args, direct_load=False)[source]¶ Bases:
algebraixlib.mathobjects.mathobject.MathObjectA set containing zero or more different
MathObjectinstances.Parameters: - args – Zero or more unnamed arguments that are placed into the created
Set. If you want to pass in an iterable, you need to prefix it with an asterisk*. If no argument is given or the given iterable is empty, an empty set is created. (A Python string of typestris an iterable, but it is considered a single, non-iterable argument.) - direct_load – (Optional) Set to
Trueif you know that all arguments (or all elements of the iterable) are instances ofMathObject.
-
data¶ Read-only; return the elements of this instance as a
frozensetofMathObjectinstances.
-
has_element(elem: algebraixlib.mathobjects.mathobject.MathObject) → bool[source]¶ Return whether
elemis an element of this set.elemmust be aMathObject.For a more relaxed version (that auto-converts non-
MathObjectarguments into instances ofAtom) see__contains__and the constructelem in Set.
-
get_ground_set() → algebraixlib.structure.Structure[source]¶ Return the ground set of the lowest-level algebra of this
Set.
-
__ne__(other)[source]¶ Implement value-based inequality. Return
Trueif type or set elements don’t match.
-
__contains__(item)[source]¶ Return
Trueifitemis a member of this set. Ifitemis not aMathObject, it is converted into anAtom.This allows Boolean expressions of the form
element in Set.
-
__call__()[source]¶ With the syntax
mo(left), return the right associated withleft.Parameters: Returns: If
selfis a function, return the right component of the couplet that has as left the single argument if one exists; returnUndef()if no couplet with the given left exists. Also returnUndef()ifselfis not a function.
-
__le__(other, NotImplemented=NotImplemented)¶ Return a <= b. Computed by @total_ordering from (a < b) or (a == b).
-
__getitem__()[source]¶ With the syntax
mo[left], return a set of rights associated withleft.Parameters: left – The left component of the couplet(s) of which the right component(s) are returned. Returns: If selfis a relation, return a set that contains the right(s) of the couplet(s) that have a left component that matchesleft. Ifselfis a clan, return a set that contains the right(s) of all couplets in all relations that have a left component that matchesleft. (The returned set may be empty if no couplet with the given left exists.) ReturnUndef()ifselfis neither a relation nor a clan.
- args – Zero or more unnamed arguments that are placed into the created