<?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
 *
 * 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="en" xml:id="fullrf">
    <refnamediv>
        <refname>fullrf</refname>
        <refpurpose>full rank factorization</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>[Q,M,rk]=fullrf(A,[tol])</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>A</term>
                <listitem>
                    <para>real or complex matrix</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>tol</term>
                <listitem>
                    <para>real number (threshold for rank determination)</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>Q,M</term>
                <listitem>
                    <para>real or complex matrix</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>rk</term>
                <listitem>
                    <para>
                        integer (rank of <literal>A</literal>)
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            Full rank factorization : <literal>fullrf</literal> returns <literal>Q</literal> and <literal>M</literal> such
            that <literal>A = Q*M</literal>
            with range(<literal>Q</literal>)=range(<literal>A</literal>) and ker(<literal>M</literal>)=ker(<literal>A</literal>),
            <literal>Q</literal> full column rank , <literal>M</literal> full row rank,
            <literal>rk = rank(A) = #columns(Q) = #rows(M)</literal>.
        </para>
        <para>
            <literal>tol</literal> is an optional real parameter (default value is <literal>sqrt(%eps)</literal>).
            The rank <literal>rk</literal> of <literal>A</literal> is defined as the number of singular values
            larger than <literal>norm(A)*tol</literal>.
        </para>
        <para>
            If A is symmetric, <literal>fullrf</literal> returns <literal>M=Q'</literal>.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
A=rand(5,2)*rand(2,5);
[Q,M]=fullrf(A);
norm(Q*M-A,1)
[X,d]=rowcomp(A);Y=X';
svd([A,Y(:,1:d),Q])        //span(Q) = span(A) = span(Y(:,1:2))
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="svd">svd</link>
            </member>
            <member>
                <link linkend="qr">qr</link>
            </member>
            <member>
                <link linkend="fullrfk">fullrfk</link>
            </member>
            <member>
                <link linkend="rowcomp">rowcomp</link>
            </member>
            <member>
                <link linkend="colcomp">colcomp</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
