spympy poly模块

sympy.polys模块衍生出了很多函数,这里列举一些
1.gcd: 求公因式

f = 4*x**2 - 1
g = 8*x**3 + 1
gcd(f, g)

2.div: 代数式除法
eg. 5 x 2 + 10 x + 3 = ( 2 x + 1 ) ( 5 x 2 + 5 2 ) − 2 5x^2+10x+3=(2x+1)\left(\dfrac{5x}{2}+\dfrac{5}{2}\right)-2 5x2+10x+3=(2x+1)(25x+25)2

f = 5*x**2 + 10*x + 3
g = 2*x + 2
q, r = div(f, g)

3.degree: 求参数的最高次数

degree(x**2 + y*x + 1, gen=x)

如果要求所有参数的最高次数, degree_list
4.LC: 最高项系数

LC(4*x**2 + 2*x*y**2 + x*y + 3*y)

5.LM: Return the leading monomial of f.

LM(4*x**2 + 2*x*y**2 + x*y + 3*y)

6.LT: Return the leading term of f.

LT(4*x**2 + 2*x*y**2 + x*y + 3*y)

7.pdiv: 多项式除法

pdiv(x**2 + 1, 2*x - 4)

8.prem: 多项式相除的余数

prem(x**2 + 1, 2*x - 4)

9.pexquo: 多项式相除的商

pexquo(x**2 + 1, 2*x - 4)

10.lcm_list: 多项式的最小公倍数

lcm_list([x**3 - 1, x**2 - 1, x**2 - 3*x + 2])

11.factor: 因式分解。参数: extension,deep等等
12.Add.make_args:

Return a sequence of elements `args` such that cls(*args) == expr

同理,还有Mul.make_args

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值