annotate general/numerical/scalar/hypdecay.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
parents db7f4afd27c5
children
rev   line source
samer@4 1 function ret=hypdecay(k,d)
samer@4 2 % hypdecay - compute interpolation ratio for hyperbolic decay
samer@4 3 %
samer@4 4 % hypdecay :: [Size->nonneg], [Size->nonneg] -> [Size->nonneg].
samer@4 5 % hypdecay :: [Size->nonneg] -> ([Size->nonneg] -> [Size->nonneg]).
samer@4 6 %
samer@4 7 % this gives 'hyperbolic' convergence which is more like
samer@4 8 % a sort of diffusion by Brownian motion. The trick is
samer@4 9 % to add a constant to the inverse of each natural parameter,
samer@4 10 % which is like a temperature or variance. The constant
samer@4 11 % is like a diffusion constant
samer@4 12 %
samer@4 13 % This function supports partial application: if only one
samer@4 14 % argument is supplied, it returns a function handle.
samer@4 15
samer@4 16 if nargin==2, ret=1./(1+k*d);
samer@4 17 else ret=@(d)1./(1+k*d); end