view general/numerical/scalar/hypdecay.m @ 16:db7f4afd27c5

Rearranging numerical toolbox.
author samer
date Thu, 17 Jan 2013 13:20:44 +0000
parents general/numerical/hypdecay.m@e44f49929e56
children
line wrap: on
line source
function ret=hypdecay(k,d)
% hypdecay - compute interpolation ratio for hyperbolic decay
%
% hypdecay :: [Size->nonneg], [Size->nonneg] -> [Size->nonneg].
% hypdecay :: [Size->nonneg] -> ([Size->nonneg] -> [Size->nonneg]).
%
% this gives 'hyperbolic' convergence which is more like 
% a sort of diffusion by Brownian motion. The trick is
% to add a constant to the inverse of each natural parameter,
% which is like a temperature or variance. The constant
% is like a diffusion constant
%
% This function supports partial application: if only one
% argument is supplied, it returns a function handle.

if nargin==2, ret=1./(1+k*d);
else ret=@(d)1./(1+k*d); end