Bump version numbers to 6.2.0
[scilab.git] / scilab / modules / core / help / pt_BR / 1_keywords / backslash.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
3           xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml"
4           xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
5           xmlns:scilab="http://www.scilab.org" xml:id="backslash" xml:lang="pt">
6     <refnamediv>
7         <refname>backslash</refname>
8         <refpurpose>(\) divisão matricial direita-esquerda: exact or least square solution</refpurpose>
9     </refnamediv>
10     <refsynopsisdiv>
11         <title>Seqüência de Chamamento</title>
12         <synopsis>X = A \ B</synopsis>
13     </refsynopsisdiv>
14     <refsection>
15         <title>Descrição</title>
16         <para>(\) denota a divisão matricial direita-esquerda.
17             <literal>x=A\b</literal> é a solução para <literal>A*x=b</literal>.
18         </para>
19         <para>
20             Se <literal>A</literal> é quadrada e não-singular,
21             <literal>x=A\b</literal> (unicamente definida) é equivalente a
22             <literal>x=inv(A)*b</literal> (mas as computações são menos custosas).
23         </para>
24         <para>
25             Se <literal>A</literal> não é quadrada, <literal>x</literal> é uma
26             solução de mínimo quadrado, i.e., <literal>norm(A*x-b)</literal> é mínima
27             (norma euclidiana). Se <literal>A</literal> é de posto coluna cheio, a
28             solução de mínimo quadrado, <literal>x=A\b</literal> , é unicamente
29             definida (há um único <literal>x</literal> que minimiza
30             <literal>norm(A*x-b)</literal>). Se <literal>A</literal>não é de posto
31             coluna cheio, então a solução de mínimo quadrado não é única e
32             <literal>x=A\b</literal> , em geral, não é a solução com norma mínima (a
33             solução com norma mínima é <literal>x=pinv(A)*b</literal>).
34         </para>
35         <para>
36             <literal>A.\B</literal> é a matriz com entrada
37             <literal>(i,j)</literal> igual a <literal>A(i,j)\B(i,j)</literal>. Se
38             <literal>A</literal> (ou <literal>B</literal>é um escalar,
39             <literal>A.\B</literal> é equivalente a <literal>A*ones(B).\B</literal>
40             (ou <literal>A.\(B*ones(A))</literal>
41         </para>
42         <para>
43             <literal>A\.B</literal> é um operador sem significado predefinido.
44             Pode ser usado para definir um novo operador (ver overloading) com a mesma
45             precedência que * ou /.
46         </para>
47     </refsection>
48     <refsection>
49         <title>Exemplos</title>
50         <programlisting role="example"><![CDATA[
51 A=rand(3,2);b=[1;1;1]; x=A\b; y=pinv(A)*b;  x-y
52 A=rand(2,3);b=[1;1]; x=A\b; y=pinv(A)*b; x-y, A*x-b, A*y-b
53 A=rand(3,1)*rand(1,2); b=[1;1;1]; x=A\b; y=pinv(A)*b; A*x-b, A*y-b
54 A=rand(2,1)*rand(1,3); b=[1;1]; x=A\b; y=pinv(A)*b; A*x-b, A*y-b
55
56 // A benchmark of several linear solvers
57
58 [A,descr,ref,mtype] = ReadHBSparse(SCI+"/modules/umfpack/demos/bcsstk24.rsa");
59
60 b = zeros(size(A,1),1);
61
62 tic();
63 res = umfpack(A,'\',b);
64 mprintf('\ntime needed to solve the system with umfpack: %.3f\n',toc());
65
66 tic();
67 res = linsolve(A,b);
68 mprintf('\ntime needed to solve the system with linsolve: %.3f\n',toc());
69
70 tic();
71 res = A\b;
72 mprintf('\ntime needed to solve the system with the backslash operator: %.3f\n',toc());
73  ]]></programlisting>
74     </refsection>
75     <refsection>
76         <title>Ver Também </title>
77         <simplelist type="inline">
78             <member>
79                 <link linkend="slash">slash</link>
80             </member>
81             <member>
82                 <link linkend="lsq">lsq</link>
83             </member>
84             <member>
85                 <link linkend="inv">inv</link>
86             </member>
87             <member>
88                 <link linkend="pinv">pinv</link>
89             </member>
90             <member>
91                 <link linkend="linsolve">linsolve</link>
92             </member>
93             <member>
94                 <link linkend="umfpack">umfpack</link>
95             </member>
96             <member>
97                 <link linkend="datafit">datafit</link>
98             </member>
99             <member>
100                 <link linkend="krondivide">kron .\.</link>
101             </member>
102             <member>
103                 <link linkend="overloading">overloading</link>
104             </member>
105         </simplelist>
106     </refsection>
107     <refsection>
108         <title>Histórico</title>
109         <revhistory>
110             <revision>
111                 <revnumber>5.5.0</revnumber>
112                 <revremark>
113                   The threshold level which switches between Gaussian Elimination with row pivoting
114                   and linear least squares when computing A\B is decreased from sqrt(eps) to eps.
115                 </revremark>
116             </revision>
117         </revhistory>
118     </refsection>
119 </refentry>