78 '\@(r)2*(l^2+4*l+3)*r/3+(l+2)' \
79 '\@(r)(3*(l^3+9*l^2+23*l+15)*r.^2 + 2*(6*l^2+36*l+45)*r)/15+(l+3)'"};
89 " @(r)(l^2+4*l+3)*r.^2/3+(l+2)*r+1 " ...
90 " @(r)((l^3+9*l^2+23*l+15)*r.^3 + (6*l^2+36*l+45)*r.^2)/15+(l+3)*r+1 "];
96 r = sqrt(this.getSqDiffNorm(x, y))/this.Gamma;
102 Kxy=(rp.^this.expo).*p;
106 function Kxy = evaluateScalar(r) {
107 error(
" not implemented ");
122 error(" Not yet implemented correctly. ");
124 r = sqrt(this.getSqDiffNorm(x, y))/this.Gamma;
130 dp = this.polyfunD1(r);
132 hlp = (-this.expo*(rp.^(this.expo-1)).*p + (rp.^this.expo).*dp)./(r*this.Gamma^2);
134 hlp(~isfinite(hlp)) = 0;
135 Nabla = bsxfun(@times,hlp,bsxfun(@minus,x,y));
147 function dx = evaluateD1(r) {
148 error(
" not implemented ");
151 function ddx = evaluateD2(
this, r)
153 error(" not implemented ");
159 function c = getGlobalLipschitz(this)
160 error(" not implemented ");
163 function copy = clone(this)
164 copy = clone@kernels.ARBFKernel(this, kernels.Wendland);
171 methods(Access=private)
172 function updateCoeffs(this)
175 l = floor(this.fd/2) + this.fk + 1;
176 this.expo=
l + this.fk;
179 this.polyfun= eval(this.polystr[this.fk]);
180 this.polyfunD1= eval(this.polystrD1[this.fk]);
187 function set.
k(this, value)
188 if value < 0 || value > 3
189 error(" Only
k values in [0,3] are allowed ");
190 elseif round(value) ~= value
191 error(" Only the
k values 0,1,2,3 are allowed ");
197 function set.d(this, value)
198 if round(value) ~= value
199 error(" The dimension must be an
integer ");
205 function v = get.d(this)
209 function v = get.
k(this)
215 function res = test_WendlandKernel(pm)
221 x = (-1.2:.01:1.2)+c;
223 x2 = [
X(:)" ;
Y(:) "];
224 k = kernels.Wendland;
225 kexp = kernels.KernelExpansion;
229 conf =
Utils.createCombinations([1 2 3 4 5],[0 1 2 3]);
230 for n = 1:length(conf)
233 tag = sprintf(" w_1d_d%d_k%d ",k.d,k.k);
234 h = pm.nextPlot(tag,sprintf(" Wendland kernel with d=%d,k=%d on 1D data ",k.d,k.k));
235 plot(h,x,kexp.evaluate(x));
237 kexp.Centers.xi= [c; c];
238 for n = 1:length(conf)
241 tag = sprintf(" w_2d_d%d_k%d ",k.d,k.k);
242 h = pm.nextPlot(tag,sprintf(" Wendland kernel with d=%d,k=%d on 2D data ",k.d,k.k));
243 surf(h,X,
Y,reshape(kexp.evaluate(x2),length(x),[])," EdgeColor "," none ");
252 methods(Static,Access=protected)
253 function this = loadobj(this)
254 this = loadobj@kernels.ARBFKernel(this);
Collection of generally useful functions.
PlotManager: Small class that allows the same plots generated by some script to be either organized a...
Abstract class for radial basis function / rotation- and translation invariant kernels.