bug 4601 fix
Serge Steer [Wed, 22 Jul 2009 16:31:29 +0000 (18:31 +0200)]
scilab/CHANGES_5.1.X
scilab/modules/optimization/help/en_US/aplat.xml [new file with mode: 0644]
scilab/modules/optimization/help/en_US/list2vec.xml [new file with mode: 0644]
scilab/modules/optimization/help/en_US/recons.xml [new file with mode: 0644]
scilab/modules/optimization/help/en_US/vec2list.xml [new file with mode: 0644]
scilab/modules/optimization/macros/aplat.sci
scilab/modules/optimization/macros/list2vec.sci
scilab/modules/optimization/macros/recons.sci
scilab/modules/optimization/macros/vec2list.sci

index 5dc00cd..e9533ae 100644 (file)
@@ -198,6 +198,8 @@ Bug fixes:
 
  * bug 4683 fixed - There is no example of the use of tlist in the dedicated page.
 
+ * bug 4601 fixed - hidden functions and missing help for vec2list list2vec aplat and recons.
+
 
                Changes between version 5.1.0 and 5.1.1 of Scilab
                =================================================
diff --git a/scilab/modules/optimization/help/en_US/aplat.xml b/scilab/modules/optimization/help/en_US/aplat.xml
new file mode 100644 (file)
index 0000000..8436ac6
--- /dev/null
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ * Ajouter ici d'éventuels commentaires sur le fichier XML
+-->
+<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="aplat">
+  <info>
+    <pubdate>$LastChangedDate: 22-07-2009 $</pubdate>
+  </info>
+  <refnamediv>
+    <refname>aplat</refname>
+    <refpurpose>Flattens a list. </refpurpose>
+  </refnamediv>
+  <refsynopsisdiv>
+    <title>Calling Sequence</title>
+    <synopsis>[lf,ind] = aplat(l,r)</synopsis>
+  </refsynopsisdiv>
+  <refsection>
+    <title>Parameters</title>
+    <variablelist>
+      <varlistentry>
+        <term>l</term>
+        <listitem>
+          <para>
+            a list
+          </para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>r</term>
+        <listitem>
+          <para>
+            an optional flat list
+          </para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>lf</term>
+        <listitem>
+          <para>
+            a flat list (a single hierachical level)
+          </para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>ind</term>
+        <listitem>
+          <para>
+           a list, each entry give the path of the corresponding lf entry in the original list
+          </para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsection>
+  <refsection>
+    <title>Description</title>
+    <para>
+     Creates a flat list, built with the initial l list leaves and if given prepended by the r list entries
+    </para>
+  </refsection>
+  <refsection>
+    <title>Examples</title>
+    <programlisting role="example"><![CDATA[
+        [lf,ind]=aplat(list(1,2,list([3,1],'xxx',list([3,2,1]))))
+    ]]></programlisting>
+  </refsection>
+  <refsection>
+    <title>See Also</title>
+    <simplelist type="inline">
+      <member>
+        <link linkend="recons" >recons</link>
+      </member>
+    </simplelist>
+  </refsection>
+  <refsection>
+    <title>Authors</title>
+    <simplelist type="vert">
+      <member>F.D. and S.S., INRIA</member>
+    </simplelist>
+  </refsection>
+
+</refentry>
diff --git a/scilab/modules/optimization/help/en_US/list2vec.xml b/scilab/modules/optimization/help/en_US/list2vec.xml
new file mode 100644 (file)
index 0000000..e8215dd
--- /dev/null
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Ajouter ici d'éventuels commentaires sur le fichier XML
+-->
+<refentry version="5.0-subset Scilab" xml:id="list2vec" xml:lang="en"
+          xmlns="http://docbook.org/ns/docbook"
+          xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg"
+          xmlns:ns3="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook">
+  <info>
+    <pubdate>$LastChangedDate: 22-07-2009 $</pubdate>
+  </info>
+
+  <refnamediv>
+    <refname>list2vec</refname>
+
+    <refpurpose>Catenates list entries in a matrix.</refpurpose>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <title>Calling Sequence</title>
+
+    <synopsis>[bigVector,varsizes] = list2vec(li)</synopsis>
+  </refsynopsisdiv>
+
+  <refsection>
+    <title>Parameters</title>
+
+    <variablelist>
+      <varlistentry>
+        <term>li</term>
+
+        <listitem>
+          <para>a list with n entries. The list entries must be 2D matrices with comptible
+          types.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term>bigVector</term>
+
+        <listitem>
+          <para>A column vector. Formed by the elements of the
+          corresponding list entry.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term>varsizes</term>
+
+        <listitem>
+          <para>An n by 3 matrix. Each row contains the dimensions of the
+          corresponding list entry.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsection>
+
+  <refsection>
+    <title>Description</title>
+
+    <para>Catenates list entries in a column vector. The list entries are supposed to
+    be matrices with compatible types with respect to catenation.</para>
+<para>This function is a subsidiary for <link
+    linkend="lmisolver">lmisolver</link></para>
+  </refsection>
+
+  <refsection>
+    <title>Examples</title>
+
+    <programlisting role="example">
+        list2vec(list(1,2,3))
+        list2vec(list([1 2 3],[4;5],[%s %s+1]))
+    </programlisting>
+  </refsection>
+
+  <refsection>
+    <title>See Also</title>
+
+    <simplelist type="inline">
+      <member><link linkend="vec2list">vec2list</link></member>
+    </simplelist>
+  </refsection>
+
+  <refsection>
+    <title>Authors</title>
+
+    <simplelist type="vert">
+      <member>F.D. INRIA</member>
+    </simplelist>
+  </refsection>
+</refentry>
diff --git a/scilab/modules/optimization/help/en_US/recons.xml b/scilab/modules/optimization/help/en_US/recons.xml
new file mode 100644 (file)
index 0000000..3bd5382
--- /dev/null
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Ajouter ici d'éventuels commentaires sur le fichier XML
+-->
+<refentry version="5.0-subset Scilab" xml:id="recons" xml:lang="fr"
+          xmlns="http://docbook.org/ns/docbook"
+          xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg"
+          xmlns:ns3="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook">
+  <info>
+    <pubdate>$LastChangedDate: 22-07-2009 $</pubdate>
+  </info>
+
+  <refnamediv>
+    <refname>recons</refname>
+
+    <refpurpose>reciprocal function for aplat.</refpurpose>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <title>Calling Sequence</title>
+
+    <synopsis>r = recons(fl,ind)</synopsis>
+  </refsynopsisdiv>
+
+  <refsection>
+    <title>Parameters</title>
+
+    <variablelist>
+      <varlistentry>
+        <term>fl</term>
+
+        <listitem>
+          <para>a "flat" list.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term>ind</term>
+
+        <listitem>
+          <para>a list of paths</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term>r</term>
+
+        <listitem>
+          <para>a hierachical list build with the leaves of fl</para>
+        </listitem>
+      </varlistentry>
+
+    </variablelist>
+  </refsection>
+
+  <refsection>
+    <title>Description</title>
+
+    <para>Reciprocal function for aplat. Creates a hierachical list given a flat one and a list of paths.</para>
+<para>utility function for vec2list and lmisolver.</para>
+  </refsection>
+
+  <refsection>
+    <title>Examples</title>
+
+    <programlisting role="example">
+        [lf,ind]=aplat(list(1,2,list([3,1],'xxx',list([3,2,1]))));
+        recons(lf,ind)
+    </programlisting>
+  </refsection>
+
+  <refsection>
+    <title>See Also</title>
+
+    <simplelist type="inline">
+      <member><link linkend="aplat">aplat</link></member>
+    </simplelist>
+  </refsection>
+
+  <refsection>
+    <title>Authors</title>
+
+    <simplelist type="vert">
+      <member>F.D and S.S. INRIA</member>
+    </simplelist>
+  </refsection>
+
+
+</refentry>
diff --git a/scilab/modules/optimization/help/en_US/vec2list.xml b/scilab/modules/optimization/help/en_US/vec2list.xml
new file mode 100644 (file)
index 0000000..0268fe3
--- /dev/null
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Ajouter ici d'éventuels commentaires sur le fichier XML
+-->
+<refentry version="5.0-subset Scilab" xml:id="vec2list" xml:lang="en"
+          xmlns="http://docbook.org/ns/docbook"
+          xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg"
+          xmlns:ns3="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook">
+  <info>
+    <pubdate>$LastChangedDate: 22-07-2009 $</pubdate>
+  </info>
+
+  <refnamediv>
+    <refname>vec2list</refname>
+
+    <refpurpose>list2vec reciprocal function</refpurpose>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <title>Calling Sequence</title>
+
+    <synopsis>li=vec2list(bigVector,varsizes,ind)</synopsis>
+  </refsynopsisdiv>
+
+  <refsection>
+    <title>Parameters</title>
+
+    <variablelist>
+     
+      <varlistentry>
+        <term>bigVector</term>
+
+        <listitem>
+          <para>An m by n matrix. Each column is used to generate the
+          corresponding list entry.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term>varsizes</term>
+
+        <listitem>
+          <para>An n by 2 matrix. Each row give the dimensions of the
+          matrix to be built with the correponding column of
+          bigVector.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>ind</term>
+
+        <listitem>
+          <para>a list with n entries. Each entry is a vector of
+          positive integers which gives the hierchical path where the
+          corresponding matrix has to be put.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term>li</term>
+
+        <listitem>
+          <para>a list or a recursive list with n leaves. The list
+          entries (or leaves) are 2D matrices built with the
+          corresponding column of bigVector and size given by the
+          corresponding row of varsizes.</para>
+        </listitem>
+      </varlistentry>
+
+    </variablelist>
+  </refsection>
+
+  <refsection>
+    <title>Description</title>
+    <para>If the ind argument is not given, this function creates a
+    list.  The list entries (or leaves) are 2D matrices built with the
+    corresponding column of bigVector and size given by the
+    corresponding row of varsizes.</para>
+
+    <para>If the ind argument is given, this function creates a
+    hierachical list with n leaves. The leaves are 2D matrices built
+    with the corresponding column of bigVector and size given by the
+    corresponding row of varsizes. The hierachical path for each leaf
+    if given by the corresponding entry of ind.</para>
+    <para>This function is a subsidiary for <link
+    linkend="lmisolver">lmisolver</link></para>
+  </refsection>
+
+  <refsection>
+    <title>Examples</title>
+
+    <programlisting role="example">
+        vec2list(1:4,ones(4,2))
+        vec2list(1:4,[2 1;1 2])
+        vec2list(1:4,ones(4,2),list(1,2,[3,1],[3,2,1]))
+    </programlisting>
+  </refsection>
+
+  <refsection>
+    <title>See Also</title>
+
+    <simplelist type="inline">
+      <member><link linkend="list2vec">list2vec</link></member>
+    </simplelist>
+  </refsection>
+
+  <refsection>
+    <title>Authors</title>
+
+    <simplelist type="vert">
+      <member>F.D., INRIA</member>
+      <member>S.S., INRIA</member>
+    </simplelist>
+  </refsection>
+</refentry>
index 0dca889..869e617 100644 (file)
 function [r,ind]=aplat(l,r)
 //flattens a list. If l is constant it puts it in a list
 //ind contains the list structure
