Пример #1
0
    def get_upper_degree(self):
        list_of_products = [self.variables[i] ** self.max_degrees[i]
                            for i in range(self.n)]
        product = prod(list_of_products)
        product = Poly(product).monoms()

        return monomial_deg(*product)
Пример #2
0
    def get_upper_degree(self):
        list_of_products = [
            self.variables[i]**self.max_degrees[i] for i in range(self.n)
        ]
        product = prod(list_of_products)
        product = Poly(product).monoms()

        return monomial_deg(*product)
Пример #3
0
    def get_upper_degree(self):
        SymPyDeprecationWarning(feature="get_upper_degree",
                        useinstead="get_max_degrees",
                        issue=17763,
                        deprecated_since_version="1.5").warn()

        list_of_products = [self.variables[i] ** self._max_degrees[i]
                            for i in range(self.n)]
        product = prod(list_of_products)
        product = Poly(product).monoms()

        return monomial_deg(*product)
Пример #4
0
def sdm_monomial_deg(M):
    """
    Return the total degree of ``M``.

    Examples
    ========

    For example, the total degree of `x^2 y f_5` is 3:

    >>> from sympy.polys.distributedmodules import sdm_monomial_deg
    >>> sdm_monomial_deg((5, 2, 1))
    3
    """
    return monomial_deg(M[1:])
Пример #5
0
def sdm_monomial_deg(M):
    """
    Return the total degree of ``M``.

    Examples
    ========

    For example, the total degree of `x^2 y f_5` is 3:

    >>> from sympy.polys.distributedmodules import sdm_monomial_deg
    >>> sdm_monomial_deg((5, 2, 1))
    3
    """
    return monomial_deg(M[1:])
Пример #6
0
    def get_upper_degree(self):
        sympy_deprecation_warning(
            """
            The get_upper_degree() method of DixonResultant is deprecated. Use
            get_max_degrees() instead.
            """,
            deprecated_since_version="1.5",
            active_deprecations_target="deprecated-dixonresultant-properties"
        )
        list_of_products = [self.variables[i] ** self._max_degrees[i]
                            for i in range(self.n)]
        product = prod(list_of_products)
        product = Poly(product).monoms()

        return monomial_deg(*product)
Пример #7
0
def _compute_smd(sub, mlist: list):
    return (monomial_deg(sub) - 1) * len(list(filter(lambda m: monomial_divides(sub, m), mlist)))
Пример #8
0
def _compute_aeqd(sub: Tuple[int], eq_degs):
    mon_degs = map(lambda deg: deg + monomial_deg(sub) - 1, eq_degs)
    quad_discrepancies = filter(lambda x: x > 0, map(lambda d: d - 2, mon_degs))
    return sum(quad_discrepancies)
Пример #9
0
def default_strategy(system) -> int:
    total_nonsquare = sum([monomial_deg(m) for m in system.nonsquares])
    return total_nonsquare + system.dim * len(system.vars)