Massive indent of all codes:
[scilab.git] / scilab / modules / core / help / pt_BR / 1_keywords / backslash.xml
1         <?xml version="1.0" encoding="ISO-8859-1"?>
2     <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="backslash" xml:lang="en">
3         <refnamediv>
4             <refname>backslash</refname>
5             <refpurpose>(\) divisão matricial direita-esquerda</refpurpose>
6         </refnamediv>
7         <refsynopsisdiv>
8             <title>Seqüência de Chamamento</title>
9             <synopsis>x=A\b</synopsis>
10         </refsynopsisdiv>
11         <refsection>
12             <title>Descrição</title>
13             <para>(\) denota a divisão matricial direita-esquerda.
14                 <literal>x=A\b</literal> é a solução para <literal>A*x=b</literal>.
15             </para>
16             <para>
17                 Se <literal>A</literal> é quadrada e não-singular,
18                 <literal>x=A\b</literal> (unicamente definida) é equivalente a
19                 <literal>x=inv(A)*b</literal> (mas as computações são menos custosas).
20             </para>
21             <para>
22                 Se <literal>A</literal> não é quadrada, <literal>x</literal> é uma
23                 solução de mínimo quadrado, i.e., <literal>norm(A*x-b)</literal> é mínima
24                 (norma euclidiana). Se <literal>A</literal> é de posto coluna cheio, a
25                 solução de mínimo quadrado, <literal>x=A\b</literal> , é unicamente
26                 definida (há um único <literal>x</literal> que minimiza
27                 <literal>norm(A*x-b)</literal>). Se <literal>A</literal>não é de posto
28                 coluna cheio, então a solução de mínimo quadrado não é única e
29                 <literal>x=A\b</literal> , em geral, não é a solução com norma mínima (a
30                 solução com norma mínima é <literal>x=pinv(A)*b</literal>).
31             </para>
32             <para>
33                 <literal>A.\B</literal> é a matriz com entrada
34                 <literal>(i,j)</literal> igual a <literal>A(i,j)\B(i,j)</literal>. Se
35                 <literal>A</literal> (ou <literal>B</literal>é um escalar,
36                 <literal>A.\B</literal> é equivalente a <literal>A*ones(B).\B</literal>
37                 (ou <literal>A.\(B*ones(A))</literal>
38             </para>
39             <para>
40                 <literal>A\.B</literal> é um operador sem significado predefinido.
41                 Pode ser usado para definir um novo operador (ver overloading) com a mesma
42                 precedência que * ou /. 
43             </para>
44         </refsection>
45         <refsection>
46             <title>Exemplos</title>
47             <programlisting role="example"><![CDATA[ 
48 A=rand(3,2);b=[1;1;1]; x=A\b; y=pinv(A)*b;  x-y
49 A=rand(2,3);b=[1;1]; x=A\b; y=pinv(A)*b; x-y, A*x-b, A*y-b
50 A=rand(3,1)*rand(1,2); b=[1;1;1]; x=A\b; y=pinv(A)*b; A*x-b, A*y-b
51 A=rand(2,1)*rand(1,3); b=[1;1]; x=A\b; y=pinv(A)*b; A*x-b, A*y-b 
52
53 // A benchmark of several linear solvers
54
55 [A,descr,ref,mtype] = ReadHBSparse(SCI+"/modules/umfpack/examples/bcsstk24.rsa"); 
56
57 b = zeros(size(A,1),1);
58
59 tic();
60 res = umfpack(A,'\',b);
61 mprintf('\ntime needed to solve the system with umfpack: %.3f\n',toc());
62
63 tic();
64 res = linsolve(A,b);
65 mprintf('\ntime needed to solve the system with linsolve: %.3f\n',toc());
66
67 tic();
68 res = A\b;
69 mprintf('\ntime needed to solve the system with the backslash operator: %.3f\n',toc());
70  ]]></programlisting>
71         </refsection>
72         <refsection>
73             <title>Ver Também </title>
74             <simplelist type="inline">
75                 <member>
76                     <link linkend="slash">slash</link>
77                 </member>
78                 <member>
79                     <link linkend="inv">inv</link>
80                 </member>
81                 <member>
82                     <link linkend="pinv">pinv</link>
83                 </member>
84                 <member>
85                     <link linkend="percent">percent</link>
86                 </member>
87                 <member>
88                     <link linkend="ieee">ieee</link>
89                 </member>
90                 <member>
91                     <link linkend="linsolve">linsolve</link>
92                 </member>
93                 <member>
94                     <link linkend="umfpack">umfpack</link>
95                 </member>
96             </simplelist>
97         </refsection>
98     </refentry>