<?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:ns5="http://www.w3.org/1999/xhtml"
          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
          xml:id="bdiag" xml:lang="pt">
    <refnamediv>
        <refname>bdiag</refname>
        <refpurpose>diagonalização em blocos, autovetores
            generalizados
        </refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title> Seqüência de Chamamento </title>
        <synopsis>
            [Ab, X, bs] = bdiag(A)
            [Ab, X, bs] = bdiag(A, rmax)
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Parâmetros</title>
        <variablelist>
            <varlistentry>
                <term>A</term>
                <listitem>
                    <para>matriz quadrada de reais ou complexos </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>rmax</term>
                <listitem>
                    <para>número real</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>Ab</term>
                <listitem>
                    <para>matriz quadrada de reais ou complexos</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>X</term>
                <listitem>
                    <para>matriz de reais ou complexos não-singular</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>bs</term>
                <listitem>
                    <para>vetor de inteiros</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Descrição</title>
        <para>
            <emphasis role="bold">[Ab, X, bs] = bdiag(A, rmax)</emphasis>
            realiza a diagonalização em blocos da matriz <varname>A</varname>.
            <varname>bs</varname> fornece a estrutura dos blocos (respectivos tamanhos dos blocos).
            <varname>X</varname> é a matriz mudança de base i.e <literal>Ab = inv(X)*A*X</literal>
            édiagonal em blocos.
        </para>
        <para>
            <varname>rmax</varname> controla o condicionamento de <varname>X</varname>.
            O valor padrão é a norma L1 de <varname>A</varname>.
        </para>
        <para>
            Para encontrar a forma diagonal (se existir) escolha um valor
            suficientemente grande para <varname>rmax</varname>
            (<literal>rmax=1/%eps</literal> , por exemplo). Genericamente, (para uma
            matriz A de reais aleatória) os blocos são (1x1) e (2x2) e
            <varname>X</varname> é a matriz de autovetores.
        </para>
    </refsection>
    <refsection>
        <title>Exemplos</title>
        <programlisting role="example"><![CDATA[
// No caso de reais: blocos 1x1 e 2x2
a = rand(5,5);
[ab, x, bs] = bdiag(a);ab
     ]]></programlisting>
        <screen><![CDATA[
--> [ab, x, bs] = bdiag(a);ab
 ab  =
   2.4777836   0.          0.          0.         0.
   0.          0.0757087   0.4869251   0.         0.
   0.         -0.5777956  -0.1248605   0.         0.
   0.          0.          0.          0.069654   0.
   0.          0.          0.          0.         0.5341598
]]></screen>
        <programlisting role="example"><![CDATA[
// No caso de complexos: blocos 1x1 complexos
[ab, x, bs] = bdiag(a+%i*0); ab
     ]]></programlisting>
    </refsection>
    <refsection>
        <title> Ver Também </title>
        <simplelist type="inline">
            <member>
                <link linkend="schur">schur</link>
            </member>
            <member>
                <link linkend="sylv">sylv</link>
            </member>
            <member>
                <link linkend="spec">spec</link>
            </member>
            <member>
                <link linkend="blockdiag">blockdiag</link>
            </member>
            <member>
                <link linkend="lcmdiag">lcmdiag</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
