You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,9 @@ Basic arithmetic, integration, differentiation, evaluation, and root finding ove
19
19
*`ImmutablePolynomial` – standard basis polynomials backed by a [Tuple type](https://docs.julialang.org/en/v1/manual/functions/#Tuples-1) for faster evaluation of values
20
20
*`SparsePolynomial` – standard basis polynomial backed by a [dictionary](https://docs.julialang.org/en/v1/base/collections/#Dictionaries-1) to hold sparse high-degree polynomials
21
21
*`LaurentPolynomial` – [Laurent polynomials](https://docs.julialang.org/en/v1/base/collections/#Dictionaries-1), `a(x) = aₘ xᵐ + … + aₙ xⁿ``m ≤ n`, `m,n ∈ ℤ` backed by an [offset array](https://github.com/JuliaArrays/OffsetArrays.jl); for example, if `m<0` and `n>0`, `a(x) = aₘ xᵐ + … + a₋₁ x⁻¹ + a₀ + a₁ x + … + aₙ xⁿ`
22
+
*`FactoredPolynomial` – standard basis polynomials, storing the roots, with multiplicity, and leading coefficient of a polynomial
22
23
*`ChebyshevT` – [Chebyshev polynomials](https://en.wikipedia.org/wiki/Chebyshev_polynomials) of the first kind
24
+
*`RationalFunction` - a type for ratios of polynomials.
For polynomials with multplicities, the non-exported `Polynomials.Multroot.multroot` method can avoid some numerical issues that `roots` will have.
163
+
164
+
The `FactoredPolynomial` type stores the roots (with multiplicities) and the leading coefficent of a polynomial. In this example, the `multroot` method is used internally to identify the roots of `p` below, in the conversion from the `Polynomial` type to the `FactoredPolynomial` type:
165
+
166
+
```jldoctest
167
+
julia> p = Polynomial([24, -50, 35, -10, 1])
168
+
Polynomial(24 - 50*x + 35*x^2 - 10*x^3 + x^4)
169
+
170
+
julia> q = convert(FactoredPolynomial, p) # noisy form of `factor`:
The addition of a polynomial and a scalar, such as
@@ -344,7 +376,7 @@ ERROR: ArgumentError: Polynomials have different indeterminates
344
376
[...]
345
377
```
346
378
347
-
an error thrown.
379
+
an error is thrown.
348
380
349
381
In general, arrays with mixtures of non-constant polynomials with *different* indeterminates will error. By default, an error will occur when constant polynomials with different indeterminates are used as components. However, for *typed* arrays, conversion will allow such constructs to be used.
Though were a non-constant polynomial with indeterminate `y` replacing
389
421
`2one(q)` above, that addition would throw an error.
390
422
423
+
## Rational functions
424
+
425
+
The package provides support for rational functions -- fractions of polynomials (for most types). The construction of the basic type mirrors the construction of rational numbers.
0 commit comments