source: MML/trunk/machine/SOLEIL/common/toolbox/chebfun_v2_0501/chebfun/chebtests/resampletest.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 577 bytes
Line 
1function pass = resampletest
2
3% Test if the resampling option is working by counting the number of
4% function evaluations
5% Rodrigo Platte, June 2009.
6
7global count % counts the number of evaluations
8
9count = 0;
10fon = chebfun(@myfun,'resampling','on');
11counton = count;
12
13count = 0;
14foff = chebfun(@myfun,'resampling','off');
15countoff = count;
16
17% Number of evaluations
18pass(1) = counton > 1.9*countoff;
19% Chebfun representations must match
20pass(2) = norm(fon-foff,inf) < chebfunpref('eps')*1e3;
21
22
23function y = myfun(x)
24
25global count
26count = count + length(x);
27y = sin(100*x);
28
29
Note: See TracBrowser for help on using the repository browser.