140 this =
this@kernels.ARBFKernel;
141 this.
registerProps(
" r0 ",
" NewtonTolerance ",
" MaxNewtonIterations ");
157 copy =
clone@kernels.ARBFKernel(
this, copy);
175 n = zeros(3,length(s));
176 n(1,:) = this.d1(1) - (this.sc(1)-this.
evaluateScalar(s))./(eps-s);
177 n(2,:) = this.d1(2) - (this.sc(2)-this.
evaluateScalar(s))./(this.p(2)-s+eps);
178 n(3,:) = this.d1(3) - (this.sc(3)-this.
evaluateScalar(s))./(this.p(3)-s+eps);
181 dn = zeros(3,length(s));
182 dn(1,:) = this.d2(1) - n(1,:)./-s;
184 dn(2,:) = this.d2(2) - n(2,:)./(this.p(2)-s);
185 dn(2,isinf(dn(2,:))) = 0;
187 dn(3,:) = this.d2(3) - n(3,:)./(this.p(3)-s);
188 dn(3,isinf(dn(3,:))) = this.d2(3)/2;
211 [g,dg] = this.
optFun(r,s,n,dn);
222 error(
" Bellfunction->ModifiedNewton: Max iterations of %d reached ",this.
MaxNewtonIterations);
265 #if 0 //mtoc++: 'set.r0'
267 if ~isreal(value) || value < 0 || ~isscalar(value)
268 error("
r0 must be a scalar greater than zero. ");
278 #if 0 //mtoc++: 'get.r0'
279 function value =
r0() {
288 function setConstants() {
294 q = [0 this.
r0 this.
rm];
310 function [g , dg , pi , pl , pr ] =
optFun(r,s,n,dn) {
312 d = g; c = d; dg = g;
315 pi = a & r < this.r0 | ~a & r > this.
r0;
316 pr = a & r > this.
rm;
318 std = ~(pi | pl | pr);
321 rs = r(std); ss = s(std);
324 dg(std) = this.
evaluateD2(rs) - g(std)./(rs-ss);
330 c(pi) = dn(2,pi).^2 ./ (4*n(2,pi));
331 d(pi) = 2*n(2,pi)./dn(2,pi) - this.
r0;
332 c(pl) = dn(1,pl).^2 ./ (4*n(1,pl));
333 d(pl) = 2*n(1,pl)./dn(1,pl);
334 c(pr) = dn(3,pr).^2 ./ (4*n(3,pr));
335 d(pr) = 2*n(3,pr)./dn(3,pr) - this.
rm;
337 g(penalty) = c(penalty) .* (r(penalty) + d(penalty)).^2;
338 dg(penalty) = 2 * c(penalty) .* (r(penalty) + d(penalty));
374 if isfield(from,
" fr0 ") && ~isempty(from.fr0)
380 elseif ~isa(
this,
" kernels.BellFunction ")
381 error(
" Object passed is not a kernels.BellFunction instance and no init struct is given. ");
384 error(
" Internal r0 field not persisted yet and not initialized in subclass loadobj method. ");
function c = getGlobalLipschitz()
Computes the absolute value of the first derivative at x0 Implements the template method from BaseKer...
function rtmp = ModifiedNewton(rstart, s)
function copy = clone(copy)
The interface method with returns a copy of the current class instance.
BELLFUNCTION Summary of this class goes here Detailed explanation goes here.
static function this = loadobj(this, from)
As the constant properties are transient, they have to be re-computed upon loading.
function registerProps(varargin)
Call this method at any class that defines DPCM observed properties.
virtual function ddr = evaluateD2()
Method for second derivative evaluation.
rm
The maximum ("right") value for any .
MaxNewtonIterations
Hard break for iteration count of modified newton algorithm.
KerMorObject()
Constructs a new KerMor object.
r0
Point of maximum first derivative on scalar evaluation.
NewtonTolerance
Error tolerance for modified newton iteration.
virtual function phir = evaluateScalar(matrix< double > r)
Allows the evaluation of the function for scalar directly.
function [ g , dg , pi , pl , pr ] = optFun(r, s, n, dn)
virtual function dr = evaluateD1()
Method for first derivative evaluation.
Abstract class for radial basis function / rotation- and translation invariant kernels.