3D Legendre-Fenchel conjugate, LLT algorithm
Conj = pl_lft_llt_3d (Xr, Xc, Xt, f, Sr, Sc, St) Conj = pl_lft_llt_2d (Xr, Xc, Xt, f, Sr, Sc, St, isConvex)
column vector of length n.
column vector of length m.
column vector of length k.
hypermatrix of size nxmxk. The function f is sampled on a grid Xr x Xc x Xt so f(i,j,k)=ff(Xr(i),Xc(j),Xt(k)) for some function ff.
column vector of size m1.
column vector of size m2.
column vector of size m3. The Conugate is computed on a grid SrxScxSt.
Boolean, optional. Whether or not the given function is known to be true. Defaults to false. It is passed to pl_lft_llt.
hypermatrix of size m1xm2xm3 containing the Conjugate of the function f.
Numerically compute the discrete Legendre transform on the grid Sr x Sc x St, given a function f(x,y,z) defined on a grid Xr x Xc x Xt, using the LLT1d algorithm to compute the conjugate in one dimension, then to compute it in the other dimension. If n==length(Xr)==length(Xc)==length(Xt)==length(Sr)==length(Sc)==length(St), this function calls LLT1d n times in each of the three dimensions (3*n^3), giving a linear running time with respect to the O(n^3) input size.
The conjugate of a function in R^3 can be factored to several conjugates which are elements of R.
Xr=(-2:0.25:2)'; Xc=(-2:0.25:2)'; Xt=(-2:0.25:2)'; Sr=(-2:0.25:2)'; Sc=(-2:0.25:2)'; St=(-2:0.25:2)'; deff('[z]=f(Xr,Xc,Xt)',['z= Xr^2 + 2*Xc^2 + 3*Xt^2']); z=zeros(length(Xr), length(Xc), length(Xt)); for i=1:length(Xr), for j=1:length(Xc), for k=1:length(Xt), z(i,j,k) = f(Xr(i),Xc(j),Xt(k)); end; end; end; result_llt = pl_lft_llt_3d (Xr, Xc, Xt, z, Sr, Sc, St, 0); | ![]() | ![]() |
Mike Trienis
, University of British Columbia, BC, Canada
pl_lft_llt is called three times, once for each dimension.