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:
429 bytes
|
Line | |
---|
1 | function pass = outerprod |
---|
2 | |
---|
3 | % Toby Driscoll |
---|
4 | % Outer product testing |
---|
5 | |
---|
6 | tol = chebfunpref('eps'); |
---|
7 | |
---|
8 | [d,x] = domain(0,1); |
---|
9 | f = [ exp(x), tanh(x) ]; |
---|
10 | g = [ exp(x), x./(1+x.^2) ]; |
---|
11 | u = x; |
---|
12 | |
---|
13 | A = f*g'; |
---|
14 | Au = (exp(x) + (1-pi/4)*tanh(x)); |
---|
15 | |
---|
16 | % operational form |
---|
17 | pass1 = norm( Au - A*u ) < 1e-12*(tol/eps); |
---|
18 | |
---|
19 | % discrete form |
---|
20 | xx = (1+sin(pi*(2*(1:200)'-200-1)/(400-2)))/2; |
---|
21 | pass2 = norm( Au(xx) - A(200)*u(xx) ) < 1e-12*(tol/eps); |
---|
22 | |
---|
23 | pass = pass1 & pass2; |
---|
Note: See
TracBrowser
for help on using the repository browser.