# 需要导入模块: from sympy.polys.polyclasses import DMP [as 别名]# 或者: from sympy.polys.polyclasses.DMP importfrom_sympy_list[as 别名]def__new__(cls, expr, coeffs=Tuple(), alias=None, **args):"""Construct a new algebraic number. """expr = sympify(expr)ifisinstance(expr, (tuple,...
With SymPy 0.7.4.1 and gmpy (gmpy-1.15.win-amd64-py2.7.exe) I get: >>> from beam_integrals.characteristic_equation_solvers import find_best_root >>> from beam_integrals.beam_types import BaseBeamType >>> beam_type = BaseBeamType.coerce(2) # UNEXPECTED: With `decimal_precision=100` th...
rep, gens =dict_from_expr(sympify(monom), gens=gens)iflen(rep) ==1andlist(rep.values())[0] ==1: monom = list(rep.keys())[0]else:raiseValueError("Expected a monomial got %s"% monom) self.exponents = tuple(map(int, monom)) self.gens = gens 开发者ID:AALEKH,项目名称:sympy,...
>>> from sympy.core.symbol import Str >>> Y = DiscreteMarkovChain("Y", [Str('Sunny'), Str('Cloudy'), Str('Rainy')], T) >>> P(Eq(Y[3], 2), Eq(Y[1], 1)).round(2) 0.36This gives the same answer as the ``[0, 1, 2]`` state space. ...
# 需要导入模块: from sympy.core import Mul [as 别名]# 或者: from sympy.core.Mul import_from_args[as 别名]def_sqrt_match(p):"""Return [a, b, r] for p.match(a + b*sqrt(r)) where, in addition to matching, sqrt(r) also has then maximal sqrt_depth among addends of p. ...
# 需要导入模块: from sympy.polys.polyclasses import DMP [as 别名]# 或者: from sympy.polys.polyclasses.DMP importfrom_list[as 别名]def__new__(cls, expr, coeffs=Tuple(), alias=None, **args):"""Construct a new algebraic number. """expr = sympify(expr)ifisinstance(expr, (tuple, Tuple...