source: MML/trunk/machine/SOLEIL/common/toolbox/chebfun_v2_0501/chebfun/chebtests/scaleinvariance2.m

Last change on this file was 17, checked in by zhangj, 11 years ago

To have a stable version on the server.

  • Property svn:executable set to *
File size: 719 bytes
Line 
1function pass = scaleinvariance2
2
3% Rodrigo Platte
4% Modification of scaleinvariance.m
5% This code makes sure a few things are scale-invariant when the interval
6% is splitted (tests endpoints).
7
8splitting on
9
10d = [1 2];
11scale = 2^100;
12fh = @(x) abs(x-1.2)+10;
13
14f = chebfun(fh,d);
15maxf = max(f);
16
17f1 = chebfun(@(x) fh(x*scale),d/scale);
18pass1 = (max(f1)==maxf) && all(f1.ends*scale == f.ends);
19
20f2 = chebfun(@(x) fh(x/scale),d*scale);
21pass2 = (max(f2)==maxf) && all(f2.ends/scale == f.ends);
22
23f3 = chebfun(@(x) fh(x)*scale,d);
24pass3 = (max(f3)==maxf*scale) && all(f3.ends == f.ends);
25
26f4 = chebfun(@(x) fh(x)/scale,d);
27pass4 = (max(f4)==maxf/scale) && all(f4.ends == f.ends);
28
29pass = pass1 && pass2 && pass3 && pass4;
30
31
Note: See TracBrowser for help on using the repository browser.