Mercurial > octave-antonio
comparison libinterp/dldfcn/qr.cc @ 20163:075a5e2e1ba5 stable
doc: Update more docstrings to have one sentence summary as first line.
Reviewed build-aux, libinterp/dldfcn, libinterp/octave-value,
libinterp/parse-tree directories.
* build-aux/mk-opts.pl, libinterp/dldfcn/__magick_read__.cc,
libinterp/dldfcn/amd.cc, libinterp/dldfcn/audiodevinfo.cc,
libinterp/dldfcn/audioread.cc, libinterp/dldfcn/ccolamd.cc,
libinterp/dldfcn/chol.cc, libinterp/dldfcn/colamd.cc,
libinterp/dldfcn/convhulln.cc, libinterp/dldfcn/dmperm.cc,
libinterp/dldfcn/fftw.cc, libinterp/dldfcn/qr.cc, libinterp/dldfcn/symbfact.cc,
libinterp/dldfcn/symrcm.cc, libinterp/octave-value/ov-base.cc,
libinterp/octave-value/ov-bool-mat.cc, libinterp/octave-value/ov-cell.cc,
libinterp/octave-value/ov-class.cc, libinterp/octave-value/ov-fcn-handle.cc,
libinterp/octave-value/ov-fcn-inline.cc, libinterp/octave-value/ov-java.cc,
libinterp/octave-value/ov-null-mat.cc, libinterp/octave-value/ov-oncleanup.cc,
libinterp/octave-value/ov-range.cc, libinterp/octave-value/ov-struct.cc,
libinterp/octave-value/ov-typeinfo.cc, libinterp/octave-value/ov-usr-fcn.cc,
libinterp/octave-value/ov.cc, libinterp/parse-tree/lex.ll,
libinterp/parse-tree/oct-parse.in.yy, libinterp/parse-tree/pt-binop.cc,
libinterp/parse-tree/pt-eval.cc, libinterp/parse-tree/pt-mat.cc:
doc: Update more docstrings to have one sentence summary as first line.
author | Rik <rik@octave.org> |
---|---|
date | Sun, 03 May 2015 21:52:42 -0700 |
parents | 4197fc428c7d |
children |
comparison
equal
deleted
inserted
replaced
20162:2645f9ef8c88 | 20163:075a5e2e1ba5 |
---|---|
78 @deftypefnx {Loadable Function} {[@var{Q}, @var{R}, @var{P}] =} qr (@var{A}, '0')\n\ | 78 @deftypefnx {Loadable Function} {[@var{Q}, @var{R}, @var{P}] =} qr (@var{A}, '0')\n\ |
79 @deftypefnx {Loadable Function} {[@var{C}, @var{R}] =} qr (@var{A}, @var{B})\n\ | 79 @deftypefnx {Loadable Function} {[@var{C}, @var{R}] =} qr (@var{A}, @var{B})\n\ |
80 @deftypefnx {Loadable Function} {[@var{C}, @var{R}] =} qr (@var{A}, @var{B}, '0')\n\ | 80 @deftypefnx {Loadable Function} {[@var{C}, @var{R}] =} qr (@var{A}, @var{B}, '0')\n\ |
81 @cindex QR factorization\n\ | 81 @cindex QR factorization\n\ |
82 Compute the QR@tie{}factorization of @var{A}, using standard @sc{lapack}\n\ | 82 Compute the QR@tie{}factorization of @var{A}, using standard @sc{lapack}\n\ |
83 subroutines. For example, given the matrix @code{@var{A} = [1, 2; 3, 4]},\n\ | 83 subroutines.\n\ |
84 \n\ | |
85 For example, given the matrix @code{@var{A} = [1, 2; 3, 4]},\n\ | |
84 \n\ | 86 \n\ |
85 @example\n\ | 87 @example\n\ |
86 [@var{Q}, @var{R}] = qr (@var{A})\n\ | 88 [@var{Q}, @var{R}] = qr (@var{A})\n\ |
87 @end example\n\ | 89 @end example\n\ |
88 \n\ | 90 \n\ |
122 $A$\n\ | 124 $A$\n\ |
123 @end tex\n\ | 125 @end tex\n\ |
124 @ifnottex\n\ | 126 @ifnottex\n\ |
125 @var{A}\n\ | 127 @var{A}\n\ |
126 @end ifnottex\n\ | 128 @end ifnottex\n\ |
127 is a tall, thin matrix). The QR@tie{}factorization is\n\ | 129 is a tall, thin matrix). The QR@tie{}factorization is\n\ |
128 @tex\n\ | 130 @tex\n\ |
129 $QR = A$ where $Q$ is an orthogonal matrix and $R$ is upper triangular.\n\ | 131 $QR = A$ where $Q$ is an orthogonal matrix and $R$ is upper triangular.\n\ |
130 @end tex\n\ | 132 @end tex\n\ |
131 @ifnottex\n\ | 133 @ifnottex\n\ |
132 @code{@var{Q} * @var{R} = @var{A}} where @var{Q} is an orthogonal matrix and\n\ | 134 @code{@var{Q} * @var{R} = @var{A}} where @var{Q} is an orthogonal matrix and\n\ |
138 columns of @var{Q}.\n\ | 140 columns of @var{Q}.\n\ |
139 \n\ | 141 \n\ |
140 If the matrix @var{A} is full, the permuted QR@tie{}factorization\n\ | 142 If the matrix @var{A} is full, the permuted QR@tie{}factorization\n\ |
141 @code{[@var{Q}, @var{R}, @var{P}] = qr (@var{A})} forms the\n\ | 143 @code{[@var{Q}, @var{R}, @var{P}] = qr (@var{A})} forms the\n\ |
142 QR@tie{}factorization such that the diagonal entries of @var{R} are\n\ | 144 QR@tie{}factorization such that the diagonal entries of @var{R} are\n\ |
143 decreasing in magnitude order. For example, given the matrix @code{a = [1,\n\ | 145 decreasing in magnitude order. For example, given the matrix\n\ |
144 2; 3, 4]},\n\ | 146 @code{a = [1, 2; 3, 4]},\n\ |
145 \n\ | 147 \n\ |
146 @example\n\ | 148 @example\n\ |
147 [@var{Q}, @var{R}, @var{P}] = qr (@var{A})\n\ | 149 [@var{Q}, @var{R}, @var{P}] = qr (@var{A})\n\ |
148 @end example\n\ | 150 @end example\n\ |
149 \n\ | 151 \n\ |
167 0 1\n\ | 169 0 1\n\ |
168 1 0\n\ | 170 1 0\n\ |
169 @end group\n\ | 171 @end group\n\ |
170 @end example\n\ | 172 @end example\n\ |
171 \n\ | 173 \n\ |
172 The permuted @code{qr} factorization @code{[@var{Q}, @var{R}, @var{P}] = qr\n\ | 174 The permuted @code{qr} factorization\n\ |
173 (@var{A})} factorization allows the construction of an orthogonal basis of\n\ | 175 @code{[@var{Q}, @var{R}, @var{P}] = qr (@var{A})} factorization allows the\n\ |
174 @code{span (A)}.\n\ | 176 construction of an orthogonal basis of @code{span (A)}.\n\ |
175 \n\ | 177 \n\ |
176 If the matrix @var{A} is sparse, then compute the sparse\n\ | 178 If the matrix @var{A} is sparse, then compute the sparse\n\ |
177 QR@tie{}factorization of @var{A}, using @sc{CSparse}. As the matrix @var{Q}\n\ | 179 QR@tie{}factorization of @var{A}, using @sc{CSparse}. As the matrix @var{Q}\n\ |
178 is in general a full matrix, this function returns the @var{Q}-less\n\ | 180 is in general a full matrix, this function returns the @var{Q}-less\n\ |
179 factorization @var{R} of @var{A}, such that @code{@var{R} = chol (@var{A}' *\n\ | 181 factorization @var{R} of @var{A}, such that\n\ |
180 @var{A})}.\n\ | 182 @code{@var{R} = chol (@var{A}' * @var{A})}.\n\ |
181 \n\ | 183 \n\ |
182 If the final argument is the scalar @code{0} and the number of rows is\n\ | 184 If the final argument is the scalar @code{0} and the number of rows is\n\ |
183 larger than the number of columns, then an economy factorization is\n\ | 185 larger than the number of columns, then an economy factorization is\n\ |
184 returned. That is @var{R} will have only @code{size (@var{A},1)} rows.\n\ | 186 returned. That is @var{R} will have only @code{size (@var{A},1)} rows.\n\ |
185 \n\ | 187 \n\ |
761 DEFUN_DLD (qrupdate, args, , | 763 DEFUN_DLD (qrupdate, args, , |
762 "-*- texinfo -*-\n\ | 764 "-*- texinfo -*-\n\ |
763 @deftypefn {Loadable Function} {[@var{Q1}, @var{R1}] =} qrupdate (@var{Q}, @var{R}, @var{u}, @var{v})\n\ | 765 @deftypefn {Loadable Function} {[@var{Q1}, @var{R1}] =} qrupdate (@var{Q}, @var{R}, @var{u}, @var{v})\n\ |
764 Given a QR@tie{}factorization of a real or complex matrix\n\ | 766 Given a QR@tie{}factorization of a real or complex matrix\n\ |
765 @w{@var{A} = @var{Q}*@var{R}}, @var{Q}@tie{}unitary and\n\ | 767 @w{@var{A} = @var{Q}*@var{R}}, @var{Q}@tie{}unitary and\n\ |
766 @var{R}@tie{}upper trapezoidal, return the QR@tie{}factorization\n\ | 768 @var{R}@tie{}upper trapezoidal, return the QR@tie{}factorization of\n\ |
767 of @w{@var{A} + @var{u}*@var{v}'}, where @var{u} and @var{v} are\n\ | 769 @w{@var{A} + @var{u}*@var{v}'}, where @var{u} and @var{v} are column vectors\n\ |
768 column vectors (rank-1 update) or matrices with equal number of columns\n\ | 770 (rank-1 update) or matrices with equal number of columns\n\ |
769 (rank-k update). Notice that the latter case is done as a sequence of rank-1\n\ | 771 (rank-k update). Notice that the latter case is done as a sequence of rank-1\n\ |
770 updates; thus, for k large enough, it will be both faster and more accurate\n\ | 772 updates; thus, for k large enough, it will be both faster and more accurate\n\ |
771 to recompute the factorization from scratch.\n\ | 773 to recompute the factorization from scratch.\n\ |
772 \n\ | 774 \n\ |
773 The QR@tie{}factorization supplied may be either full\n\ | 775 The QR@tie{}factorization supplied may be either full (Q is square) or\n\ |
774 (Q is square) or economized (R is square).\n\ | 776 economized (R is square).\n\ |
775 \n\ | 777 \n\ |
776 @seealso{qr, qrinsert, qrdelete, qrshift}\n\ | 778 @seealso{qr, qrinsert, qrdelete, qrshift}\n\ |
777 @end deftypefn") | 779 @end deftypefn") |
778 { | 780 { |
779 octave_idx_type nargin = args.length (); | 781 octave_idx_type nargin = args.length (); |
942 "-*- texinfo -*-\n\ | 944 "-*- texinfo -*-\n\ |
943 @deftypefn {Loadable Function} {[@var{Q1}, @var{R1}] =} qrinsert (@var{Q}, @var{R}, @var{j}, @var{x}, @var{orient})\n\ | 945 @deftypefn {Loadable Function} {[@var{Q1}, @var{R1}] =} qrinsert (@var{Q}, @var{R}, @var{j}, @var{x}, @var{orient})\n\ |
944 Given a QR@tie{}factorization of a real or complex matrix\n\ | 946 Given a QR@tie{}factorization of a real or complex matrix\n\ |
945 @w{@var{A} = @var{Q}*@var{R}}, @var{Q}@tie{}unitary and\n\ | 947 @w{@var{A} = @var{Q}*@var{R}}, @var{Q}@tie{}unitary and\n\ |
946 @var{R}@tie{}upper trapezoidal, return the QR@tie{}factorization of\n\ | 948 @var{R}@tie{}upper trapezoidal, return the QR@tie{}factorization of\n\ |
947 @w{[A(:,1:j-1) x A(:,j:n)]}, where @var{u} is a column vector to be\n\ | 949 @w{[A(:,1:j-1) x A(:,j:n)]}, where @var{u} is a column vector to be inserted\n\ |
948 inserted into @var{A} (if @var{orient} is @qcode{\"col\"}), or the\n\ | 950 into @var{A} (if @var{orient} is @qcode{\"col\"}), or the\n\ |
949 QR@tie{}factorization of @w{[A(1:j-1,:);x;A(:,j:n)]}, where @var{x}\n\ | 951 QR@tie{}factorization of @w{[A(1:j-1,:);x;A(:,j:n)]}, where @var{x} is a row\n\ |
950 is a row vector to be inserted into @var{A} (if @var{orient} is\n\ | 952 vector to be inserted into @var{A} (if @var{orient} is @qcode{\"row\"}).\n\ |
951 @qcode{\"row\"}).\n\ | 953 \n\ |
952 \n\ | 954 The default value of @var{orient} is @qcode{\"col\"}. If @var{orient} is\n\ |
953 The default value of @var{orient} is @qcode{\"col\"}.\n\ | 955 @qcode{\"col\"}, @var{u} may be a matrix and @var{j} an index vector\n\ |
954 If @var{orient} is @qcode{\"col\"},\n\ | |
955 @var{u} may be a matrix and @var{j} an index vector\n\ | |
956 resulting in the QR@tie{}factorization of a matrix @var{B} such that\n\ | 956 resulting in the QR@tie{}factorization of a matrix @var{B} such that\n\ |
957 @w{B(:,@var{j})} gives @var{u} and @w{B(:,@var{j}) = []} gives @var{A}.\n\ | 957 @w{B(:,@var{j})} gives @var{u} and @w{B(:,@var{j}) = []} gives @var{A}.\n\ |
958 Notice that the latter case is done as a sequence of k insertions;\n\ | 958 Notice that the latter case is done as a sequence of k insertions;\n\ |
959 thus, for k large enough, it will be both faster and more accurate to\n\ | 959 thus, for k large enough, it will be both faster and more accurate to\n\ |
960 recompute the factorization from scratch.\n\ | 960 recompute the factorization from scratch.\n\ |
961 \n\ | 961 \n\ |
962 If @var{orient} is @qcode{\"col\"},\n\ | 962 If @var{orient} is @qcode{\"col\"}, the QR@tie{}factorization supplied may\n\ |
963 the QR@tie{}factorization supplied may be either full\n\ | 963 be either full (Q is square) or economized (R is square).\n\ |
964 (Q is square) or economized (R is square).\n\ | |
965 \n\ | 964 \n\ |
966 If @var{orient} is @qcode{\"row\"}, full factorization is needed.\n\ | 965 If @var{orient} is @qcode{\"row\"}, full factorization is needed.\n\ |
967 @seealso{qr, qrupdate, qrdelete, qrshift}\n\ | 966 @seealso{qr, qrupdate, qrdelete, qrshift}\n\ |
968 @end deftypefn") | 967 @end deftypefn") |
969 { | 968 { |
1171 @w{[A(1:j-1,:);A(j+1:n,:)]}, i.e., @var{A} with one row deleted (if\n\ | 1170 @w{[A(1:j-1,:);A(j+1:n,:)]}, i.e., @var{A} with one row deleted (if\n\ |
1172 @var{orient} is @qcode{\"row\"}).\n\ | 1171 @var{orient} is @qcode{\"row\"}).\n\ |
1173 \n\ | 1172 \n\ |
1174 The default value of @var{orient} is @qcode{\"col\"}.\n\ | 1173 The default value of @var{orient} is @qcode{\"col\"}.\n\ |
1175 \n\ | 1174 \n\ |
1176 If @var{orient} is @qcode{\"col\"},\n\ | 1175 If @var{orient} is @qcode{\"col\"}, @var{j} may be an index vector\n\ |
1177 @var{j} may be an index vector\n\ | |
1178 resulting in the QR@tie{}factorization of a matrix @var{B} such that\n\ | 1176 resulting in the QR@tie{}factorization of a matrix @var{B} such that\n\ |
1179 @w{A(:,@var{j}) = []} gives @var{B}.\n\ | 1177 @w{A(:,@var{j}) = []} gives @var{B}. Notice that the latter case is done as\n\ |
1180 Notice that the latter case is done as a sequence of k deletions;\n\ | 1178 a sequence of k deletions; thus, for k large enough, it will be both faster\n\ |
1181 thus, for k large enough, it will be both faster and more accurate to\n\ | 1179 and more accurate to recompute the factorization from scratch.\n\ |
1182 recompute the factorization from scratch.\n\ | 1180 \n\ |
1183 \n\ | 1181 If @var{orient} is @qcode{\"col\"}, the QR@tie{}factorization supplied may\n\ |
1184 If @var{orient} is @qcode{\"col\"},\n\ | 1182 be either full (Q is square) or economized (R is square).\n\ |
1185 the QR@tie{}factorization supplied may be either full\n\ | |
1186 (Q is square) or economized (R is square).\n\ | |
1187 \n\ | 1183 \n\ |
1188 If @var{orient} is @qcode{\"row\"}, full factorization is needed.\n\ | 1184 If @var{orient} is @qcode{\"row\"}, full factorization is needed.\n\ |
1189 @seealso{qr, qrupdate, qrinsert, qrshift}\n\ | 1185 @seealso{qr, qrupdate, qrinsert, qrshift}\n\ |
1190 @end deftypefn") | 1186 @end deftypefn") |
1191 { | 1187 { |