<< pl_lft_llt pl pl_lft_llt_3d >>

CCA (Computational Convex Analysis) >> pl > pl_lft_llt_2d

pl_lft_llt_2d

2D Legendre-Fenchel conjugate, LLT algorithm

Calling Sequence

Conj = pl_lft_llt_2d (Xr, Xc, f, Sr, Sc)
Conj = pl_lft_llt_2d (Xr, Xc, f, Sr, Sc, isConvex)

Parameters

Xr

column vector of length n.

Xc

column vector of length m.

f

matrix of size nxm. The function f is sampled on a grid Xr x Xc so f(i,j)=ff(Xr(i),Xc(j)) for some function ff.

Sr

column vector of size m1.

Sc

column vector of size m2. The Conjugate is computed on a grid SrxSc.

isConvex

Boolean, optional. Whether or not the given function is known to be true. Defaults to false. It is passed to pl_lft_llt.

Conj

matrix of size m1xm2 containing the Conjugate of the function f.

Description

Numerically compute the discrete Legendre transform on the grid Sr x Sc, given a function f(x,y) defined on a grid Xr x Xc, 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(Sr)==length(Sc), this function calls LLT1d n times in one dimension and then n times in the other dimension (2*n^2), giving a linear running time with respect to the O(n^2) input size.

The conjugate of a function in R^2 can be factored to several conjugates which are elements of R.

Examples

Xr=(-2:0.1:2)'; 
Xc=(-2:0.1:2)'; 
Sr=(-2:0.1:2)';
Sc=(-2:0.1:2)';
deff('[z]=f(Xr,Xc)',['z= Xr^2 + Xc^2']);
z=eval3d(f,Xr,Xc);
result_llt = pl_lft_llt_2d (Xr, Xc, z, Sr, Sc, 0); //llt method
result_direct = pl_lft_direct_2d (Xr, Xc, z, Sr, Sc, 1); //direct method

See Also

Authors

Mike Trienis, University of British Columbia, BC, Canada

Used Functions

pl_lft_llt is called twice, once for each dimension.


Report an issue
<< pl_lft_llt pl pl_lft_llt_3d >>