cca_fenchel - Generic Legendre Fenchel Transform (LFT)
The fenchel function is a wrapper for two different conjugate computations depending on the calling sequence. The first calling sequence [Conj]=cca_fenchel(X,Y,S) uses lft_llt function for the 1D lft computation. The third calling sequence [Conj]=cca_fenchel(Xr,Xc,f,Sr,Sc) uses the lft_llt2d function for the 2D lft computation. The second and fourth calling sequence have an additional boolean parameter isConvex to speed up computational time for each dimension. For a more detailed description see links below.
//Example 1. First Calling Sequence X = [1:1:10]' Y = 0.5.*(X.^2) [Conjw] = cca_fenchel(X, Y, X); //Example 2. Second Calling Sequence X = [1:1:10]' Y = 0.5.*(X.^2) [Conjw] = cca_fenchel(X, Y, X, %t); //Example 3. Third Calling Sequence //xr and xc is the grid which f is evaluated on Xr=(-2:1:2)'; //x Xc=(-2:1:2)'; //y //sr and sc is the grid which f* is evaluated on Sr=(-2:1:2)'; Sc=(-2:1:2)'; f = rand(size(Xr,1),size(Xc,1)); [Conj] = cca_fenchel(Xr,Xc,f,Sr,Sc); //Example 4. Fourth Calling Sequence Xr=(-2:1:2)'; //x Xc=(-2:1:2)'; //y //sr and sc is the grid which f* is evaluated on Sr=(-2:1:2)'; Sc=(-2:1:2)'; f = rand(size(Xr,1),size(Xc,1)); [Conj] = cca_fenchel(Xr,Xc,f,Sr,Sc,%f);
Mike Trienis, University of British Columbia, BC, Canada