<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2008 - INRIA
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 * Copyright (C) 2019 - Samuel GOUGEON
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->
<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" xmlns:scilab="http://www.scilab.org"
          xml:lang="ja" xml:id="slash">
    <refnamediv>
        <refname>slash</refname>
        <refpurpose>(/) 右除算およびフィードバック</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>
            X = A / B        // while A = X * B
            X = A ./ B       // while A = X .* B
            X = A ./. B      // while A = X .*. B
            S = G /. K
            // on-row comment
            /* block of multilines comments */
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>説明</title>
        <para>
            右除算.  <literal>X=A/B</literal> は, <literal>X*B=A</literal> の解です.
        </para>
        <para>
            スラッシュ (右除算) とバックスラッシュ (左除算) 演算子は以下の等式で関係付けられます:
            <literal>B/A=(A'\B')'</literal>.
        </para>
        <para>
            <literal>A</literal>が正方の場合,
            <literal>X</literal> の解はLU分解または線形最小二乗ソルバにより求められます.
            <literal>A</literal>の条件数が <literal>1/(10*%eps)</literal>以下の場合(すなわち<literal>A</literal>
            の条件が良い場合), ピボット選択付きLU分解が使用されます.
            そうでない場合 (すなわち <literal>A</literal> の条件が悪い場合),
            <literal>X</literal> は<literal>A</literal>の完全直交分解により
            <literal>||A*X-B||</literal>を最小化する最小ノルム解となります
            (すなわち, <literal>X</literal>は線形最小二乗問題の解となります).
        </para>
        <para>
            <literal>A./B</literal> は要素毎の右除算, すなわち,
            エントリ<literal>A(i,j)/B(i,j)</literal>を有する行列となります.
            <literal>B</literal> がスカラー (1x1 行列)の場合,この演算は
            <literal>A./B*ones(A)</literal>と同じになります.
            <literal>A</literal>がスカラーの場合も同様です.
        </para>
        <para>
            システムフィードバック. <literal>S = G/.K</literal>は
            <literal>S = G*(eye() + K*G)^(-1)</literal> と評価されます.
            この演算子はシンプルな記述が容易に可能となります.
        </para>
        <note>
          Note that <literal>123./B</literal> is interpreted as <literal>(123)./B</literal>.
          In this case, the dot is part of the operator, not of the decimal number.
          <para/>
          In the opposite, <literal>G/.5</literal> is interpreted as <literal>G/(.5)</literal> :
          The dot here is part of the number, while it is not the case in
          <literal>G/. 5</literal>
        </note>
        <para>
            コメント <literal>//</literal> は, 特定の行をコメントにします.
            すなわち, <literal>//</literal> で始まる行はインタプリタから無視されます.
        </para>
        <para>
            It is the same with <literal>/*</literal> which start to comment a
            block of code and with <literal>*/</literal> which end to comment this block.
        </para>
    </refsection>
    <refsection>
        <title>例</title>
        <programlisting role="example"><![CDATA[
a = [3.,-24.,30.];
B = [
   9.   -36.    30.
  -36.   192.  -180.
   30.  -180.   180.
];
x = a / B
x*B-a       // ゼロに近い

a = 4 / 2;        // 2となります
a = 2 ./ [2,4];   //  [1. 0.5]
     ]]></programlisting>
        <para>
            Kronecker right division :
        </para>
        <programlisting role="example"><![CDATA[
A = [1 100 ; 10 1000], B = [1 2 4],
P = A .*. B
P ./. B
 ]]></programlisting>
    <screen><![CDATA[
--> A = [1 100 ; 10 1000], B = [1 2 4],
 A  =
   1.    100.
   10.   1000.

 B  =
   1.   2.   4.

--> P = A .*. B
 P  =
   1.    2.    4.    100.    200.    400.
   10.   20.   40.   1000.   2000.   4000.

--> P ./. B
 ans  =
   1.   100.
   10.  1000.
]]></screen>
        <para/>
        <programlisting role="example"><![CDATA[
// コメントは有用です. コードを理解しやすくします.
a = 1;  // Comment after some heading instructions
/* Even long, that is to say on many lines,
comments are useful */
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>参照</title>
        <simplelist type="inline">
            <member>
                <link linkend="inv">inv</link>
            </member>
            <member>
                <link linkend="backslash">backslash</link>
            </member>
            <member>
                <link linkend="krondivide">kron ./.</link>
            </member>
            <member>
                <link linkend="comments">comments</link>
            </member>
            <member>
                <link linkend="overloading">overloading</link>
            </member>
        </simplelist>
    </refsection>
    <refsection>
        <title>履歴</title>
        <revhistory>
            <revision>
                <revnumber>5.4.1</revnumber>
                <revremark>バックスラッシュの条件数の閾値が増加しました.</revremark>
            </revision>
            <revision>
                <revnumber>6.0.0</revnumber>
                <revremark>
                  1./B  means now 1 ./ B, no longer 1. / B
                </revremark>
            </revision>
        </revhistory>
    </refsection>
</refentry>
