Comments (12)
I agree, prolong.m should change as Clenshaw is better than bary in the regime of small degree.
In get: This is actually a rare case when bary is faster than Clenshaw (1 evaluation point, potentially large degree). Nick H and I did some experiments a while ago.
Smoothfun.m is using Floater-Horner interpolation (it looks like). So that should stay.
Perhaps, we should completely change to Clenshaw since its far cleaner message: "Clenshaw for evaluation". I would support prolong.m and get.m changing to Clenshaw. Unless someone feels the small efficiency lose in get.m is important.
from chebfun.
I suggest that we replace the bary in get as well, so long as clenshaw is not much slower than bary for get. On the one hand, this can make the things in chebtech simpler and more uniform. On the other hand, if we use bary we have to update values before doing the evaluations. But there is an occasion (maybe more in the future) where we want to get the function values at the boundaries without updating the field 'values', for examples: extractBoundaryRoots.m. In this occasion, updating the field 'values' only for calling bary is a waste.
from chebfun.
OK, I don't know about extractBoundaryRoots.m. Though, I would expect the values field to be updated after every operation. It is really that expensive to update the values (one FFT), when roots are being computed. Perhaps, I've missed the point. Anyway, since your argument supports the "Clenshaw for evaluation" campaign, I'm happy! 👍
from chebfun.
Good catch!
I second the idea of changing prolong()
and chebtech1.get()
(chebtech2.get()
doesn't call bary()
) to use clenshaw()
. I'd be willing to bet that the performance hit from changing in chebtech1.get()
is pretty unimportant, and, as @ajt60gaibb has already pointed out, using clenshaw()
everywhere sends a simpler, more uniform message.
@kuanxu: I'm not sure what you mean with regard to extractBoundaryRoots()
. All chebtech
methods need to maintain the class invariant that the values
and coeffs
fields are up-to-date with one another. If extractBoundaryRoots()
returns a chebtech
for which this isn't true, it's a bug!
from chebfun.
Yes. If we are not losing much, go uniform always.
@aaustin141: It seems that I didn't explain clearly. In fact, there is a while loop in extractBoundaryRoots where we only need to update coeffs to proceed to the next iteration. But boundary values are checked at the beginning of each loop. Now we have to update values too in each iteration to make sure that get and the underlying bary work.
from chebfun.
BTW, bary shows up in legpts.m as well, which is beyond my universe.
from chebfun.
@kuanxu: OK, I see what you mean. I just looked at the code now.
Assuming we weren't going to switch chebtech1.get()
to use clenshaw()
(and I think we are), you could always work around it in that kind of a situation by calling clenshaw()
directly.
from chebfun.
@aaustin141: True. This is what I'm going to do for time being.
from chebfun.
@kuanxu: You're right legpts.m and jacpts.m does use bary to numerically compute coefficients in the boundary asymptotic formula. I think for legpts we also use it for local Taylor expansions of Bessel. Before changing this I would like to make sure that we still nail every digit at the boundary with Clenshaw.
from chebfun.
@kuanxu, @ajt60gaibb: I think legpts()
and jacpts()
should be left out of this discussion. They are not tied to the @chebtech
class, and should be free to use bary()
if they so wish.
from chebfun.
Sorry, GITHUB decided to put the "Comment" button right next to the "Close" button. I'll drink less coffee to stop the twitching!
from chebfun.
This has now been sorted out in the pull request issue #32.
from chebfun.
Related Issues (20)
- Chebfun2 mtimes bug
- Minor typo in chebop documentation HOT 1
- Newton method in hermpts_rec can be improved
- Implementation of Fourier derivatives (inconsistency between "Spectral Methods in MATLAB" and chebfun) HOT 1
- bug in minimax
- trigcoeffs does not respect domain HOT 2
- Spin with non-constant coefficients HOT 1
- Overheads in piecewise construction
- I am getting this error Non-integer difference in the exponents of the two SINGFUN objects HOT 1
- More efficient representation of trigonometric series possible? HOT 2
- bug in minimax HOT 1
- Diskfun PhaseTwo constructor fails to resolve f(t, r) = r in default maxLength HOT 12
- AAA may return incorrect final error HOT 2
- How to add forcing terms in spin? HOT 1
- spin produces wrong results when solve diffusion-reaction equations HOT 3
- A chebfun3 function failed to pass the vectorCheck() of chebfun2 HOT 3
- chebpoly(1e5) fails HOT 1
- The constructor chebfun3() cannot handle a chebfun3 function as an input in parfor loops.
- 2D mixed derivative in Gray-Scott example throwing error HOT 1
- chebfun.org expired? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chebfun.