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: src/polynomials/LaurentPolynomial.jl
+137-7Lines changed: 137 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ export LaurentPolynomial
5
5
6
6
A [Laurent](https://en.wikipedia.org/wiki/Laurent_polynomial) polynomial is of the form `a_{m}x^m + ... + a_{n}x^n` where `m,n` are integers (not necessarily positive) with ` m <= n`.
7
7
8
-
The `coeffs` specify `a_{m}, a_{m-1}, ..., a_{n}`. Rhe range specified is of the form `m:n`, if left empty, `0:length(coeffs)-1` is used (i.e., the coefficients refer to the standard basis).
8
+
The `coeffs` specify `a_{m}, a_{m-1}, ..., a_{n}`. The range specified is of the form `m:n`, if left empty, `0:length(coeffs)-1` is used (i.e., the coefficients refer to the standard basis). Alternatively, the coefficients can be specified using an `OffsetVector` from the `OffsetArrays` package.
9
9
10
10
Laurent polynomials and standard basis polynomials promote to Laurent polynomials. Laurent polynomials may be converted to a standard basis polynomial when `m >= 0`
11
11
.
@@ -94,6 +94,17 @@ end
94
94
95
95
@register LaurentPolynomial
96
96
97
+
# Add interface for OffsetArray
98
+
functionLaurentPolynomial{T}(coeffs::OffsetArray{S, 1, Array{S,1}}, var::SymbolLike=:x) where {T, S}
0 commit comments