[Obsolete] pcg 35/15335/4
Bruno JOFRET [Tue, 7 Oct 2014 12:16:49 +0000 (14:16 +0200)]
* Macro removed
* Test bug_3310.tst removed because related to a typo in the macro itself.

Change-Id: Ia199bb553aaa422dd3c170518714bb456ddf6206

scilab/CHANGES_5.5.X
scilab/modules/helptools/data/configuration/scilab_macros.txt
scilab/modules/sparse/help/en_US/iterativesolvers/pcg.xml [deleted file]
scilab/modules/sparse/help/ja_JP/iterativesolvers/pcg.xml [deleted file]
scilab/modules/sparse/macros/pcg.sci [deleted file]
scilab/modules/sparse/tests/nonreg_tests/bug_3310.dia.ref [deleted file]
scilab/modules/sparse/tests/nonreg_tests/bug_3310.tst [deleted file]

index 377b582..ea3f7f7 100644 (file)
@@ -14,6 +14,8 @@ Removed Functions
 
 * IsAScalar removed. Please use isscalar instead.
 
+* pcg removed. Please use conjgrad instead.
+
 * milk_drop removed.
 
                      Changes between version 5.5.0 and 5.5.1
diff --git a/scilab/modules/sparse/help/en_US/iterativesolvers/pcg.xml b/scilab/modules/sparse/help/en_US/iterativesolvers/pcg.xml
deleted file mode 100644 (file)
index 2c7bfb9..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: made obsolete, merged in conjgrad
- * Copyright (C) XXXX-2008 - INRIA
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
- *
- -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="pcg" xml:lang="en">
-    <refnamediv>
-        <refname>pcg</refname>
-        <refpurpose>precondioned conjugate gradient</refpurpose>
-    </refnamediv>
-    <refsynopsisdiv>
-        <title>Calling Sequence</title>
-        <synopsis>[x, flag, err, iter, res] = pcg(A, b [, tol [, maxIter [, M [, M2 [, x0 [, verbose]]]]]])
-            [x, flag, err, iter, res] = pcg(A, b [key=value,...])
-        </synopsis>
-    </refsynopsisdiv>
-    <refsection>
-        <title>Arguments</title>
-        <variablelist>
-            <varlistentry>
-                <term>A</term>
-                <term/>
-                <listitem>
-                    <para>a matrix, or a function, or a list computing
-                        <literal>A*x</literal> for each given <literal>x</literal>. The
-                        following is a description of the computation of A*x depending on
-                        the type of A.
-                    </para>
-                    <itemizedlist>
-                        <listitem>
-                            <para>
-                                <literal>matrix.</literal>If A is a matrix, it can be
-                                dense or sparse
-                            </para>
-                        </listitem>
-                        <listitem>
-                            <para>
-                                <literal>function.</literal>If A is a function, it must
-                                have the following header :
-                            </para>
-                            <programlisting role=""><![CDATA[
-function y = A ( x )
- ]]></programlisting>
-                        </listitem>
-                        <listitem>
-                            <para>
-                                <literal>list.</literal>If A is a list, the first element
-                                of the list is expected to be a function and the other elements
-                                in the list are the arguments of the function, from index 2 to
-                                the end. When the function is called, the current value of x is
-                                passed to the function as the first argument. The other
-                                arguments passed are the one given in the list.
-                            </para>
-                        </listitem>
-                    </itemizedlist>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>b</term>
-                <listitem>
-                    <para>right hand side vector (size: nx1)</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>tol</term>
-                <listitem>
-                    <para>error relative tolerance (default: 1e-8).
-                        The termination criteria is based on the 2-norm of the
-                        residual r=b-Ax, divided by the 2-norm of the right hand side b.
-                    </para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>maxIter</term>
-                <listitem>
-                    <para>maximum number of iterations (default: n)</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>M</term>
-                <listitem>
-                    <para>preconditioner: full or sparse matrix or function returning
-                        <literal>M\x</literal> (default: none)
-                    </para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>M2</term>
-                <listitem>
-                    <para>preconditioner: full or sparse matrix or function returning
-                        <literal>M2\x</literal> for each <literal>x</literal> (default:
-                        none)
-                    </para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>x0</term>
-                <listitem>
-                    <para>initial guess vector (default: zeros(n,1))</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>verbose</term>
-                <listitem>
-                    <para>set to 1 to enable verbose logging (default 0)</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>x</term>
-                <listitem>
-                    <para>solution vector</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>flag</term>
-                <listitem>
-                    <para>
-                        0 if <literal>pcg</literal> converged to the desired tolerance
-                        within <literal>maxi</literal> iterations, 1 else
-                    </para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>err</term>
-                <listitem>
-                    <para>final relative norm of the residual (the 2-norm of the right-hand side b is used)</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>iter</term>
-                <listitem>
-                    <para>number of iterations performed</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>res</term>
-                <listitem>
-                    <para>vector of the residual relative norms</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
-        <title>Description</title>
-        <warning>
-            This function is obsolete.
-            It has been merged into <link linkend="conjgrad">conjgrad</link>.
-            <literal>pcg(A, b, ...) => conjgrad(A, b, "pcg", ...)</literal>.
-        </warning>
-        <para>
-            Solves the linear system <literal>Ax=b</literal> using the conjugate
-            gradient method with or without preconditioning. The preconditionning
-            should be defined by a symmetric positive definite matrix
-            <literal>M</literal>, or two matrices <literal>M1</literal> and
-            <literal>M2</literal> such that <literal>M=M1*M2</literal>. in the case
-            the function solves <literal>inv(M)*A*x = inv(M)*b</literal> for
-            <literal>x</literal>. <literal>M</literal>, <literal>M1</literal> and
-            <literal>M2</literal> can be Scilab functions with calling sequence
-            <literal>y=Milx(x)</literal> which computes the corresponding left
-            division <literal>y=Mi\x</literal>.
-        </para>
-        <para>
-            The <literal>A</literal> matrix must be a symmetric positive
-            definite matrix (full or sparse) or a function with calling sequence
-            <literal>y=Ax(x)</literal> which computes <literal>y=A*x</literal>
-        </para>
-    </refsection>
-    <refsection>
-        <title>Example with well conditionned and ill conditionned
-            problems
-        </title>
-        <para>In the following example, two linear systems are solved. The first
-            maxtrix has a condition number equal to ~0.02, which makes the algorithm
-            converge in exactly 10 iterations. Since this is the size of the matrix,
-            it is an expected behaviour for a gradient conjugate method. The second
-            one has a low condition number equal to 1.d-6, which makes the algorithm
-            converge in a larger 22 iterations. This is why the parameter maxIter is
-            set to 30. See below for other examples of the "key=value" syntax.
-        </para>
-        <programlisting role="example"><![CDATA[
-//Well conditionned problem
-A=[ 94  0   0   0    0   28  0   0   32  0
-     0   59  13  5    0   0   0   10  0   0
-     0   13  72  34   2   0   0   0   0   65
-     0   5   34  114  0   0   0   0   0   55
-     0   0   2   0    70  0   28  32  12  0
-     28  0   0   0    0   87  20  0   33  0
-     0   0   0   0    28  20  71  39  0   0
-     0   10  0   0    32  0   39  46  8   0
-     32  0   0   0    12  33  0   8   82  11
-     0   0   65  55   0   0   0   0   11  100];
-
-b=ones(10,1);
-[x, fail, err, iter, res]=pcg(A,b,1d-12,15);
-mprintf("      fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
-
-//Ill contionned one
-A=[ 894     0   0     0   0   28  0   0   1000  70000
-      0      5   13    5   0   0   0   0   0     0
-      0      13  72    34  0   0   0   0   0     6500
-      0      5   34    1   0   0   0   0   0     55
-      0      0   0     0   70  0   28  32  12    0
-      28     0   0     0   0   87  20  0   33    0
-      0      0   0     0   28  20  71  39  0     0
-      0      0   0     0   32  0   39  46  8     0
-      1000   0   0     0   12  33  0   8   82    11
-      70000  0   6500  55  0   0   0   0   11    100];
-
-[x, fail, err, iter, res]=pcg(A,b,maxIter=30,tol=1d-12);
-mprintf("      fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
- ]]></programlisting>
-    </refsection>
-    <refsection>
-        <title>Examples with A given as a sparse matrix, or function, or
-            list
-        </title>
-        <para>The following example shows that the method can handle sparse
-            matrices as well. It also shows the case where a function, computing the
-            right-hand side, is given to the "pcg" primitive. The final case shown by
-            this example, is when a list is passed to the primitive.
-        </para>
-        <programlisting role="example"><![CDATA[
-//Well conditionned problem
-A=[ 94  0   0   0    0   28  0   0   32  0
-     0   59  13  5    0   0   0   10  0   0
-     0   13  72  34   2   0   0   0   0   65
-     0   5   34  114  0   0   0   0   0   55
-     0   0   2   0    70  0   28  32  12  0
-     28  0   0   0    0   87  20  0   33  0
-     0   0   0   0    28  20  71  39  0   0
-     0   10  0   0    32  0   39  46  8   0
-     32  0   0   0    12  33  0   8   82  11
-     0   0   65  55   0   0   0   0   11  100];
-b=ones(10,1);
-
-// Convert A into a sparse matrix
-Asparse=sparse(A);
-[x, fail, err, iter, res]=pcg(Asparse,b,maxIter=30,tol=1d-12);
-mprintf("      fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
-
-// Define a function which computes the right-hand side.
-function y=Atimesx(x)
-  A=[ 94  0   0   0    0   28  0   0   32  0
-       0   59  13  5    0   0   0   10  0   0
-       0   13  72  34   2   0   0   0   0   65
-       0   5   34  114  0   0   0   0   0   55
-       0   0   2   0    70  0   28  32  12  0
-       28  0   0   0    0   87  20  0   33  0
-       0   0   0   0    28  20  71  39  0   0
-       0   10  0   0    32  0   39  46  8   0
-       32  0   0   0    12  33  0   8   82  11
-       0   0   65  55   0   0   0   0   11  100];
-  y=A*x
-endfunction
-
-// Pass the script Atimesx to the primitive
-[x, fail, err, iter, res]=pcg(Atimesx,b,maxIter=30,tol=1d-12);
-mprintf("      fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
-
-// Define a function which computes the right-hand side.
-function y=Atimesxbis(x,A)
-  y=A*x
-endfunction
-
-// Pass a list to the primitive
-Alist = list(Atimesxbis,Asparse);
-[x, fail, err, iter, res]=pcg(Alist,b,maxIter=30,tol=1d-12);
-mprintf("      fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
- ]]></programlisting>
-    </refsection>
-    <refsection>
-        <title>Examples with key=value syntax</title>
-        <para>The following example shows how to pass arguments with the
-            "key=value" syntax. This allows to set non-positionnal arguments, that is,
-            to set arguments which are not depending on their order in the list of
-            arguments. The available keys are the names of the optional arguments,
-            that is : tol, maxIter, %M, %M2, x0, verbose. Notice that, in the
-            following example, the verbose option is given before the maxIter option.
-            Without the "key=value" syntax, the positionnal arguments would require
-            that maxIter come first and verbose after.
-        </para>
-        <programlisting role="example"><![CDATA[
-// Example of an argument passed with key=value syntax
-A=[100,1;1,10];
-b=[101;11];
-[xcomputed, flag, err, iter, res]=pcg(A,b,verbose=1);
-
-// With key=value syntax, the order does not matter
-[xcomputed, flag, err, iter, res]=pcg(A,b,verbose=1,maxIter=0);
- ]]></programlisting>
-    </refsection>
-    <refsection role="see also">
-        <title>See Also</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="conjgrad">conjgrad</link>
-            </member>
-            <member>
-                <link linkend="backslash">backslash</link>
-            </member>
-            <member>
-                <link linkend="qmr">qmr</link>
-            </member>
-            <member>
-                <link linkend="gmres">gmres</link>
-            </member>
-        </simplelist>
-    </refsection>
-    <refsection>
-        <title>References</title>
-        <para>"Templates for the Solution of Linear Systems: Building Blocks for
-            Iterative Methods", Barrett, Berry, Chan, Demmel, Donato, Dongarra,
-            Eijkhout, Pozo, Romine, and Van der Vorst, SIAM Publications, 1993, ftp
-            netlib2.cs.utk.edu/linalg/templates.ps
-        </para>
-        <para>"Iterative Methods for Sparse Linear Systems, Second Edition", Saad,
-            SIAM Publications, 2003, ftp
-            ftp.cs.umn.edu/dept/users/saad/PS/all_ps.zip
-        </para>
-    </refsection>
-    <refsection>
-        <title>History</title>
-        <revhistory>
-            <revision>
-                <revnumber>5.5.0</revnumber>
-                <revdescription>
-                    Calling pcg(A, b, ...) is deprecated. conjgrad(A, b, "pcg", ...) should be used instead.
-                </revdescription>
-            </revision>
-        </revhistory>
-    </refsection>
-</refentry>
diff --git a/scilab/modules/sparse/help/ja_JP/iterativesolvers/pcg.xml b/scilab/modules/sparse/help/ja_JP/iterativesolvers/pcg.xml
deleted file mode 100644 (file)
index bd8f33f..0000000
+++ /dev/null
@@ -1,583 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) XXXX-2008 - INRIA
- * 
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at    
- * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
- *
- -->
-
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="pcg" xml:lang="ja">
-    
-    <refnamediv>
-        
-        <refname>pcg</refname>
-        
-        <refpurpose>プリコンディショナ付き共役勾配法</refpurpose>
-        
-    </refnamediv>
-    
-    <refsynopsisdiv>
-        
-        <title>呼び出し手順</title>
-        
-        <synopsis>[x, flag, err, iter, res] = pcg(A, b [, tol [, maxIter [, M [, M2 [, x0 [, verbose]]]]]])
-            
-            [x, flag, err, iter, res] = pcg(A, b [key=value,...])
-            
-        </synopsis>
-        
-    </refsynopsisdiv>
-    
-    <refsection>
-        
-        <title>引数</title>
-        
-        <variablelist>
-            
-            <varlistentry>
-                
-                <term>A</term>
-                
-                <term/>
-                
-                <listitem>
-                    
-                    <para>
-                        
-                        行列, または指定した<literal>x</literal>について
-                        
-                        <literal>A*x</literal>を計算する関数またはリスト.
-                        
-                        以下にAの型に応じたA*xの計算に関する説明を示します.
-                        
-                    </para>
-                    
-                    <itemizedlist>
-                        
-                        <listitem>
-                            
-                            <para>
-                                
-                                <literal>行列.</literal>Aが行列の場合, 通常の行列
-                                
-                                または疎行列とすることができます
-                                
-                            </para>
-                            
-                        </listitem>
-                        
-                        <listitem>
-                            
-                            <para>
-                                
-                                <literal>関数.</literal>Aが関数の場合, 
-                                
-                                以下のヘッダーを有する必要があります :
-                                
-                            </para>
-                            
-                            <programlisting role=""><![CDATA[ 
-function y = A ( x )
- ]]></programlisting>
-                            
-                        </listitem>
-                        
-                        <listitem>
-                            
-                            <para>
-                                
-                                <literal>list.</literal> Aがリストの場合, 
-                                
-                                リストの最初の要素は関数で,リストのその他の
-                                
-                                要素(インデックス2から末尾まで)は関数の引数となります.
-                                
-                                関数がコールされる時,
-                                
-                                xのカレントの値は関数に最初の引数として渡されます.
-                                
-                                他の引数はリストに指定された値です.
-                                
-                            </para>
-                            
-                        </listitem>
-                        
-                    </itemizedlist>
-                    
-                </listitem>
-                
-            </varlistentry>
-            
-            <varlistentry>
-                
-                <term>b</term>
-                
-                <listitem>
-                    
-                    <para>右辺ベクトルr (大きさ: nx1)</para>
-                    
-                </listitem>
-                
-            </varlistentry>
-            
-            <varlistentry>
-                
-                <term>tol</term>
-                
-                <listitem>
-                    
-                    <para>相対許容誤差 (デフォルト: 1e-8). 
-                        
-                        終了条件は残差r=b-Axの2次ノルムを
-                        
-                        右辺bの2次ノルムで割った値に基づきます.
-                        
-                    </para>
-                    
-                </listitem>
-                
-            </varlistentry>
-            
-            <varlistentry>
-                
-                <term>maxIter</term>
-                
-                <listitem>
-                    
-                    <para>反復最大回数 (デフォルト: n)</para>
-                    
-                </listitem>
-                
-            </varlistentry>
-            
-            <varlistentry>
-                
-                <term>M</term>
-                
-                <listitem>
-                    
-                    <para>プリコンディショナ: 通常の行列または疎行列または
-                        
-                        <literal>M\x</literal>を返す関数 (デフォルト: none)
-                        
-                    </para>
-                    
-                </listitem>
-                
-            </varlistentry>
-            
-            <varlistentry>
-                
-                <term>M2</term>
-                
-                <listitem>
-                    
-                    <para>プリコンディショナ: 通常の行列または疎行列または
-                        
-                        <literal>x</literal>について<literal>M2\x</literal>を返す関数 (デフォルト:
-                        
-                        none)
-                        
-                    </para>
-                    
-                </listitem>
-                
-            </varlistentry>
-            
-            <varlistentry>
-                
-                <term>x0</term>
-                
-                <listitem>
-                    
-                    <para>初期推定ベクトル (デフォルト: zeros(n,1))</para>
-                    
-                </listitem>
-                
-            </varlistentry>
-            
-            <varlistentry>
-                
-                <term>verbose</term>
-                
-                <listitem>
-                    
-                    <para>冗長なログを有効にする場合は1に設定(デフォルト 0)</para>
-                    
-                </listitem>
-                
-            </varlistentry>
-            
-            <varlistentry>
-                
-                <term>x</term>
-                
-                <listitem>
-                    
-                    <para>解ベクトル</para>
-                    
-                </listitem>
-                
-            </varlistentry>
-            
-            <varlistentry>
-                
-                <term>flag</term>
-                
-                <listitem>
-                    
-                    <para>
-                        
-                        <literal>maxi</literal>回の反復回数内に
-                        
-                        <literal>pcg</literal>が指定した
-                        
-                        許容誤差に収束する場合に 0, そうでない場合に 1
-                        
-                    </para>
-                    
-                </listitem>
-                
-            </varlistentry>
-            
-            <varlistentry>
-                
-                <term>err</term>
-                
-                <listitem>
-                    
-                    <para>
-                        
-                        最終残差相対ノルム (右辺bの2次ノルムが使用されます)
-                        
-                    </para>
-                    
-                </listitem>
-                
-            </varlistentry>
-            
-            <varlistentry>
-                
-                <term>iter</term>
-                
-                <listitem>
-                    
-                    <para>実行された反復回数</para>
-                    
-                </listitem>
-                
-            </varlistentry>
-            
-            <varlistentry>
-                
-                <term>res</term>
-                
-                <listitem>
-                    
-                    <para>残差相対ノルムのベクトル</para>
-                    
-                </listitem>
-                
-            </varlistentry>
-            
-        </variablelist>
-        
-    </refsection>
-    
-    <refsection>
-        
-        <title>説明</title>
-        
-        <para>
-            
-            プリコンディショナ有りまたは無しの
-            
-            共役勾配法により線形システム<literal>Ax=b</literal>を解きます.
-            
-            プリコンディショナは,
-            
-            対称正定行列<literal>M</literal>
-            
-            または<literal>M=M1*M2</literal>となるような
-            
-            2つの行列<literal>M1</literal> および<literal>M2</literal>
-            
-            により定義されます.
-            
-            この場合,関数は<literal>inv(M)*A*x = inv(M)*b</literal>を
-            
-            <literal>x</literal>について解きます.
-            
-            <literal>M</literal>, <literal>M1</literal>および
-            
-            <literal>M2</literal> は,対応する左除算
-            
-            <literal>y=Mi\x</literal>を計算する
-            
-            呼び出し手順<literal>y=Milx(x)</literal>を有する
-            
-            Scilab関数とすることができます.
-            
-        </para>
-        
-        <para>
-            
-            <literal>A</literal>行列は対称正定行列
-            
-            (通常の行列または疎行列)または
-            
-            <literal>y=A*x</literal>を計算する
-            
-            呼び出し手順<literal>y=Ax(x)</literal>を有する関数と
-            
-            する必要があります.
-            
-        </para>
-        
-    </refsection>
-    
-    <refsection>
-        
-        <title>良好な条件または悪い条件の問題の例</title>
-        
-        <para>
-            
-            以下の例では,2つの線形システムを解きます.
-            
-            最初の行列の条件数は ~0.02 に等しくなり,
-            
-            アルゴリズムはちょうど10回の反復で収束します.
-            
-            これが行列の大きさの場合,共役勾配法で指定される動作となります.
-            
-            後者は,条件数1.d-6に等しくなり,22回の反復で収束します.
-            
-            これは,パラメータ maxIterを30に設定する理由です.
-            
-            "key=value" 構文のその他の例については以下を参照ください. 
-            
-        </para>
-        
-        <programlisting role="example"><![CDATA[ 
-//良い条件の例
-A=[ 94  0   0   0    0   28  0   0   32  0  
-     0   59  13  5    0   0   0   10  0   0  
-     0   13  72  34   2   0   0   0   0   65 
-     0   5   34  114  0   0   0   0   0   55 
-     0   0   2   0    70  0   28  32  12  0  
-     28  0   0   0    0   87  20  0   33  0  
-     0   0   0   0    28  20  71  39  0   0  
-     0   10  0   0    32  0   39  46  8   0  
-     32  0   0   0    12  33  0   8   82  11 
-     0   0   65  55   0   0   0   0   11  100];
-b=ones(10,1);
-[x, fail, err, iter, res]=pcg(A,b,1d-12,15);
-mprintf("      fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
-//悪い条件の例
-A=[ 894     0   0     0   0   28  0   0   1000  70000
-      0      5   13    5   0   0   0   0   0     0    
-      0      13  72    34  0   0   0   0   0     6500 
-      0      5   34    1   0   0   0   0   0     55   
-      0      0   0     0   70  0   28  32  12    0    
-      28     0   0     0   0   87  20  0   33    0    
-      0      0   0     0   28  20  71  39  0     0    
-      0      0   0     0   32  0   39  46  8     0    
-      1000   0   0     0   12  33  0   8   82    11   
-      70000  0   6500  55  0   0   0   0   11    100];
-[x, fail, err, iter, res]=pcg(A,b,maxIter=30,tol=1d-12);
-mprintf("      fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
- ]]></programlisting>
-        
-    </refsection>
-    
-    <refsection>
-        
-        <title>Aを疎行列または関数またはリストとして指定する例</title>
-        
-        <para>以下の例では,疎行列を同時に処理する方法を示します.
-            
-            右辺を計算する関数が "pcg" プリミティブに指定される
-            
-            場合も示します.
-            
-            この例における最後のケースでは,
-            
-            リストがプリミティブに指定される場合です.
-            
-        </para>
-        
-        <programlisting role="example"><![CDATA[ 
-//良い条件の例
-A=[ 94  0   0   0    0   28  0   0   32  0  
-     0   59  13  5    0   0   0   10  0   0  
-     0   13  72  34   2   0   0   0   0   65 
-     0   5   34  114  0   0   0   0   0   55 
-     0   0   2   0    70  0   28  32  12  0  
-     28  0   0   0    0   87  20  0   33  0  
-     0   0   0   0    28  20  71  39  0   0  
-     0   10  0   0    32  0   39  46  8   0  
-     32  0   0   0    12  33  0   8   82  11 
-     0   0   65  55   0   0   0   0   11  100];
-b=ones(10,1);
-// Aを疎行列に変換
-Asparse=sparse(A);
-[x, fail, err, iter, res]=pcg(Asparse,b,maxIter=30,tol=1d-12);
-mprintf("      fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
-// 右辺を計算する関数を定義.
-function y=Atimesx(x)
-  A=[ 94  0   0   0    0   28  0   0   32  0  
-       0   59  13  5    0   0   0   10  0   0  
-       0   13  72  34   2   0   0   0   0   65
-       0   5   34  114  0   0   0   0   0   55
-       0   0   2   0    70  0   28  32  12  0
-       28  0   0   0    0   87  20  0   33  0
-       0   0   0   0    28  20  71  39  0   0
-       0   10  0   0    32  0   39  46  8   0
-       32  0   0   0    12  33  0   8   82  11
-       0   0   65  55   0   0   0   0   11  100];
-  y=A*x
-endfunction
-// スクリプトAtimesx をプリミティブに指定
-[x, fail, err, iter, res]=pcg(Atimesx,b,maxIter=30,tol=1d-12);
-mprintf("      fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
-// 右辺を計算する関数を定義.
-function y=Atimesxbis(x,A)
-  y=A*x
-endfunction
-// リストをプリミティブに指定
-Alist = list(Atimesxbis,Asparse);
-[x, fail, err, iter, res]=pcg(Alist,b,maxIter=30,tol=1d-12);
-mprintf("      fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
- ]]></programlisting>
-        
-    </refsection>
-    
-    <refsection>
-        
-        <title>key=value構文の例</title>
-        
-        <para>
-            
-            以下の例では"key=value"構文により引数を指定する方法を示します.
-            
-            これにより,位置を固定せずに引数を設定できるようになり,
-            
-            引数のリストにおいてその順番に依存せずに引数を設定できます.
-            
-            利用可能なキーはオプションの引数の名前で,以下に示します:
-            
-            tol, maxIter, %M, %M2, x0, verbose. 
-            
-            以下の例では,
-            
-            maxIterオプションの前にverboseオプションを指定します.
-            
-            "key=value" 構文ではなく,
-            
-            位置を指定する引数の場合は,
-            
-            maxIterを最初にverboseを後に指定する必要があります.
-            
-        </para>
-        
-        <programlisting role="example"><![CDATA[ 
-// 引数をkey=value構文で指定する例
-A=[100,1;1,10];
-b=[101;11];
-[xcomputed, flag, err, iter, res]=pcg(A,b,verbose=1);
-// key=value構文では, 順番は関係ありません
-[xcomputed, flag, err, iter, res]=pcg(A,b,verbose=1,maxIter=0);
- ]]></programlisting>
-        
-    </refsection>
-    
-    <refsection role="see also">
-        
-        <title>参照</title>
-        
-        <simplelist type="inline">
-            
-            <member>
-                
-                <link linkend="conjgrad">conjgrad</link>
-                
-            </member>
-            
-            <member>
-                
-                <link linkend="backslash">backslash</link>
-                
-            </member>
-            
-            <member>
-                
-                <link linkend="qmr">qmr</link>
-                
-            </member>
-            
-            <member>
-                
-                <link linkend="gmres">gmres</link>
-                
-            </member>
-            
-        </simplelist>
-        
-    </refsection>
-    
-    <refsection>
-        
-        <title>参考文献</title>
-        
-        <para>"Templates for the Solution of Linear Systems: Building Blocks for
-            
-            Iterative Methods", Barrett, Berry, Chan, Demmel, Donato, Dongarra,
-            
-            Eijkhout, Pozo, Romine, and Van der Vorst, SIAM Publications, 1993, ftp
-            
-            netlib2.cs.utk.edu/linalg/templates.ps
-            
-        </para>
-        
-        <para>"Iterative Methods for Sparse Linear Systems, Second Edition", Saad,
-            
-            SIAM Publications, 2003, ftp
-            
-            ftp.cs.umn.edu/dept/users/saad/PS/all_ps.zip
-            
-        </para>
-        
-    </refsection>
-    
-    <refsection>
-        
-        <title>履歴</title>
-        
-        <revhistory>
-            
-            <revision>
-                
-                <revnumber>5.5.0</revnumber>
-                
-                <revdescription>
-                    
-                    pcg(A, b, ...) のコールは廃止されました. 
-                    
-                    代わりに conjgrad(A, b, "pcg", ...) を使用してください.
-                    
-                </revdescription>
-                
-            </revision>
-            
-        </revhistory>
-        
-    </refsection>
-    
-</refentry>
-
diff --git a/scilab/modules/sparse/macros/pcg.sci b/scilab/modules/sparse/macros/pcg.sci
deleted file mode 100644 (file)
index e08d691..0000000
+++ /dev/null
@@ -1,311 +0,0 @@
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: tagged as obsolete,
-//                                                         use conjgrad(A,b,"pcg",...) instead
-// Copyright (C) 2009 - INRIA - Michael Baudin
-// Copyright (C) 2008 - INRIA - Michael Baudin
-// Copyright (C) 2006 - INRIA - Serge Steer
-// Copyright (C) 2005 - IRISA - Sage Group
-//
-// This file must be used under the terms of the CeCILL.
-// This source file is licensed as described in the file COPYING, which
-// you should have received as part of this distribution.  The terms
-// are also available at
-// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
-
-//
-// pcg --
-//   PCG solves the symmetric positive definite linear system %Ax=b
-//   using the Preconditionned Conjugate Gradient.
-//   If M is given, it is used as a preconditionning matrix.
-//   If both M and M2 are given, the matrix M * M2 is used as a preconditionning
-//   matrix.
-//
-// input   %A       REAL symmetric positive definite matrix or a function
-//                  y=Ax(x) which computes  y=%A*x for a given x
-//         b        REAL right hand side vector
-//         tol, optional      REAL error tolerance (default: 1e-8)
-//         maxIter, optional  INTEGER maximum number of iterations (default: size(%b))
-//         %M, optional       REAL preconditioner matrix (default: none)
-//         %M2, optional      REAL preconditioner matrix (default: none)
-//         x0, optional       REAL initial guess vector (default: the zero vector)
-//         verbose, optional  INTEGER set to 1 to enable verbose logging (default : 0)
-//
-// output  x        REAL solution vector
-//         flag     INTEGER: 0 = solution found to tolerance
-//                           1 = no convergence given maxIter
-//         resNorm  REAL final relative norm of the residual
-//         iter     INTEGER number of iterations performed
-//         resVec   REAL residual vector
-//
-// References
-//
-//     "Templates for the Solution of Linear Systems: Building Blocks
-//     for Iterative Methods",
-//     Barrett, Berry, Chan, Demmel, Donato, Dongarra, Eijkhout,
-//     Pozo, Romine, and Van der Vorst, SIAM Publications, 1993
-//     (ftp netlib2.cs.utk.edu; cd linalg; get templates.ps).
-//
-//     "Iterative Methods for Sparse Linear Systems, Second Edition"
-//     Saad, SIAM Publications, 2003
-//     (ftp ftp.cs.umn.edu; cd dept/users/saad/PS; get all_ps.zip).
-//
-//     Golub and Van Loan, Matrix Computations
-//
-// Notes
-//     This script was originally a matlab > scilab translation of the cg.m
-//     script from http://www.netlib.org/templates/matlab
-//
-//     The input / output arguments of this command are the same as
-//     Matlab's pcg command.
-//
-function [x, flag, resNorm, iter, resVec] = pcg(%A, %b, tol, maxIter, %M, %M2, x0, verbose )
-    warnobsolete("conjgrad", "5.5.1");
-    [lhs,rhs] = argn(0);
-    if (rhs < 2),
-        error(msprintf(gettext("%s: Wrong number of input arguments: %d to %d expected.\n"),"pcg",2,7));
-    end
-    if (rhs > 7),
-        error(msprintf(gettext("%s: Wrong number of input arguments: %d to %d expected.\n"),"pcg",2,7));
-    end
-    if exists("tol","local")==0 then
-        tol = 1e-8
-    end
-    if exists("maxIter","local")==0 then
-        maxIter = size(%b,1)
-    end
-    if exists("%M","local")==0 then
-        %M=[]
-    end
-    if exists("%M2","local")==0 then
-        %M2=[]
-    end
-    if exists("x0","local")==0 then
-        x0=zeros(%b);
-    end
-    if exists("verbose","local")==0 then
-        verbose=0;
-    end
-    if (verbose==1) then
-        printf(gettext("Arguments:\n"));
-        printf("  tol="+string(tol)+"\n");
-        printf("  maxIter="+string(maxIter)+"\n");
-        printf("  M=\n")
-        disp(%M)
-        printf("  M2=\n");
-        disp(%M2)
-        printf("  x0=\n");
-        disp(x0)
-        printf("  verbose="+string(verbose)+"\n");
-    end
-    // Compute matrixType
-    select type(%A)
-    case 1 then
-        matrixType = 1;
-    case 5 then
-        matrixType = 1;
-    case 13 then
-        matrixType = 0;
-        Aargs=list()
-    case 15 then
-        Aargs=list(%A(2:$))
-        // Caution : modify the input argument %A !
-        %A=%A(1);
-        matrixType = 0;
-    else
-        error(msprintf(gettext("%s: Wrong type for input argument #%d.\n"),"pcg",1));
-    end
-    // If %A is a matrix (dense or sparse)
-    if (matrixType == 1),
-        if (size(%A,1) ~= size(%A,2)),
-            error(msprintf(gettext("%s: Wrong type for input argument #%d: Square matrix expected.\n"),"pcg",1));
-        end
-    end
-    // Check right hand side %b
-    if (size(%b,2) ~= 1),
-        error(msprintf(gettext("%s: Wrong type for input argument #%d: Column vector expected.\n"),"pcg",2));
-    end
-    if (matrixType ==1),
-        if (size(%b,1) ~= size(%A,1)),
-            error(msprintf(gettext("%s: Wrong size for input argument #%d: Same size as input argument #%d expected.\n"),"pcg",2,1));
-        end
-    end
-    // Check type of the error tolerance tol
-    if or(size(tol) ~= [1 1]) then
-        error(msprintf(gettext("%s: Wrong type for input argument #%d: Scalar expected.\n"),"pcg",3));
-    end
-    // Check the type of maximum number of iterations maxIter
-    if or(size(maxIter) ~= [1 1]) then
-        error(msprintf(gettext("%s: Wrong type for input argument #%d: Scalar expected.\n"),"pcg",4));
-    end
-    // Compute precondType
-    select type(%M)
-    case 1 then
-        // M is a matrix
-        // precondType = 0 if the M is empty
-        //             = 1 if the M is not empty
-        precondType = bool2s(size(%M,"*")>=1);
-    case 5 then
-        precondType = 1;
-    case 13 then
-        Margs=list()
-        precondType = 2;
-    case 15 then
-        Margs=list(%M(2:$))
-        // Caution : modify the input argument %M !
-        %M=%M(1);
-        precondType = 2;
-    else
-        error(msprintf(gettext("%s: Wrong type for input argument #%d.\n"),"pcg",5));
-    end
-    if (precondType == 1),
-        if (size(%M,1) ~= size(%M,2)),
-            error(msprintf(gettext("%s: Wrong type for input argument #%d: Square matrix expected.\n"),"pcg",5));
-        end
-        if ( size(%M,1) ~= size(%b,1) ),
-            error(msprintf(gettext("%s: Wrong size for input argument #%d: Same size as input argument #%d expected.\n"),"pcg",5,2));
-        end
-    end
-    // Compute precondBis
-    select type(%M2)
-    case 1 then
-        // M2 is a matrix
-        // precondBis = 0 if the M2 is empty
-        //            = 1 if the M2 is not empty
-        precondBis =bool2s(size(%M2,"*")>=1);
-    case 5 then
-        precondBis = 1;
-    case 13 then
-        M2args=list()
-        precondBis = 2;
-    case 15 then
-        M2args=list(%M2(2:$))
-        // Caution : modify the input argument %M2 !
-        %M2=%M2(1);
-        // Caution : modify precondType again !
-        precondType = 2;
-    else
-        error(msprintf(gettext("%s: Wrong type for input argument #%d.\n"),"pcg",6));
-    end
-    if (precondBis == 1),
-        if (size(%M2,1) ~= size(%M2,2)),
-            error(msprintf(gettext("%s: Wrong type for input argument #%d: Square matrix expected.\n"),"pcg",6));
-        end
-        if ( size(%M2,1) ~= size(%b,1) ),
-            error(msprintf(gettext("%s: Wrong size for input argument #%d: Same size as input argument #%d expected.\n"),"pcg",6,2));
-        end
-    end
-    // Check size of the initial vector x0
-    if (size(x0,2) ~= 1),
-        error(msprintf(gettext("%s: Wrong value for input argument #%d: Column vector expected.\n"),"pcg",7));
-    end
-    if (size(x0,1) ~= size(%b,1)),
-        error(msprintf(gettext("%s: Wrong size for input argument #%d: Same size as input argument #%d expected.\n"),"pcg",7,2));
-    end
-    // ------------
-    // Computations
-    // ------------
-    // initialization
-    bnrm2 = norm(%b);
-    if (verbose==1) then
-        printf(gettext("Norm of right-hand side : %s\n"), string(bnrm2));
-    end
-    if  (bnrm2 == 0) then
-        if (verbose==1) then
-            printf(gettext("Special processing where the right-hand side is zero.\n"));
-        end
-        // When rhs is 0, there is a trivial solution : x=0
-        x = zeros(%b);
-        resNorm = 0;
-        resVec = resNorm;
-    else
-        x = x0;
-        // r = %b - %A*x;
-        if (matrixType ==1),
-            r = %b - %A*x;
-        else
-            r = %b - %A(x,Aargs(:));
-        end
-        resNorm = norm(r) / bnrm2;
-        resVec = resNorm;
-    end
-    if (verbose==1) then
-        printf(gettext("  Type of preconditionning #1 : %d\n"),precondType);
-        printf(gettext("  Type of preconditionning #2 : %d\n"),precondBis);
-    end
-    // begin iteration
-    // Distinguish the number of iterations processed from the currentiter index
-    iter = 0
-    for currentiter = 1:maxIter
-        if (resNorm <= tol) then
-            if (verbose==1) then
-                printf(gettext("  New residual = %s < tol = %s => break\n"),string(resNorm),string(tol));
-            end
-            break;
-        end
-        iter = iter + 1
-        if (verbose==1) then
-            printf(gettext("  Iteration #%s/%s residual : %s\n"),string(currentiter),string(maxIter),string(resNorm));
-            printf("  x=\n");
-            disp(x);
-        end
-        if %M == [] & %M2 == [] then
-            z = r;
-        elseif %M2 == [] then
-            // Compute z so that M z = r
-            if (precondType == 1) then
-                z = %M \ r;
-            elseif (precondType == 2) then
-                z = %M(r,Margs(:));
-            else
-                z = r;
-            end
-        else
-            // Compute z so that M M2 z = r
-            if (precondBis == 1) then
-                z = %M \ r;
-                z = %M2 \ z;
-            elseif (precondBis == 2) then
-                z = %M(r,Margs(:));
-                z = %M2(z,M2args(:));
-            else
-                z = r;
-            end
-        end
-        rho = r'*z;
-        if (currentiter > 1) then
-            bet = rho / rho_old;
-            p = z + bet*p;
-        else
-            p = z;
-        end
-        // q = %A*p;
-        if (matrixType ==1),
-            q = %A*p;
-        else
-            q = %A(p);
-        end
-        alp = rho / (p'*q );
-        x = x + alp*p;
-        r = r - alp*q;
-        resNorm = norm(r) / bnrm2;
-        // Caution : transform the scalar resVec into vector resVec !
-        resVec = [resVec;resNorm];
-        rho_old = rho;
-    end
-    // test for convergence
-    if (resNorm > tol) then
-        if (verbose==1) then
-            printf(gettext("Final residual = %s > tol =%s\n"),string(resNorm),string(tol));
-            printf(gettext("Algorithm fails\n"));
-        end
-        flag = 1;
-        if (lhs < 2) then
-            warning(msprintf(gettext("%s: Convergence error.\n"),"pcg"));
-        end
-    else
-        flag = 0;
-        if (verbose==1) then
-            printf(gettext("Algorithm pass\n"));
-        end
-    end
-endfunction
diff --git a/scilab/modules/sparse/tests/nonreg_tests/bug_3310.dia.ref b/scilab/modules/sparse/tests/nonreg_tests/bug_3310.dia.ref
deleted file mode 100644 (file)
index fb1240c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2007-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- CLI SHELL MODE -->
-// <-- ENGLISH IMPOSED -->
-// <-- Non-regression test for bug 3310 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3310
-//
-// <-- Short Description -->
-// Wrong implementation of input arguments
-A=[10,1;1,10];
-// Suppose that the rhs is in myrhs instead of b
-myrhs=[11;11];
-[xcomputed, flag, err, iter, res]=pcg(A,myrhs);
-WARNING: Feature pcg is obsolete.
-         Please use conjgrad instead.
-         This feature will be permanently removed in Scilab 5.5.1
-
-xexpected=[1;1];
-assert_checkequal(xcomputed, xexpected);
diff --git a/scilab/modules/sparse/tests/nonreg_tests/bug_3310.tst b/scilab/modules/sparse/tests/nonreg_tests/bug_3310.tst
deleted file mode 100644 (file)
index 6cd7ad0..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2007-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-
-// <-- CLI SHELL MODE -->
-
-// <-- ENGLISH IMPOSED -->
-
-// <-- Non-regression test for bug 3310 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3310
-//
-// <-- Short Description -->
-// Wrong implementation of input arguments
-A=[10,1;1,10];
-// Suppose that the rhs is in myrhs instead of b
-myrhs=[11;11];
-[xcomputed, flag, err, iter, res]=pcg(A,myrhs);
-xexpected=[1;1];
-assert_checkequal(xcomputed, xexpected);
-
-