-if type(l)==1|type(l)==5 then r=list(l);ind=-1;return;end
-n=size(l)
-[lhs,rhs]=argn(0)
-if rhs==1 then r=list(),nr=0,end
-ind=list()
-i=0
-nind=0
-for li=l
- i=i+1
- if type(li)==15 then 
-    [r,ind1]=aplat(li,r)
-    ni=size(ind1)
-    for j=1:ni,nind=nind+1;ind(nind)=[i,ind1(j)];end
-    nr=size(r)
-  else
-    nr=nr+1
-    r(nr)=li
-    nind=nind+1
-    ind(nind)=i
+  if type(l)<>15 then r=list(l);ind=-1;return;end
+  n=size(l)
+  [lhs,rhs]=argn(0)
+  if rhs==1 then r=list(),nr=0,end
+  ind=list()
+  i=0
+  nind=0
+  for li=l
+    i=i+1
+    if type(li)==15 then 
+      [r,ind1]=aplat(li,r)
+      ni=size(ind1)
+      for j=1:ni,nind=nind+1;ind(nind)=[i,ind1(j)];end
+      nr=size(r)
+    else
+      nr=nr+1
+      r(nr)=li
+      nind=nind+1
+      ind(nind)=i
+    end
   end
-end
 endfunction
index 4eeef64..ec1760b 100644 (file)
@@ -11,12 +11,12 @@ function [bigVector,varsizes]=list2vec(li)
 //li=list(X1,...Xk) is a list of matrices
 //bigVector: big vector [X1(:);...;Xk(:)] (stacking of matrices in li)
 //varsizes: k x 2 matrix, with varsiz(i,:)=size(Xi)
