<?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_clean"><info><pubdate>04-Apr-2006</pubdate></info><refnamediv><refname>plq_clean</refname><refpurpose>Piecewise linear quadratic (plq), clears duplicate rows</refpurpose></refnamediv>
  
   
  
   
  
   
  
   
  
   
  
   <refsynopsisdiv><title>Calling Sequence</title><synopsis>[plqClean] = plq_clean(plqDirty)</synopsis></refsynopsisdiv>

  
   <refsection><title>Parameters</title>
	  
      <variablelist>
		  
         <varlistentry>
			  
            <term>plqDirty</term>
			  
            <listitem>
				  
               <para>matrix. A plq function with dimensions n x 4.
				  </para>
			  
            </listitem>
		  
         </varlistentry>
		  
         <varlistentry>
			  
            <term>plqClean</term>
			  
            <listitem>
				  
               <para>matrix. A plq function with dimensions n x 4.
				  </para>
			  
            </listitem>
		  
         </varlistentry>
	  
      </variablelist>
  
   </refsection>
 
  
   <refsection><title>Description</title>
     
         <para>
	     The plq_clean function is used to help clear duplicate rows which arise during the plq fenchel conjugate operation. For example, the function reduces the number of rows by merging these two pieces of a plq function into one e.g. [0,1,0,0;0,1,0,0] -&gt; [0,1,0,0]. The function also compresses duplicate point values e.g. [0,1,0,1;0,2,0,0] -&gt; [0,1,0,1], and merges adjacent rows that are always infinite (which arise in plq_add).
    </para>

    <para>
      This algorithm runs in O(n) time, where n is the number of pieces in plqf.
    </para>
 	
   </refsection>
  
   <refsection><title>Examples</title><programlisting role="example"><![CDATA[
// Example 1. Clear Duplicate Points
plqDirty=[0,1,0,0;0,2,0,0;1,2,3,4;%inf,3,0,0];
plqClean=plq_clean(plqDirty);
// plqClean == [0,1,0,0;1,2,3,4;%inf,3,0,0];

// Example 2. Clear Duplicate Rows
plqDirty=[0,1,0,0;0,1,0,0;1,2,3,4;%inf,3,0,0];
plqClean=plq_clean(plqDirty);
// plqClean == [0,1,0,0;1,2,3,4;%inf,3,0,0];

// Example 3. Clear Duplicate Infinites
plqDirty = [-1  ,  0,  -1, %inf; ...
            -0.5,  0,   1, %inf; ...
             0  ,  0,   1, 1   ; ...
             0.5,  0,  -1, 1   ; ...
             1  ,  0,  -1, %inf; ...
            %inf,  0,   1, %inf];
plqClean = plq_clean(plqDirty);
// plqClean == [-0.5,  0,  0, %inf; ...
//               0  ,  0,  1, 1   ; ...
//               0.5,  0, -1, 1   ; ...
//              %inf,  0,  0, %inf];
            

  ]]></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>Mike Trienis</literal>, University of British Columbia, BC, Canada
  </para></refsection>

</refentry>