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 | |
---|
1 | function 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 | |
---|
8 | splitting on |
---|
9 | |
---|
10 | d = [1 2]; |
---|
11 | scale = 2^100; |
---|
12 | fh = @(x) abs(x-1.2)+10; |
---|
13 | |
---|
14 | f = chebfun(fh,d); |
---|
15 | maxf = max(f); |
---|
16 | |
---|
17 | f1 = chebfun(@(x) fh(x*scale),d/scale); |
---|
18 | pass1 = (max(f1)==maxf) && all(f1.ends*scale == f.ends); |
---|
19 | |
---|
20 | f2 = chebfun(@(x) fh(x/scale),d*scale); |
---|
21 | pass2 = (max(f2)==maxf) && all(f2.ends/scale == f.ends); |
---|
22 | |
---|
23 | f3 = chebfun(@(x) fh(x)*scale,d); |
---|
24 | pass3 = (max(f3)==maxf*scale) && all(f3.ends == f.ends); |
---|
25 | |
---|
26 | f4 = chebfun(@(x) fh(x)/scale,d); |
---|
27 | pass4 = (max(f4)==maxf/scale) && all(f4.ends == f.ends); |
---|
28 | |
---|
29 | pass = pass1 && pass2 && pass3 && pass4; |
---|
30 | |
---|
31 | |
---|
Note: See
TracBrowser
for help on using the repository browser.