-bigVector=[];varsizes=[];
-li=aplat(li)
-for mati=li
-  sm=size(mati);
-  varsizes=[varsizes;sm];
-  bigVector=[bigVector;matrix(mati,prod(sm),1)];
-//  bigVector=[bigVector;mati(:)];        
-end
+  bigVector=[];varsizes=[];
+  li=aplat(li)
+  for mati=li
+    sm=size(mati);
+    varsizes=[varsizes;sm];
+    bigVector=[bigVector;matrix(mati,-1,1)];
+
+  end
 endfunction
index 452b597..fd3df80 100644 (file)
@@ -9,7 +9,7 @@
 //
 function [r,ind]=recons(r,ind)
 //reconstruct a list from a flat list (see aplat)
-  if ind==-1 then r=r(:);return;end
+  if ind==-1 then return;end
   nr=size(r)
   ma=0
   for k=nr:-1:1
index 07024a2..ba3cf89 100644 (file)
@@ -11,17 +11,17 @@ function li=vec2list(bigVector,varsizes,ind)
 //bigVector: big vector
 //varsizes: k x 2 matrix, varsizes(i,:)=size of ith matrix
 //li: list of k matrices, li(i)=matrix of size varsizes(i,:);
-[LHS,RHS]=argn(0)
-if bigVector==[] then
-     n=0;for dimi=varsizes',n=n+prod(dimi);end
-bigVector=zeros(n,1);
-end
-li=list();point=1;i=0;
-for dimi=varsizes'
- newpoint=point+prod(dimi)-1;i=i+1;
- li(i)=matrix(bigVector(point:newpoint),dimi(1),dimi(2));
- point=newpoint+1;
-end
-if RHS==3 then li=recons(li,ind); end
+  [LHS,RHS]=argn(0)
+  if bigVector==[] then
+    n=0;for dimi=varsizes',n=n+prod(dimi);end
+    bigVector=zeros(n,1);
+  end
+  li=list();point=1;i=0;
+  for dimi=varsizes'
+    newpoint=point+prod(dimi)-1;i=i+1;
+    li(i)=matrix(bigVector(point:newpoint),dimi(1),dimi(2));
+    point=newpoint+1;
+  end
+  if RHS==3 then li=recons(li,ind); end
 endfunction