-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathszmap.m
122 lines (104 loc) · 3.13 KB
/
szmap.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
classdef szmap < conformalmap
% SZMAP represents a Riemann map via the Szego kernel.
%
% f = szmap(range, a)
% f = szmap(range, a, opts)
% Creates a Riemann map from the interior of the unit disk to the interior of
% the region via the Szego kernel and the FFT with normalization f(0) = a and
% f'(0) > 0. Various options may be set via the opts parameter which must be a
% szset object.
%
% See also szego, szset.
% Copyright 2015 the ConfMapTk project developers. See the COPYRIGHT
% file at the top-level directory of this distribution and at
% https://github.com/ehkropf/ConfMapTk.
%
% This file is part of ConfMapTk. It is subject to the license terms in
% the LICENSE file found in the top-level directory of this distribution
% and at https://github.com/ehkropf/ConfMapTk. No part of ConfMapTk,
% including this file, may be copied, modified, propagated, or distributed
% except according to the terms contained in the LICENSE file.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE
% file.
properties
theKernel
coefficients
sopts
end
methods
function f = szmap(range, varargin)
if nargin
if isa(range, 'closedcurve')
range = region(range);
end
if ~issimplyconnected(range)
error('CMT:InvalidArgument', ...
'Region must be simply connected.')
end
args = {unitdisk, range};
else
args = {};
end
f = f@conformalmap(args{:});
opts = get(f, szset);
if ~nargin
return
end
if nargin > 2
opts = set(opts, varargin{:});
end
boundary = outer(range);
szargs = varargs(opts);
S = szego(boundary, szargs{:});
nF = opts.numFourierPts;
t = invtheta(S, 2*pi*(0:nF-1)'/nF);
c = flipud(fft(boundary(t))/nF);
f.theKernel = S;
f.coefficients = c;
f.sopts = opts;
end
function g = ctranspose(f)
d = domain(f);
if isinterior(d)
d = diskex(outer(d));
else
d = disk(inner(d));
end
r = range(f);
if isinterior(r)
br = outer(r);
r = region(br, 'exteriorto');
else
br = inner(r);
r = region(br);
end
prefs = varargs(f.sopts);
a = f.sopts.confCenter;
g = szmap(cinvcurve(br, a), prefs{:}, 'confCenter', 0);
func = @(z) 1./conj(applyMapPrivate(g, conj(1./z))) + a;
g.theDomain = d;
g.theRange = r;
g.functionList = {func};
end
function S = kernel(f)
S = f.theKernel;
end
end
methods(Access=protected)
function w = applyMap(f, z)
if isanonymous(f)
w = applyMap@conformalmap(f, z);
else
w = applyMapPrivate(f, z);
end
end
end
methods(Access=private)
function w = applyMapPrivate(f, z)
w = polyval(f.coefficients, z);
end
end
end