lft_plt - Parametric Legendre Transform, PLT algorithm
Compute numerically the Legendre Fenchel transform by generating a uniform grid between an interval a,b and computing s[i] = f'(x), and f*(s[i]) = x[i]s[i] - f(x[i]). Which returns a set S of slopes in the dom of f* and the values of f* on S.
function y = f(x), y=0.5 * x.^2, endfunction; function s = df(x), s= x, endfunction; b=%T;n=8; X=(-n/2:1:n/2)';S=df(X);Y=f(X); [Conj, S] = lft_plt(X, f, df);
Yves Lucet, University of British Columbia, BC, Canada