コード例 #1
0
ファイル: couplets.py プロジェクト: jdcasi/algebraixlib
def is_member(obj: _mo.MathObject) -> bool:
    """Return ``True`` if ``obj`` is a member of the :term:`ground set` of this :term:`algebra`.

     :return: ``True`` if ``obj`` is an instance of :class:`~.Couplet`.
    """
    _mo.raise_if_not_mathobject(obj)
    return isinstance(obj, _mo.Couplet)
コード例 #2
0
ファイル: relations.py プロジェクト: jdcasi/algebraixlib
def is_absolute_member(obj: _mo.MathObject) -> bool:
    """Return ``True`` if ``obj`` is a member of the :term:`absolute ground set` of this algebra.

     :return: ``True`` if ``obj`` is an :term:`absolute relation`.

    .. note:: This function calls :meth:`~.MathObject.get_ground_set` on ``obj``."""
    _mo.raise_if_not_mathobject(obj)
    return obj.get_ground_set().is_subset(get_absolute_ground_set())
コード例 #3
0
ファイル: clans.py プロジェクト: jdcasi/algebraixlib
def is_member(obj: _mo.MathObject) -> bool:
    """Return ``True`` if ``obj`` is a member of the :term:`ground set` of this :term:`algebra`.

    .. note:: This function calls :meth:`~.MathObject.get_ground_set` on ``obj``.
    """
    _mo.raise_if_not_mathobject(obj)
    if not obj.cached_is_clan and not obj.cached_is_not_clan:
        obj.cache_is_clan(obj.get_ground_set().is_subset(get_ground_set()))
    return obj.cached_is_clan
コード例 #4
0
ファイル: relations.py プロジェクト: jdcasi/algebraixlib
def is_member(obj: _mo.MathObject) -> bool:
    """Return ``True`` if ``obj`` is a member of the :term:`ground set` of this :term:`algebra`.

    .. note:: This function may call :meth:`~.MathObject.get_ground_set` on ``obj``. The result
        of this operation is cached.
    """
    _mo.raise_if_not_mathobject(obj)
    if not obj.cached_is_relation and not obj.cached_is_not_relation:
        obj.cache_is_relation(obj.get_ground_set().is_subset(get_ground_set()))
    return obj.cached_is_relation