samer@4: function ret=hypdecay(k,d) samer@4: % hypdecay - compute interpolation ratio for hyperbolic decay samer@4: % samer@4: % hypdecay :: [Size->nonneg], [Size->nonneg] -> [Size->nonneg]. samer@4: % hypdecay :: [Size->nonneg] -> ([Size->nonneg] -> [Size->nonneg]). samer@4: % samer@4: % this gives 'hyperbolic' convergence which is more like samer@4: % a sort of diffusion by Brownian motion. The trick is samer@4: % to add a constant to the inverse of each natural parameter, samer@4: % which is like a temperature or variance. The constant samer@4: % is like a diffusion constant samer@4: % samer@4: % This function supports partial application: if only one samer@4: % argument is supplied, it returns a function handle. samer@4: samer@4: if nargin==2, ret=1./(1+k*d); samer@4: else ret=@(d)1./(1+k*d); end