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
allow chebinterp to omit the order and determine it adaptively (#32)
* allow chebinterp to omit the order and determine it adaptively, similar to ApproxFun
* use powers of 2 for repeatedly doubled orders to speed up DCTs
Copy file name to clipboardExpand all lines: README.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,17 @@ via `c(y)`. Alternatively, you can combine `chebpoints` and `chebinterp` into a
21
21
```jl
22
22
c =chebinterp(f, order, lb, ub)
23
23
```
24
-
which evaluates the given function at Chebyshev points for you.
24
+
which evaluates the given function at Chebyshev points for you. In fact, you can omit the `order`
25
+
and simply call
26
+
```jl
27
+
c =chebinterp(f, lb, ub)
28
+
```
29
+
and it will adaptively double the order until a given relative tolerance is attained
30
+
(specified by the optional `tol` keyword argument, default to `5*eps` in the
31
+
given floating-point precision). The starting order for the doubling can be specified
32
+
by a `min_order` keyword (which defaults to `8` in each dimension), and a maximum
33
+
can be specified by the `max_order` keyword. This feature is best for *smooth* functions.
34
+
(More sophisticated versions of this idea are implemented by [ApproxFun.jl](https://github.com/JuliaApproximation/ApproxFun.jl).)
25
35
26
36
We also provide a function `chebgradient(c,y)` that returns a tuple `(c(y), ∇c(y))` of
27
37
the interpolant and its gradient at a point `y`. (You can also use automatic differentiation, e.g. via the [ForwardDiff.jl package](https://github.com/JuliaDiff/ForwardDiff.jl),
0 commit comments