<?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_lft_direct"><info><pubdate>04-Apr-2006</pubdate></info><refnamediv><refname>pl_lft_direct</refname><refpurpose>[For comparison only] Legendre-Fenchel conjugate, direct computation</refpurpose></refnamediv>
  
   
  
   
  
   
  
   
  
   

  
   <refsynopsisdiv><title>Calling Sequence</title><synopsis>Conj = pl_lft_direct(X,Y,S)</synopsis></refsynopsisdiv>

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

    
         <varlistentry>
    
            <term>X</term>
    
            <listitem>
       
               <para>column vector. A grid of points on which the function is sampled.
       </para>
    
            </listitem>
    
         </varlistentry>

    
         <varlistentry>
    
            <term>Y</term>
    
            <listitem>
       
               <para>column vector. The value of the function on the grid X: usually Y(i)=f(X(i)) for some function f.
       </para>
    
            </listitem>
    
         </varlistentry>

    
         <varlistentry>
    
            <term>S</term>
    
            <listitem>
       
               <para>column vector. The grid on which we want to compute the conjugate: f* is evaluated on S.
       </para>
    
            </listitem>
    
         </varlistentry>

    
         <varlistentry>
    
            <term>Conj</term>
    
            <listitem>
       
               <para>column vector. Contains the value of the conjugate f* of the function f evaluated at the points S(j). In other words: Conj(j) = Max(S(j) * X(i) - Y(i) | over all indexes i)
       </para>
    
            </listitem>
    
         </varlistentry>
  
      </variablelist>
  
   </refsection>
 
  
   <refsection><title>Description</title>
     
         <para>
         Warning: This function is provided only for comparison purposes and unit testing, use the more efficient <link linkend="pl_lft_llt">pl_lft_llt</link> or <link linkend="pl_lft_plt">pl_lft_plt</link> for faster computation.
       </para>
     
         <para>
            Compute numerically the discrete Legendre transform
	of a set of planar points (X(i),Y(i)) at 
	slopes S, i.e., <!--<programlisting><![CDATA[
                 Conj(j)=max[S(j)*X(i)-Y(i)].
                          i
]]></programlisting>-->
		<para>
			<inlinemediaobject>
				<imageobject>
					<imagedata fileref="pl_ImagesOfEquationsByLatex/pl_lft_direct/pl_lft_direct_1.png"/>
				</imageobject>
			</inlinemediaobject>
		</para>
		<para>It uses straight computation for a quadratic-time algorithm theta(n*m) with n=length(X)=length(Y) and m=length(S).</para>
     </para>
  
   </refsection>

  
   <refsection><title>Examples</title><programlisting role="example"><![CDATA[
    S=(-10:1:10)';
    X1=(-2:0.2:2)';f=abs(X1);C1 = pl_lft_direct(X1, f, S);
    X2=(-4:0.4:4)';f=abs(X2);C2 = pl_lft_direct(X2, f, S);
    X3=(-8:0.8:8)';f=abs(X3);C3 = pl_lft_direct(X3, f, S);
    X4=(-160:16:160)';f=abs(X4);C4 = pl_lft_direct(X4, f, S);

    scf(0);clf;
    plot2d([S S S S],[C1 C2 C3 C4],rect=[-3,-0.5,3,10]);
    xtitle("Convergence of the discrete Legendre transform of the absolute value to the indicator of [-1,1]");
  ]]></programlisting></refsection>

  
   <refsection><title>See Also</title><simplelist type="inline">
    
      <member>
         <link linkend="pl_lft_direct_d">pl_lft_direct_d</link>
      </member>
    
      <member>
         <link linkend="pl_lft_llt">pl_lft_llt</link>
      </member>
  
   </simplelist></refsection>

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

</refentry>
