<?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="plq_minPt">
  <info>
    <pubdate>19-May-2010</pubdate>
  </info>

  <refnamediv>
    <refname>plq_minPt</refname>
    <refpurpose>Piecewise linear quadratic (plq), minimum point</refpurpose>
  </refnamediv>

   <refsynopsisdiv>
     <title>Calling Sequence</title>
     <synopsis>[fmin, xmin] = plq_minPt(plqf)</synopsis>
   </refsynopsisdiv>

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

       <varlistentry>
         <term>plqf</term>
         <listitem>
           <para>matrix. A PLQ function.</para>
         </listitem>
       </varlistentry>

       <varlistentry>
         <term>fmin</term>
         <listitem>
           <para>real number, or infinite.  The minimum value of the function plqf.</para>
         </listitem>
       </varlistentry>

       <varlistentry>
         <term>xmin</term>
         <listitem>
           <para>column vector.  A vector of points in the argmin of plqf.</para>
         </listitem>
       </varlistentry>

     </variablelist>
   </refsection>

   <refsection>
     <title>Description</title>

     <para>
       Performs a linear scan of plqf, checking each of its pieces, to
       determine the set of points at which plqf attains its minimum.
       fmin may be %inf (if plqf is %inf everywhere) or -%inf (if plqf
       reaches -%inf somewhere, or in the limit).
     </para>

     <para>
       The vector xmin will contain all minimizers of plqf, except
       when plqf is minimized over an interval, in which case xmin
       will contain only the boundaries of this interval.  If plqf is
       a constant function, then xmin is simply [0].  The vector xmin
       is always returned in nondecreasing order.
     </para>

     <para>
       This algorithm runs in O(n log n) time, due to the use of
       sorting subroutines.
     </para>
   </refsection>

   <refsection>
     <title>Examples</title>
     <programlisting role="example"><![CDATA[
plqf = [-3 0 -0.5 -0.5;-2 0  2 7;0 0 -0.5 2;%inf 0 2 2];
[fmin, xmin] = plq_minPt(plqf),
scf(); plq_plotMultiple(%f, %f, plqf);

plqf  = [-15.495963    0.         -0.6666667  -2.2597654;
          -5.3940994    0.0058845  -0.4842946  -0.8467499;
          -4.002795     0.100625     0.5377847    1.9098488;
          -3.8909938  -0.0993827  -1.0633951  -1.2947485;
          -0.3961698    0.100625     0.4930625    1.7333349;
           0.9454451  -0.0993827    0.3345885    1.7019436;
           4.1586957    0.100625   -0.0436042    1.8807238;
          10.626398    0.0803995    0.1246192    1.5309288;
         %inf          0.           1.8333333  -7.5478088];
[fmin, xmin] = plq_minPt(plqf),
scf(); plq_plotMultiple(%f, %f, plqf);
]]></programlisting>
   </refsection>

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

   <refsection>
     <title>Authors</title>
     <para>
       <literal>Bryan Gardiner</literal>, University of British Columbia, BC, Canada
     </para>
   </refsection>

</refentry>
