<?xml version="1.0" encoding="UTF-8"?>

<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2008 - INRIA
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * 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="svd">

    <refnamediv>

        <refname>svd</refname>

        <refpurpose>特異値分解</refpurpose>

    </refnamediv>

    <refsynopsisdiv>

        <title>呼び出し手順</title>

        <synopsis>s=svd(X)

            [U,S,V]=svd(X)

            [U,S,V]=svd(X,"e")

            [U,S,V,rk]=svd(X [,tol])

        </synopsis>

    </refsynopsisdiv>

    <refsection>

        <title>引数</title>

        <variablelist>

            <varlistentry>

                <term>X</term>

                <listitem>

                    <para>実数または複素行列</para>

                </listitem>

            </varlistentry>

            <varlistentry>

                <term>s</term>

                <listitem>

                    <para>実数ベクトル (特異値)</para>

                </listitem>

            </varlistentry>

            <varlistentry>

                <term>S</term>

                <listitem>

                    <para>実数対角行列 (特異値)</para>

                </listitem>

            </varlistentry>

            <varlistentry>

                <term>U,V</term>

                <listitem>

                    <para>直交またはユニタリ正方行列(特異値).</para>

                </listitem>

            </varlistentry>

            <varlistentry>

                <term>tol</term>

                <listitem>

                    <para>実数</para>

                </listitem>

            </varlistentry>

        </variablelist>

    </refsection>

    <refsection>

        <title>説明</title>

        <para>

            <literal>[U,S,V] = svd(X)</literal> は

            <literal>X</literal> と同次元で

            降順に非負の対角要素を有する

            対角行列 <literal>S</literal>および

            <literal>X = U*S*V'</literal>となる

            ユニタリ行列 <literal>U</literal> と <literal>V</literal>

            を出力します.

        </para>

        <para>

            <literal>[U,S,V] = svd(X,"e")</literal> は

            "エコノミーサイズ"分解を出力します.

            <literal>X</literal> がm行n列 (m &gt; n)の場合,

            <literal>U</literal> の最初のn列のみが計算され,

            <literal>S</literal>は n行n列となります.

        </para>

        <para>

            <literal>s= svd(X)</literal> は

            特異値を含むベクトル<literal>s</literal>を返します.

        </para>

        <para>

            <literal>[U,S,V,rk]=svd(X,tol)</literal> は

            <literal>rk</literal>に加えて,

            <literal>X</literal> の数値ランク,すなわち

            <literal>tol</literal>より大きな特異値の数を出力します.

        </para>

        <para>

            <literal>tol</literal>のデフォルト値は

            <literal>rank</literal>と同じです.

        </para>

    </refsection>

    <refsection>

        <title>例</title>

        <programlisting role="example"><![CDATA[
X=rand(4,2)*rand(2,4)
svd(X)
sqrt(spec(X*X'))
 ]]></programlisting>

    </refsection>

    <refsection>

        <title>参考</title>

        <simplelist type="inline">

            <member>

                <link linkend="rank">rank</link>

            </member>

            <member>

                <link linkend="qr">qr</link>

            </member>

            <member>

                <link linkend="colcomp">colcomp</link>

            </member>

            <member>

                <link linkend="rowcomp">rowcomp</link>

            </member>

            <member>

                <link linkend="sva">sva</link>

            </member>

            <member>

                <link linkend="spec">spec</link>

            </member>

        </simplelist>

    </refsection>

    <refsection>

        <title>使用される関数</title>

        <para>

            svd 分解はLapackのルーチン DGESVD (実数行列の場合)および

            ZGESVD (複素数の場合)に基づいている.

        </para>

    </refsection>
    <refsection>
        <title>History</title>
        <revhistory>
            <revision>
                <revnumber>2023.0.0</revnumber>
                <revdescription>
                    <para>svd(X, 0) is obsolete, use svd(X, "e") instead.</para>
                </revdescription>
            </revision>
            <revision>
                <revnumber>2024.0.0</revnumber>
                <revdescription>
                    <para>svd(X, 0) is no more supported, use svd(X, "e") instead.</para>
                </revdescription>
            </revision>
        </revhistory>
    </refsection>
</refentry>
