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

  <refnamediv>
    <refname>plq_isConvex</refname>
    <refpurpose>Piecewise linear quadratic (plq), convexity test</refpurpose>
  </refnamediv>

   <refsynopsisdiv>
     <title>Calling Sequence</title>
     <synopsis>b = plq_isConvex(plqf)</synopsis>
   </refsynopsisdiv>

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

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

       <varlistentry>
         <term>b</term>
         <listitem>
           <para>boolean.  Whether or not plqf is a convex function.</para>
         </listitem>
       </varlistentry>

     </variablelist>
   </refsection>

   <refsection>
     <title>Description</title>

     <para>
       Determines whether or not plqf is a convex PLQ function, by
       testing whether it is equal to its convex hull.  True is
       returned if and only if plqf is convex.  This function runs in
       O(n) time, where n is the number of pieces in plqf.
     </para>
   </refsection>

   <refsection>
     <title>Examples</title>
     <programlisting role="example"><![CDATA[
plqf = [-1,1,0,-1; 1,0,0,0; %inf,1,0,-1];
plq_isConvex(plqf),
scf(); plq_plot(plqf);

plqf = [-3,1,8,16;0,0,-1,-2;3,0,1,-2;%inf,1,-8,16];
plq_isConvex(plqf),
scf(); plq_plot(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>
