Standard
Polynomials in standard monomial basis.
Prefixed by poly... (polynomial).
All functions accept single exhaustible iterables, if not stated otherwise.
If the result of a function is a polynomial, it is returned as a tuple.
Associative operations, like polyadd and
polymul, allow arbitrary many
arguments, even none.
The functions are type-independent. However, the data types used must support necessary scalar operations. For instance, for polynomial addition, components must be addable.
Docstring convention
Summary
Math notation
Complexity
For a polynomial of degree \(n\) there will be
- \(x\) scalar additions (
add), - \(y\) scalar subtractions, ...
Order: pos, neg, add, sub, mul
Notes
design choices
See also
other implementations, delegations/wrappings, ...
References
numpy equivalents, Wikipedia, ...)
creation
polyzero = ()
Zero polynomial.
An empty tuple: ().
Notes
Why give the zero polynomial a distinguished representation (not just [0] like numpy.polynomial)?
The additive neutral element seems worth handling exceptionally.
It is mathematically different (different degree)
and results in functions like polymul being more time and memory efficient.
See also
- other constants:
polyone,polyx - for any degree:
polymono - wraps:
vector.veczero
References
numpyequivalent:numpy.polynomial.polynomial.polyzero
polyone = (1,)
Constant one polynomial.
A tuple with a single one: (1,).
References
numpyequivalent:numpy.polynomial.polynomial.polyone
polyx = (0, 1)
Identity polynomial.
A tuple with a zero and a one: (0, 1).
References
numpyequivalent:numpy.polynomial.polynomial.polyx
polymono(n, c=1, zero=0)
Return a monomial.
A tuple with n many zeros followed by c or polyzero if \(n<0\).
See also
- constants:
polyzero,polyone,polyx - for all monomials:
polymonos - wraps:
vector.vecbasis
Source code in poly\standard\creation.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
polymonos(start=0, c=1, zero=0)
Yield all monomials.
See also
- for single monomial:
polymono - wraps:
vector.vecbases
Source code in poly\standard\creation.py
94 95 96 97 98 99 100 101 102 103 104 105 106 | |
polyrand(n)
Return a random polynomial of uniformly sampled float coefficients.
The coefficients are sampled from a uniform distribution in [0, 1[.
See also
- wraps:
vector.vecrand
Source code in poly\standard\creation.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
polyrandn(n, normed=True, mu=0, sigma=1)
Return a random polynomial of normally sampled float coefficients.
The coefficients are sampled from a normal distribution.
Normed with respect to the euclidian vector norm.
See also
- wraps:
vector.vecrandn
Source code in poly\standard\creation.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
polyfromroots(*xs, one=1)
Return the polynomial with the given roots.
Complexity
No yet perfect.
For \(n\) roots there will be
- \(n\) scalar negations (
neg), - \(\frac{n(n-1)}{2}\) scalar additions (
add) & - \(\begin{cases}(n+2)(n-1)&n\ge1\\0&n\le1\end{cases}\) scalar multiplications (
mul).
References
- Recipe: more_itertools.polynomial_from_roots
numpyequivalent:numpy.polynomial.polynomial.polyfromroots
Source code in poly\standard\creation.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |
utility
polydeg(p)
Return the degree (number of set coefficients).
Doesn't handle leading zeros, use polytrim
if needed.
\(\deg(0)=-1\) is used for the empty zero polynomial.
Notes
\(\deg(0)=-\infty\) is more commonly used but the expected return type is an
int while -math.inf is of type float. Therefore the \(\deg(0)=-1\)
convention was choosen to keep the return type consistent.
See also
- wraps:
vector.veclen
Source code in poly\standard\utility.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
polyeq(p, q)
Return if two polynomials are equal.
Complexity
For two polynomials of degrees \(n\) & \(m\) there will be at most
- \(\min\{n, m\}+1\) scalar comparisons (
eq) & - \(|n-m|\) scalar boolean evaluations (
bool).
See also
- wraps:
vector.veceq
Source code in poly\standard\utility.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
polytrim(p, tol=None)
Remove all leading near zero (abs(a_i)<=tol) coefficients.
tol may also be None,
then all coefficients that evaluate to False are trimmed.
Complexity
For a polynomial of degree \(n\) there will be
- \(n+1\) scalar absolute evaluations (
abs) & - \(n+1\) scalar comparisons (
gt).
Notes
- Cutting of elements that are
abs(a_i)<=tolinstead ofabs(a_i)<tolto allow cutting of elements that are exactly zero bytrim(p, 0)instead oftrim(p, sys.float_info.min).
See also
- wraps:
vector.vectrim numpyequivalent:numpy.polynomial.polynomial.polytrim
Source code in poly\standard\utility.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
evaluation
polyval(p, x, method='horner')
Return the value at point x.
Available methods are
See also
- implementations:
polyval_naive,polyval_iterative,polyval_horner - for consecutive monomials:
polyvals - for \(x=0\):
polyvalzero - for polynomial arguments:
polycom
References
numpyequivalent:numpy.polynomial.polynomial.polyval
Source code in poly\standard\evaluation.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
polyval_naive(p, x)
Return the value at point x.
Uses naive repeated multiplication to calculate monomials individually.
See also
- for any implementation:
polyval - other implementations:
polyval_iterative,polyval_horner - for polynomial arguments:
polycom_naive
References
Source code in poly\standard\evaluation.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
polyval_iterative(p, x)
Return the value at point x.
Uses iterative multiplication to calculate monomials consecutively.
Complexity
For a polynomial of degree \(n\) there will be
- \(\begin{cases}n&n\ge0\\0&n\le0\end{cases}\) scalar additions (
add) & - \(\begin{cases}2n-1&n>0\\0&n\le0\end{cases}\) scalar multiplications (
mul).
See also
- for any implementation:
polyval - other implementations:
polyval_naive,polyval_horner - uses:
polyvals - for polynomial arguments:
polycom_iterative
References
Source code in poly\standard\evaluation.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
polyval_horner(p, x)
Return the value at point x.
Uses Horner's method.
p must be reversible.
Complexity
For a polynomial of degree \(n\) there will be
- \(\begin{cases}n&n\ge0\\0&n\le0\end{cases}\) scalar additions (
add) & - \(\begin{cases}n&n\ge0\\0&n\le0\end{cases}\) scalar multiplications (
mul).
See also
- for any implementation:
polyval - other implementations:
polyval_naive,polyval_iterative - for polynomial arguments:
polycom_horner
References
Source code in poly\standard\evaluation.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | |
polyvals(x, start=0)
Yield all powers of scalar x.
Uses iterative multiplication to calculate monomials consecutively.
See also
- used by:
polyval_iterative - for polynomial arguments:
polypows
Source code in poly\standard\evaluation.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
polyvalzero(p, zero=0)
Return the value at point 0.
More efficient than polyval(p, 0).
Complexity
There are no scalar arithmetic operations.
See also
- for any argument:
polyval
Source code in poly\standard\evaluation.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
polycom(p, q, method='iterative')
Return the composition.
q must be a sequence.
Available methods are
See also
- implementations:
polycom_naive,polycom_iterative,polycom_horner - for \(q=x-s\):
polyshift - for scalar arguments:
polyval
Source code in poly\standard\evaluation.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
polycom_naive(p, q)
Return the composition.
Uses naive repeated multiplication to calculate monomials individually.
q must be a sequence.
Complexity
For two polynomials of degrees \(n\) & \(m\) there will be
- \(\begin{cases}\frac{n^3m^2}{6}+\frac{n^2m}{2}-\frac{nm^2}{6}-\frac{nm}{2}+n&n\ge0\land m\ge0\\0&n\le0\lor m\le0\end{cases}\) scalar additions (
add) & - \(\begin{cases}\frac{n^3m^2}{6}+\frac{n^3m}{6}+n^2m-\frac{nm^2}{6}-\frac{nm}{6}+\frac{n^2}{2}+\frac{n}{2}&n\ge0\land m\ge0\\0&n\le0\lor m\le0\end{cases}\) scalar multiplications (´mul´).
See also
- for any implementation:
polycom - other implementations:
polycom_iterative,polycom_horner - for scalar arguments:
polyval_naive
Source code in poly\standard\evaluation.py
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | |
polycom_iterative(p, q)
Return the composition.
Uses iterative multiplication to calculate monomials consecutively.
q must be a sequence.
Complexity
For two polynomials of degrees \(n\) & \(m\) there will be
- \(\begin{cases}\frac{n^2m^2}{2}+\frac{n^2m}{2}-\frac{nm^2}{2}-\frac{nm}{2}+n&n\ge0\land m\ge0\\0&n\le0\lor m\le0\end{cases}\) scalar additions (
add) & - \(\begin{cases}\frac{n^2m^2}{2}+n^2m-\frac{nm^2}{2}+nm+2n-m-1&n\ge1\land m\ge0\\0&n\le1\lor m\le0\end{cases}\) scalar multiplications (´mul´).
See also
- for any implementation:
polycom - other implementations:
polycom_naive,polycom_horner - uses:
polypows - for scalar arguments:
polyval_iterative
Source code in poly\standard\evaluation.py
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | |
polycom_horner(p, q)
Return the composition.
Uses Horner's method.
q must be reversible.
Complexity
For two polynomials of degrees \(n\) & \(m\) there will be
- \(\begin{cases}0&m\ge0\lor n<0\\n&m<0\land n>=0\end{cases}\) scalar unary pluses (
pos), - \(\begin{cases}\frac{n^2m^2}{2}-\frac{nm^2}{2}+n&n\ge0\land m\ge0\\0&n\le0\lor m\le0\end{cases}\) scalar additions (
add) & - \(\begin{cases}\frac{n^2m^2}{2}+\frac{n^2m}{2}-\frac{nm^2}{2}+\frac{nm}{2}+n&n\ge0\land m\ge0\\0&n\le0\lor m\le0\end{cases}\) scalar multiplications (´mul´).
See also
- for any implementation:
polycom - other implementations:
polycom_naive,polycom_iterative - for scalar arguments:
polyval_horner
Source code in poly\standard\evaluation.py
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | |
polyshift(p, s, one=1)
Return the polynomial p shifted by s on the abscissa.
TODO: https://math.stackexchange.com/a/694571/1170417
See also
- for polynomial argument:
polycom
Source code in poly\standard\evaluation.py
309 310 311 312 313 314 315 316 317 318 319 320 321 322 | |
polyscale(p, a)
Return the polynomial p scaled by 1/a on the abscissa.
More efficient than polycom(p, polyscalarmul(a, polyx)).
See also
- for polynomial argument:
polycom
Source code in poly\standard\evaluation.py
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | |
arithmetic
polypos(p)
Return the identity.
Complexity
For a polynomial of degree \(n\) there will be
- \(n+1\) scalar unary plus operations (
pos).
See also
- wraps:
vector.vecpos
Source code in poly\standard\arithmetic.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
polyneg(p)
Return the negation.
Complexity
For a polynomial of degree \(n\) there will be
- \(n+1\) scalar negations (
neg).
See also
- wraps:
vector.vecneg
Source code in poly\standard\arithmetic.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
polyadd(*ps)
Return the sum.
Complexity
For two polynomials of degrees \(n\) & \(m\) there will be
- \(\min\{n, m\}+1\) scalar additions (
add).
See also
- for constant or monomial summand:
polyaddc - wraps:
vector.vecadd
References
numpyequivalent:numpy.polynomial.polynomial.polyadd
Source code in poly\standard\arithmetic.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |
polyaddc(p, c, n=0)
Return the sum with a monomial.
More efficient than polyadd(p, polymono(n, c)).
Complexity
There will be
- one scalar addition (
add) if \(n\le\deg p\) or - one unary plus operations (
pos) otherwise.
See also
- for polynomial summand:
polyadd - wraps:
vector.vecaddc
Source code in poly\standard\arithmetic.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
polysub(p, q)
Return the difference.
Complexity
For two polynomials of degrees \(n\) & \(m\) there will be
- \(\min\{n, m\}+1\) scalar subtractions (
sub) & - \(\begin{cases}m-n&m\ge n\\0&m\le n\end{cases}\) negations (
neg).
See also
- for constant or monomial subtrahend:
polysubc - wraps:
vector.vecsub
References
numpyequivalent:numpy.polynomial.polynomial.polysub
Source code in poly\standard\arithmetic.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
polysubc(p, c, n=0)
Return the difference with a monomial.
More efficient than polysub(p, polymono(n, c)).
Complexity
There will be
- one scalar subtraction (
sub) if \(n\le\deg p\) or - one scalar negation (
neg) otherwise.
See also
- for polynomial subtrahend:
polysub - wraps:
vector.vecsubc
Source code in poly\standard\arithmetic.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |
polyscalarmul(p, a)
Return the product.
Complexity
For a polynomial of degree \(n\) there will be
- \(n+1\) scalar multiplications (
mul).
See also
- for polynomial factor:
polymul - wraps:
vector.vecmul
Source code in poly\standard\arithmetic.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
polyscalarrmul(a, p)
Return the product.
Complexity
For a polynomial of degree \(n\) there will be
- \(n+1\) scalar multiplications (
rmul).
See also
- for polynomial factor:
polymul - wraps:
vector.vecrmul
Source code in poly\standard\arithmetic.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | |
polyscalartruediv(p, a)
Return the true quotient.
Complexity
For a polynomial of degree \(n\) there will be
- \(n+1\) scalar true divisions (
truediv).
See also
- wraps:
vector.vectruediv
Source code in poly\standard\arithmetic.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
polyscalarfloordiv(p, a)
Return the floor quotient.
Complexity
For a polynomial of degree \(n\) there will be
- \(n+1\) scalar floor divisions (
floordiv).
See also
- included in:
polyscalardivmod - wraps:
vector.vecfloordiv
Source code in poly\standard\arithmetic.py
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | |
polyscalarmod(p, a)
Return the remainder.
Complexity
For a polynomial of degree \(n\) there will be
- \(n+1\) scalar modulos (
mod).
See also
- included in:
polyscalardivmod - wraps:
vector.vecmod
Source code in poly\standard\arithmetic.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | |
polyscalardivmod(p, a)
Return the floor quotient and remainder.
Complexity
For a polynomial of degree \(n\) there will be
- \(n+1\) scalar divmods (
divmod).
See also
- combines:
polyscalarfloordiv&polyscalarmod - wraps:
vector.vecdivmod
Source code in poly\standard\arithmetic.py
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | |
polymul(*ps, method='naive', one=1)
Return the product.
Available methods are
See also
- implementations:
polymul_naive,polymul_karatsuba - for scalar factor:
polyscalarmul - for monomial factor:
polymulx
References
numpyequivalent:numpy.polynomial.polynomial.polymul
Source code in poly\standard\arithmetic.py
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | |
polymul_naive(p, q)
Return the product.
Uses naive multiplication and summation.
q must be a sequence.
Complexity
For two polynomials of degrees \(n\) & \(m\) there will be
- \(\begin{cases}nm&n\ge1\land m\ge1\\0&n\le0\lor m\le0\end{cases}\) scalar additions (
add) & - \((n+1)(m+1)\) scalar mutliplications (
mul).
See also
- for any implementation:
polymul - other implementations:
polymul_karatsuba
Source code in poly\standard\arithmetic.py
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | |
polymul_karatsuba(p, q)
Return the product.
Uses the Karatsuba algorithm.
Both arguments must be sequences.
TODO: complexity
See also
- for any implementation:
polymul - other implementations:
polymul_naive
References
Source code in poly\standard\arithmetic.py
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | |
polymulx(p, n=1, zero=0)
Return the product with a monomial.
More efficient than polymul(p, polymonom(n)).
Complexity
There are no scalar arithmetic operations.
See also
- for polynomial factor:
polymul - wraps:
vector.vecrshift
References
numpyequivalent:numpy.polynomial.polynomial.polymulx
Source code in poly\standard\arithmetic.py
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 | |
polypow(p, n, method='naive')
Return the polynomial p raised to the nonnegative n-th power.
p must be a sequence.
Available methods are
TODO: mod parameter
See also
- implementations:
polypow_naive,polypow_binary - for sequence of powers:
polypows
References
numpyequivalent:numpy.polynomial.polynomial.polypow
Source code in poly\standard\arithmetic.py
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 | |
polypow_naive(p, n, one=1)
Return the polynomial p raised to the nonnegative n-th power.
Uses repeated multiplication.
p must be a sequence.
Complexity
For a polynomial of degree \(n\) and exponent \(k\) there will be
- \(\begin{cases}\frac{n^2k(k-1)}{2}&n\ge0\\0&n\leq0\end{cases}\) scalar additions (
add) & - \(\begin{cases}\frac{(nk+2)(n+1)(k-1)}{2}&k>0\\0&k=0\end{cases}\) scalar multiplications (
mul).
See also
- for any implementation:
polypow - other implementations:
polypow_binary - uses:
polypows
Source code in poly\standard\arithmetic.py
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 | |
polypow_binary(p, n, one=1)
Return the polynomial p raised to the nonnegative n-th power.
Uses exponentiation by squaring.
p must be a sequence.
Complexity
For a polynomial of degree \(n\) and exponent \(k\) let
where \(j_0\) is the least significant \(1\)-bit position of \(k\), \(\operatorname{bitlength}(k)\) is the number of bits of the binary representation of \(k\) and \(\operatorname{popcount}(k)\) is the number of \(1\)-bits.
Further define
L = k.bit_length()
w = k.bit_count()
C = L + w - 1
B = 2*(2**L-1) + k-2**((k&-k).bit_length()-1) + sum(2**j * (k>>(j+1)).bit_count() for j in range(L) if ((k>>j)&0x01)==0x01)
A = (4**L-1)//3 + sum(2**(i+j) for j in range(L) for i in range(j) if ((k>>j)&0x01)==((k>>i)&0x01)==0x01)
Then there will be
- \(A(k)n^2\) scalar additions (
add) & - \(A(k)n^2+B(k)n+C(k)\) scalar multiplications (
mul).
See also
- for any implementation:
polypow - other implementations:
polypow_naive
References
- Wikipedia - Exponentiation by squaring
- Sequence \(C(k)\): A056791
Source code in poly\standard\arithmetic.py
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 | |
polypows(p, start=0, one=1)
Yield the powers.
Uses iterative multiplication to calculate powers consecutively.
p must be a sequence.
Notes
Was first .evaluation.polycoms in analogy to
polyvals but then the submodules arithmetic &
evaluation would not be separable (.evaluation.polycoms uses
.arithmetic.polymul and .arithmetic.polypow uses
.evaluation.polycoms).
See also
- used by:
polypow_naive,polycom_iterative - for scalar arguments:
polyvals
Source code in poly\standard\arithmetic.py
543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 | |
calculus
polyder(p, k=1)
Return the derivative.
Complexity
For the \(k\)-th derivative of a polynomial of degree \(n\) there will be
- \(\begin{cases}n-k+1&k\le n\\0&k>n\end{cases}\) scalar multiplications with integers (
rmul).
Notes
For monomials:
And for polynomials:
Where \((n)_k\) is the Falling factorial
and \({}_nP_k\) is the number of k-permutations of n
with \((n)_k=\frac{n!}{(n-k)!}={}_nP_k\) (falling factorials are
used because their definition appears in the derivation; permutations are
used because a fast implementation is provided by math.perm).
References
Source code in poly\standard\calculus.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
polyantider(p, c=0, b=0)
Return the antiderivative.
TODO: Higher antiderivatives, complexity
Notes
Let
Then we have for monomials:
For polynomials:
Notes
Integration is called antiderivative (antider)
instead of integrate (int) to avoid keyword collisions.
References
numpyequivalent:numpy.polynomial.polynomial.polyint
Source code in poly\standard\calculus.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
conversion
polysympify(p, x=x)
Return the coefficient iterable p as a sympy.Poly.
Source code in poly\standard\conversion.py
10 11 12 | |
polyunsympify(p)
Return sympy.Poly(p) as a coefficient tuple.
Source code in poly\standard\conversion.py
14 15 16 | |