comparison src/DLD-FUNCTIONS/qr.cc @ 9064:7c02ec148a3c

Check grammar on all .cc files Same check as previously done on .m files Attempt to enforce some conformity in documentation text for rules such as two spaces after a period, commas around latin abbreviations, etc.
author Rik <rdrider0-list@yahoo.com>
date Sat, 28 Mar 2009 13:57:22 -0700
parents c3b743b1b1c6
children 923c7cb7f13f
comparison
equal deleted inserted replaced
9063:a6cf0ad87eee 9064:7c02ec148a3c
98 \n\ 98 \n\
99 @noindent\n\ 99 @noindent\n\
100 returns\n\ 100 returns\n\
101 \n\ 101 \n\
102 @example\n\ 102 @example\n\
103 @group\n\
103 q =\n\ 104 q =\n\
104 \n\ 105 \n\
105 -0.31623 -0.94868\n\ 106 -0.31623 -0.94868\n\
106 -0.94868 0.31623\n\ 107 -0.94868 0.31623\n\
107 \n\ 108 \n\
108 r =\n\ 109 r =\n\
109 \n\ 110 \n\
110 -3.16228 -4.42719\n\ 111 -3.16228 -4.42719\n\
111 0.00000 -0.63246\n\ 112 0.00000 -0.63246\n\
113 @end group\n\
112 @end example\n\ 114 @end example\n\
113 \n\ 115 \n\
114 The @code{qr} factorization has applications in the solution of least\n\ 116 The @code{qr} factorization has applications in the solution of least\n\
115 squares problems\n\ 117 squares problems\n\
116 @iftex\n\ 118 @iftex\n\
162 \n\ 164 \n\
163 @noindent\n\ 165 @noindent\n\
164 returns\n\ 166 returns\n\
165 \n\ 167 \n\
166 @example\n\ 168 @example\n\
169 @group\n\
167 q = \n\ 170 q = \n\
168 \n\ 171 \n\
169 -0.44721 -0.89443\n\ 172 -0.44721 -0.89443\n\
170 -0.89443 0.44721\n\ 173 -0.89443 0.44721\n\
171 \n\ 174 \n\
176 \n\ 179 \n\
177 p =\n\ 180 p =\n\
178 \n\ 181 \n\
179 0 1\n\ 182 0 1\n\
180 1 0\n\ 183 1 0\n\
184 @end group\n\
181 @end example\n\ 185 @end example\n\
182 \n\ 186 \n\
183 The permuted @code{qr} factorization @code{[q, r, p] = qr (a)}\n\ 187 The permuted @code{qr} factorization @code{[q, r, p] = qr (a)}\n\
184 factorization allows the construction of an orthogonal basis of\n\ 188 factorization allows the construction of an orthogonal basis of\n\
185 @code{span (a)}.\n\ 189 @code{span (a)}.\n\
186 \n\ 190 \n\
187 If the matrix @var{a} is sparse, then compute the sparse QR factorization\n\ 191 If the matrix @var{a} is sparse, then compute the sparse QR factorization\n\
188 of @var{a}, using @sc{CSparse}. As the matrix @var{Q} is in general a full\n\ 192 of @var{a}, using @sc{CSparse}. As the matrix @var{Q} is in general a full\n\
189 matrix, this function returns the @var{Q}-less factorization @var{r} of\n\ 193 matrix, this function returns the @var{Q}-less factorization @var{r} of\n\
190 @var{a}, such that @code{@var{r} = chol (@var{a}' * @var{a})}.\n\ 194 @var{a}, such that @code{@var{r} = chol (@var{a}' * @var{a})}.\n\
191 \n\ 195 \n\
192 If the final argument is the scalar @code{0} and the number of rows is\n\ 196 If the final argument is the scalar @code{0} and the number of rows is\n\
193 larger than the number of columns, then an economy factorization is\n\ 197 larger than the number of columns, then an economy factorization is\n\
194 returned. That is @var{r} will have only @code{size (@var{a},1)} rows.\n\ 198 returned. That is @var{r} will have only @code{size (@var{a},1)} rows.\n\
195 \n\ 199 \n\
196 If an additional matrix @var{b} is supplied, then @code{qr} returns\n\ 200 If an additional matrix @var{b} is supplied, then @code{qr} returns\n\
197 @var{c}, where @code{@var{c} = @var{q}' * @var{b}}. This allows the\n\ 201 @var{c}, where @code{@var{c} = @var{q}' * @var{b}}. This allows the\n\
198 least squares approximation of @code{@var{a} \\ @var{b}} to be calculated\n\ 202 least squares approximation of @code{@var{a} \\ @var{b}} to be calculated\n\
199 as\n\ 203 as\n\
200 \n\ 204 \n\
201 @example\n\ 205 @example\n\
206 @group\n\
202 [@var{c},@var{r}] = spqr (@var{a},@var{b})\n\ 207 [@var{c},@var{r}] = spqr (@var{a},@var{b})\n\
203 @var{x} = @var{r} \\ @var{c}\n\ 208 @var{x} = @var{r} \\ @var{c}\n\
209 @end group\n\
204 @end example\n\ 210 @end example\n\
205 @end deftypefn") 211 @end deftypefn")
206 { 212 {
207 octave_value_list retval; 213 octave_value_list retval;
208 214
782 Given a QR@tie{}factorization of a real or complex matrix\n\ 788 Given a QR@tie{}factorization of a real or complex matrix\n\
783 @w{@var{A} = @var{Q}*@var{R}}, @var{Q}@tie{}unitary and\n\ 789 @w{@var{A} = @var{Q}*@var{R}}, @var{Q}@tie{}unitary and\n\
784 @var{R}@tie{}upper trapezoidal, return the QR@tie{}factorization\n\ 790 @var{R}@tie{}upper trapezoidal, return the QR@tie{}factorization\n\
785 of @w{@var{A} + @var{u}*@var{v}'}, where @var{u} and @var{v} are\n\ 791 of @w{@var{A} + @var{u}*@var{v}'}, where @var{u} and @var{v} are\n\
786 column vectors (rank-1 update) or matrices with equal number of columns\n\ 792 column vectors (rank-1 update) or matrices with equal number of columns\n\
787 (rank-k update). Notice that the latter case is done as a sequence of rank-1 updates;\n\ 793 (rank-k update). Notice that the latter case is done as a sequence of rank-1 updates;\n\
788 thus, for k large enough, it will be both faster and more accurate to recompute\n\ 794 thus, for k large enough, it will be both faster and more accurate to recompute\n\
789 the factorization from scratch.\n\ 795 the factorization from scratch.\n\
790 \n\ 796 \n\
791 The QR factorization supplied may be either full\n\ 797 The QR factorization supplied may be either full\n\
792 (Q is square) or economized (R is square).\n\ 798 (Q is square) or economized (R is square).\n\
1176 "-*- texinfo -*-\n\ 1182 "-*- texinfo -*-\n\
1177 @deftypefn {Loadable Function} {[@var{Q1}, @var{R1}] =} qrdelete (@var{Q}, @var{R}, @var{j}, @var{orient})\n\ 1183 @deftypefn {Loadable Function} {[@var{Q1}, @var{R1}] =} qrdelete (@var{Q}, @var{R}, @var{j}, @var{orient})\n\
1178 Given a QR@tie{}factorization of a real or complex matrix\n\ 1184 Given a QR@tie{}factorization of a real or complex matrix\n\
1179 @w{@var{A} = @var{Q}*@var{R}}, @var{Q}@tie{}unitary and\n\ 1185 @w{@var{A} = @var{Q}*@var{R}}, @var{Q}@tie{}unitary and\n\
1180 @var{R}@tie{}upper trapezoidal, return the QR@tie{}factorization of\n\ 1186 @var{R}@tie{}upper trapezoidal, return the QR@tie{}factorization of\n\
1181 @w{[A(:,1:j-1) A(:,j+1:n)]}, i.e. @var{A} with one column deleted\n\ 1187 @w{[A(:,1:j-1) A(:,j+1:n)]}, i.e., @var{A} with one column deleted\n\
1182 (if @var{orient} is \"col\"), or the QR@tie{}factorization of\n\ 1188 (if @var{orient} is \"col\"), or the QR@tie{}factorization of\n\
1183 @w{[A(1:j-1,:);A(:,j+1:n)]}, i.e. @var{A} with one row deleted (if\n\ 1189 @w{[A(1:j-1,:);A(:,j+1:n)]}, i.e., @var{A} with one row deleted (if\n\
1184 @var{orient} is \"row\").\n\ 1190 @var{orient} is \"row\").\n\
1185 \n\ 1191 \n\
1186 The default value of @var{orient} is \"col\".\n\ 1192 The default value of @var{orient} is \"col\".\n\
1187 \n\ 1193 \n\
1188 If @var{orient} is @code{\"col\"},\n\ 1194 If @var{orient} is @code{\"col\"},\n\
1429 @w{@var{A} = @var{Q}*@var{R}}, @var{Q}@tie{}unitary and\n\ 1435 @w{@var{A} = @var{Q}*@var{R}}, @var{Q}@tie{}unitary and\n\
1430 @var{R}@tie{}upper trapezoidal, return the QR@tie{}factorization\n\ 1436 @var{R}@tie{}upper trapezoidal, return the QR@tie{}factorization\n\
1431 of @w{@var{A}(:,p)}, where @w{p} is the permutation @*\n\ 1437 of @w{@var{A}(:,p)}, where @w{p} is the permutation @*\n\
1432 @code{p = [1:i-1, shift(i:j, 1), j+1:n]} if @w{@var{i} < @var{j}} @*\n\ 1438 @code{p = [1:i-1, shift(i:j, 1), j+1:n]} if @w{@var{i} < @var{j}} @*\n\
1433 or @*\n\ 1439 or @*\n\
1434 @code{p = [1:j-1, shift(j:i,-1), i+1:n]} if @w{@var{j} < @var{i}}. @*\n\ 1440 @code{p = [1:j-1, shift(j:i,-1), i+1:n]} if @w{@var{j} < @var{i}}. @*\n\
1435 \n\ 1441 \n\
1436 @seealso{qr, qrinsert, qrdelete}\n\ 1442 @seealso{qr, qrinsert, qrdelete}\n\
1437 @end deftypefn") 1443 @end deftypefn")
1438 { 1444 {
1439 octave_idx_type nargin = args.length (); 1445 octave_idx_type nargin = args.length ();