<?xml version="1.0" encoding="ISO-8859-1"?><refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:lang="en" xml:id="pl_me_pe_2d"><info><pubdate>04-Apr-2006</pubdate></info><refnamediv><refname>pl_me_pe_2d</refname><refpurpose>2D Moreau envelope, PE algorithm</refpurpose></refnamediv>
  
   
  
   
  
   
  
   
  
   

  
   <refsynopsisdiv><title>Calling Sequence</title><synopsis>M = pl_me_pe_2d(x0,xn,y0,yn,f)</synopsis></refsynopsisdiv>

  
   <refsection><title>Parameters</title>
  
      <variablelist>

    
         <varlistentry>
    
            <term>x0</term>
    
            <listitem>
       
               <para>real number. Lower bound of the x-interval.
       </para>
    
            </listitem>
    
         </varlistentry>

    
         <varlistentry>
    
            <term>xn</term>
    
            <listitem>
       
               <para>real number. Upper bound of the x-interval.
       </para>
    
            </listitem>
    
         </varlistentry>

    
         <varlistentry>
    
            <term>y0</term>
    
            <listitem>
       
               <para>real number. Lower bound of the y-interval.
       </para>
    
            </listitem>
    
         </varlistentry>

    
         <varlistentry>
    
            <term>yn</term>
    
            <listitem>
       
               <para>real number. Upper bound of the y-interval.
       </para>
    
            </listitem>
    
         </varlistentry>

    
         <varlistentry>
    
            <term>f</term>
    
            <listitem>
       
               <para>column vector. The value of the function on the grid X=[(x0:hx:xn)'] x [(y0:hy:yn)']; where n=size(f,1), hx=(xn-x0)/(n-1),
    m=size(f,2), and hy=(yn-y0)/(m-1), so  f(i,j)=fu(X(i,j)) for some function fu.
       </para>
    
            </listitem>
    
         </varlistentry>

    
         <varlistentry>
    
            <term>M</term>
    
            <listitem>
       
               <para>matrix of size nxm containing the Moreau envelope of the function f.
       </para>
    
            </listitem>
    
         </varlistentry>
  
      </variablelist>
  
   </refsection>
 
 
   <refsection><title>Description</title>
	     
      <para>
	Compute numerically the discrete Moreau envelope of a set of spatial points (X(i1,i2),f(i1,i2)) at slopes (X(j1,j2)). It reduces
	computation to one dimension, and uses the one-dimensional parabolic envelope algorithm (see <link linkend="pl_me_pe">pl_me_pe</link>) resulting in a
	theta(n*m) linear-time algorithm.</para>
  
   </refsection>

  
   <refsection><title>Examples</title><programlisting role="example"><![CDATA[
        function f=f(lambda,x),f=lambda * x.^2,endfunction
        function g=g(lambda1,lambda2,x,y),g=f(lambda1,x)+f(lambda2,y),endfunction
        lambda1=1;lambda2=2;
        x1=(-10:10)';x2=(-5:5)';
        [X, Y]=ndgrid(x1,x2);F=g(lambda1,lambda2,X,Y);
        s1=(-4:4)';s2=(-5:6)';
        Xr=x1;Xc=x2;Sr=s1;Sc=s2;
        desired=pl_me_pe_2d(x1,x2,F,s1,s2);
        //1d computation for separable function
        Ms1=pl_me_direct(x1,f(lambda1,x1),s1);
        Ms2=pl_me_direct(x2,f(lambda2,x2),s2);
        t1 = Ms1 * ones(1,size(Ms2,1));
        t2 = ones(size(Ms1,1),1) * Ms2';
        correct=t1+t2;
        b = and(correct == desired);
  ]]></programlisting></refsection>

  
   <refsection><title>See Also</title><simplelist type="inline">
    
      <member> 
         <link linkend="pl_me_brute_2d">pl_me_brute_2d</link> 
      </member>
    
      <member> 
         <link linkend="pl_me_direct_2d">pl_me_direct_2d</link> 
      </member>
    
      <member> 
         <link linkend="pl_me_llt_2d">pl_me_llt_2d</link> 
      </member>
    
      <member> 
         <link linkend="pl_me_nep_2d">pl_me_nep_2d</link> 
      </member>
    
      <member> 
         <link linkend="pl_me_pe">pl_me_pe</link> 
      </member>
  
   </simplelist></refsection>

  
   <refsection><title>Authors</title><para>
	  
      <literal>Yves Lucet</literal>, University of British Columbia, BC, Canada
  </para></refsection>

  
   <refsection><title>Bibliography</title>See <link linkend="pl_me_pe">pl_me_pe</link>   
   </refsection>

  
   <refsection><title>Used Functions</title>
     
      <para>
     Computation is reduced to one dimension, which is then
     handled by <literal>me_pe_d</literal> (me_pe_d is the same function as <link linkend="pl_me_pe">pl_me_pe</link> except the grid is assumed to be 1,..,n times 1,...,m).
     </para>
  
   </refsection>

</refentry>
