<< pl_lft_llt_2d | CCA (Computational Convex Analysis) | pl_lft_llt_d >>

CCA (Computational Convex Analysis) >> CCA (Computational Convex Analysis) > pl_lft_llt_3d

# pl_lft_llt_3d

3D Legendre-Fenchel conjugate, LLT algorithm

### Calling Sequence

    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)

### Parameters

Xr

  column vector of length n.

Xc

  column vector of length m.

Xt

  column vector of length k.

f

  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.

Sr

  column vector of size m1.

Sc

  column vector of size m2.

St

  column vector of size m3. The Conugate is computed on a grid SrxScxSt.

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

  hypermatrix of size m1xm2xm3 containing the Conjugate of the function f.

### Description

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.

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

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

### Examples

    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);

### See Also

- pl_lft_llt
- pl_lft_llt_2d

### Authors

`Mike Trienis`, University of British Columbia, BC, Canada

### Used Functions

pl_lft_llt is called three times, once for each dimension.

<< pl_lft_llt_2d | CCA (Computational Convex Analysis) | pl_lft_llt_d >>