@@ -70,7 +70,7 @@ julia> p + q
70
70
ERROR: Polynomials must have same variable.
71
71
```
72
72
73
- To get the degree of the polynomial use ` degree ` method
73
+ To get the degree of the polynomial use the ` degree ` method
74
74
75
75
```
76
76
julia> degree(p)
@@ -88,10 +88,19 @@ julia> degree(p-p)
88
88
Evaluate the polynomial ` p ` at ` x ` .
89
89
90
90
``` julia
91
- julia> polyval (Poly ([1 , 0 , - 1 ]), 0.1 )
91
+ julia> p = Poly ([1 , 0 , - 1 ])
92
+ julia> polyval (p, 0.1 )
92
93
0.99
93
94
```
94
95
96
+ A call method is also available:
97
+
98
+ ``` julia
99
+ julia> p (0.1 )
100
+ 0.99
101
+ ```
102
+
103
+
95
104
#### polyint(p::Poly, k::Number=0)
96
105
97
106
Integrate the polynomial ` p ` term by term, optionally adding constant
@@ -119,8 +128,8 @@ Poly(3 - 2x)
119
128
#### roots(p::Poly)
120
129
121
130
Return the roots (zeros) of ` p ` , with multiplicity. The number of
122
- roots returned is equal to the order of ` p ` . The returned roots may be
123
- real or complex.
131
+ roots returned is equal to the order of ` p ` . By design, this is not type-stable,
132
+ the returned roots may be real or complex.
124
133
125
134
``` julia
126
135
julia> roots (Poly ([1 , 0 , - 1 ]))
@@ -142,7 +151,7 @@ julia> roots(Poly([0, 0, 1]))
142
151
#### Polyfit
143
152
144
153
* ` polyfit ` : fits a polynomial of minimal degree fitting the points
145
- specified by ` x ` and ` y ` using least squares fit.
154
+ specified by ` x ` and ` y ` using the least- squares fit.
146
155
147
156
``` julia
148
157
julia> xs = 1 : 4 ; ys = exp (xs); polyfit (xs, ys)
@@ -165,13 +174,14 @@ Polynomial objects also have other methods:
165
174
166
175
* ` norm ` : find the ` p ` -norm of a polynomial
167
176
168
- * ` truncate ` : set to 0 small terms in a polynomial; ` chop ` chops off
177
+ * ` conj ` : finds the conjugate of a polynomial over a complex fiel
178
+
179
+ * ` truncate ` : set to 0 all small terms in a polynomial; ` chop ` chops off
169
180
any small leading values that may arise due to floating point
170
181
operations.
171
182
172
183
* ` gcd ` : greatest common divisor of two polynomials.
173
184
174
-
175
185
* ` Pade ` : Return the
176
186
[ Pade approximant] ( https://en.wikipedia.org/wiki/Pad%C3%A9_approximant )
177
187
of order ` m/n ` for a polynomial as a ` Pade ` object.
@@ -183,4 +193,4 @@ Polynomial objects also have other methods:
183
193
184
194
* [ Nemo.jl] ( https://github.com/wbhart/Nemo.jl ) for generic polynomial rings, matrix spaces, fraction fields, residue rings, power series
185
195
186
- * [ PolynomialRoots.jl] ( https://github.com/giordano/PolynomialRoots.jl ) a fast complex polynomial root finder
196
+ * [ PolynomialRoots.jl] ( https://github.com/giordano/PolynomialRoots.jl ) for a fast complex polynomial root finder
0 commit comments