Scilab Function
Last update : 22/07/2008

lft_direct2d - [For comparison only] 2D Legendre-Fenchel conjugate, direct computation

Calling Sequence

Conj = lft_direct2d (Xr, Xc, f, Sr, Sc)

Parameters

Description

Warning: This function is provided only for comparison purposes and unit testing, use the more efficient lft_llt2d for faster computation.

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 lft_direct 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) and N=n^2, this function calls lft_direct n times in one dimension and then n times in the other dimension (2*n^3), giving a O(N^(3/2)) 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.

        f*(s(1),s(2)) = Sup [x(1)y(1) + x(2)y(2) - f(x(1),x(2))]
                     x(1),x(2)
  
                      = Sup [s(1)x(1) + Sup[s(2)x(2) - f(x(1),x(2))]]
                        x(1)            x(2)

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 = lft_llt2d (Xr, Xc, z, Sr, Sc, 0); //llt method
    result_direct = lft_direct2d (Xr, Xc, z, Sr, Sc, 1); //direct method
  

See Also

lft_llt2d,  lft_direct,  

Author

Mike Trienis, University of British Columbia, BC, Canada