1classdef nfsftTestcaseTrafoDelegate 2 %NFSFTTESTCASETRAFODELEGATE Summary of this class goes here 3 % Detailed explanation goes here 4 5 properties 6 name = ''; 7 end 8 9 methods 10 function h = nfsftTestcaseTrafoDelegate(name) 11 h.name = name; 12 end 13 14 function plan = trafo(h, plan) 15 switch h.name 16 case 'trafo_direct' 17 if isnumeric(plan) 18 ndsft_trafo(plan); 19 else 20 plan.ndsft_trafo; 21 end 22 case 'trafo' 23 if isnumeric(plan) 24 nfsft_trafo(plan); 25 else 26 plan.nfsft_trafo; 27 end 28 case 'adjoint_direct' 29 if isnumeric(plan) 30 ndsft_adjoint(plan); 31 else 32 plan.ndsft_adjoint; 33 end 34 case 'adjoint' 35 if isnumeric(plan) 36 nfsft_adjoint(plan); 37 else 38 plan.nfsft_adjoint; 39 end 40 otherwise 41 error('Unknown trafo: %s', h.name); 42 end 43 end 44 45 function result = isCost(h) 46 switch h.name 47 case {'trafo_direct', 'adjoint_direct'} 48 result = 1; 49 otherwise 50 result = 0; 51 end 52 end 53 54 function val = cost(h, plan) 55 switch h.name 56 otherwise 57 error('not implemented'); 58 end 59 end 60 61 function val = acc(h, m) 62 switch h.name 63 case {'trafo_direct', 'adjoint_direct'} 64 val = 2^13 * eps; 65 otherwise 66% err = pi * (sqrt(m) + m) * sqrt(sqrt(1 - 1/2)) * exp(-2*pi * m * sqrt(1 - 1 / 2)); 67% val = max(0.33 * err, 2500 * eps); 68 val = 2^22 * eps; 69 end 70 end 71 end 72 73end 74 75