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:
325 bytes
|
Line | |
---|
1 | function pass = adaptapply |
---|
2 | |
---|
3 | tol = chebfunpref('eps'); |
---|
4 | |
---|
5 | d = domain(0,2); |
---|
6 | x = chebfun('x',d); |
---|
7 | f = sin(exp(2*x)); |
---|
8 | g = x.^3-cos(x); |
---|
9 | |
---|
10 | % Operator mode |
---|
11 | F = diag(f); |
---|
12 | pass(1) = norm( F*g - f.*g ) < tol; |
---|
13 | |
---|
14 | % Apply mode |
---|
15 | F = chebop( @(n) diag( f(1-cos(pi*(0:n-1)/(n-1)))), [], d, 0); |
---|
16 | pass(2) = norm( F*g - f.*g ) < 500*chebfunpref('eps'); |
---|
Note: See
TracBrowser
for help on using the repository browser.