Mercurial > hg > octave-lyh
annotate src/DLD-FUNCTIONS/luinc.cc @ 8286:6f2d95255911
fix @seealso references to point to existing anchors
author | Thorsten Meyer <thorsten.meyier@gmx.de> |
---|---|
date | Wed, 29 Oct 2008 17:52:54 -0400 |
parents | f3c00dc0912b |
children | eb63fbe60fab |
rev | line source |
---|---|
5282 | 1 /* |
2 | |
7017 | 3 Copyright (C) 2005, 2006, 2007 David Bateman |
5282 | 4 |
7016 | 5 This file is part of Octave. |
6 | |
5282 | 7 Octave is free software; you can redistribute it and/or modify it |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
5282 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
5282 | 20 |
21 */ | |
22 | |
23 #ifdef HAVE_CONFIG_H | |
24 #include <config.h> | |
25 #endif | |
26 | |
27 #include "defun-dld.h" | |
28 #include "error.h" | |
29 #include "gripes.h" | |
30 #include "oct-obj.h" | |
31 #include "utils.h" | |
32 #include "oct-map.h" | |
33 | |
5785 | 34 #include "MatrixType.h" |
5282 | 35 #include "SparseCmplxLU.h" |
36 #include "SparsedbleLU.h" | |
37 #include "ov-re-sparse.h" | |
38 #include "ov-cx-sparse.h" | |
39 | |
40 DEFUN_DLD (luinc, args, nargout, | |
41 "-*- texinfo -*-\n\ | |
42 @deftypefn {Loadable Function} {[@var{l}, @var{u}, @var{p}, @var{q}] =} luinc (@var{a}, '0')\n\ | |
43 @deftypefnx {Loadable Function} {[@var{l}, @var{u}, @var{p}, @var{q}] =} luinc (@var{a}, @var{droptol})\n\ | |
44 @deftypefnx {Loadable Function} {[@var{l}, @var{u}, @var{p}, @var{q}] =} luinc (@var{a}, @var{opts})\n\ | |
45 @cindex LU decomposition\n\ | |
46 Produce the incomplete LU factorization of the sparse matrix @var{a}.\n\ | |
47 Two types of incomplete factorization are possible, and the type\n\ | |
48 is determined by the second argument to @dfn{luinc}.\n\ | |
49 \n\ | |
50 Called with a second argument of '0', the zero-level incomplete\n\ | |
51 LU factorization is produced. This creates a factorization of @var{a}\n\ | |
52 where the position of the non-zero arguments correspond to the same\n\ | |
53 positions as in the matrix @var{a}.\n\ | |
54 \n\ | |
55 Alternatively, the fill-in of the incomplete LU factorization can\n\ | |
56 be controlled through the variable @var{droptol} or the structure\n\ | |
57 @var{opts}. The UMFPACK multifrontal factorization code by Tim A.\n\ | |
7001 | 58 Davis is used for the incomplete LU factorization, (availability\n\ |
5282 | 59 @url{http://www.cise.ufl.edu/research/sparse/umfpack/})\n\ |
60 \n\ | |
61 @var{droptol} determines the values below which the values in the LU\n\ | |
62 factorization are dropped and replaced by zero. It must be a positive\n\ | |
63 scalar, and any values in the factorization whose absolute value are\n\ | |
64 less than this value are dropped, expect if leaving them increase the\n\ | |
65 sparsity of the matrix. Setting @var{droptol} to zero results in a\n\ | |
66 complete LU factorization which is the default.\n\ | |
67 \n\ | |
68 @var{opts} is a structure containing one or more of the fields\n\ | |
69 \n\ | |
70 @table @code\n\ | |
71 @item droptol\n\ | |
72 The drop tolerance as above. If @var{opts} only contains @code{droptol}\n\ | |
73 then this is equivalent to using the variable @var{droptol}.\n\ | |
74 \n\ | |
75 @item milu\n\ | |
76 A logical variable flagging whether to use the modified incomplete LU\n\ | |
77 factorization. In the case that @code{milu} is true, the dropped values\n\ | |
7001 | 78 are subtracted from the diagonal of the matrix U of the factorization.\n\ |
5282 | 79 The default is @code{false}.\n\ |
80 \n\ | |
81 @item udiag\n\ | |
82 A logical variable that flags whether zero elements on the diagonal of U\n\ | |
83 should be replaced with @var{droptol} to attempt to avoid singular\n\ | |
84 factors. The default is @code{false}.\n\ | |
85 \n\ | |
86 @item thresh\n\ | |
87 Defines the pivot threshold in the interval [0,1]. Values outside that\n\ | |
88 range are ignored.\n\ | |
89 @end table\n\ | |
90 \n\ | |
91 All other fields in @var{opts} are ignored. The outputs from @dfn{luinc}\n\ | |
92 are the same as for @dfn{lu}.\n\ | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
93 \n\ |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
94 Given the string argument 'vector', @dfn{luinc} returns the values of @var{p}\n\ |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
95 @var{q} as vector values.\n\ |
8286
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7515
diff
changeset
|
96 @seealso{sparse, lu}\n\ |
5642 | 97 @end deftypefn") |
5282 | 98 { |
99 int nargin = args.length (); | |
100 octave_value_list retval; | |
101 | |
102 if (nargin == 0) | |
5823 | 103 print_usage (); |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
104 else if (nargin < 2 || nargin > 3) |
5282 | 105 error ("luinc: incorrect number of arguments"); |
106 else | |
107 { | |
108 bool zero_level = false; | |
109 bool milu = false; | |
110 bool udiag = false; | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
111 Matrix thresh; |
5282 | 112 double droptol = -1.; |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
113 bool vecout; |
5282 | 114 |
115 if (args(1).is_string ()) | |
116 { | |
117 if (args(1).string_value () == "0") | |
118 zero_level = true; | |
119 else | |
120 error ("luinc: unrecognized string argument"); | |
121 } | |
122 else if (args(1).is_map ()) | |
123 { | |
124 Octave_map map = args(1).map_value (); | |
125 | |
126 if (map.contains ("droptol")) | |
127 droptol = map.contents ("droptol")(0).double_value (); | |
128 | |
129 if (map.contains ("milu")) | |
130 { | |
131 double tmp = map.contents ("milu")(0).double_value (); | |
132 | |
133 milu = (tmp == 0. ? false : true); | |
134 } | |
135 | |
136 if (map.contains ("udiag")) | |
137 { | |
138 double tmp = map.contents ("udiag")(0).double_value (); | |
139 | |
140 udiag = (tmp == 0. ? false : true); | |
141 } | |
142 | |
143 if (map.contains ("thresh")) | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
144 { |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
145 thresh = map.contents ("thresh")(0).matrix_value (); |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
146 |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
147 if (thresh.nelem () == 1) |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
148 { |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
149 thresh.resize(1,2); |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
150 thresh(1) = thresh(0); |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
151 } |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
152 else if (thresh.nelem () != 2) |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
153 error ("chol: expecting 2 element vector for thresh"); |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
154 } |
5282 | 155 } |
156 else | |
157 droptol = args(1).double_value (); | |
158 | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
159 if (nargin == 3) |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
160 { |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
161 std::string tmp = args(2).string_value (); |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
162 |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
163 if (! error_state ) |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
164 { |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
165 if (tmp.compare ("vector") == 0) |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
166 vecout = true; |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
167 else |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
168 error ("luinc: unrecognized string argument"); |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
169 } |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
170 } |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
171 |
5775 | 172 // FIXME Add code for zero-level factorization |
5282 | 173 if (zero_level) |
174 error ("luinc: zero-level factorization not implemented"); | |
175 | |
176 if (!error_state) | |
177 { | |
5322 | 178 if (args(0).type_name () == "sparse matrix") |
5282 | 179 { |
180 SparseMatrix sm = args(0).sparse_matrix_value (); | |
5322 | 181 octave_idx_type sm_nr = sm.rows (); |
5282 | 182 octave_idx_type sm_nc = sm.cols (); |
183 ColumnVector Qinit (sm_nc); | |
184 | |
185 for (octave_idx_type i = 0; i < sm_nc; i++) | |
186 Qinit (i) = i; | |
187 | |
188 if (! error_state) | |
189 { | |
190 switch (nargout) | |
191 { | |
192 case 0: | |
193 case 1: | |
194 case 2: | |
195 { | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
196 SparseLU fact (sm, Qinit, thresh, false, true, droptol, |
5282 | 197 milu, udiag); |
198 | |
6027 | 199 if (! error_state) |
200 { | |
201 SparseMatrix P = fact.Pr (); | |
202 SparseMatrix L = P.transpose () * fact.L (); | |
203 retval(1) = octave_value (fact.U (), | |
204 MatrixType (MatrixType::Upper)); | |
205 retval(0) = octave_value (L, MatrixType | |
206 (MatrixType::Permuted_Lower, | |
207 sm_nr, fact.row_perm ())); | |
208 } | |
5282 | 209 } |
210 break; | |
211 | |
212 case 3: | |
213 { | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
214 SparseLU fact (sm, Qinit, thresh, false, true, droptol, |
5282 | 215 milu, udiag); |
216 | |
6027 | 217 if (! error_state) |
218 { | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
219 if (vecout) |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
220 retval(2) = fact.Pr_vec (); |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
221 else |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
222 retval(2) = fact.Pr (); |
6027 | 223 retval(1) = octave_value (fact.U (), |
224 MatrixType (MatrixType::Upper)); | |
225 retval(0) = octave_value (fact.L (), | |
226 MatrixType (MatrixType::Lower)); | |
227 } | |
5282 | 228 } |
229 break; | |
230 | |
231 case 4: | |
232 default: | |
233 { | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
234 SparseLU fact (sm, Qinit, thresh, false, false, droptol, |
5282 | 235 milu, udiag); |
236 | |
6027 | 237 if (! error_state) |
238 { | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
239 if (vecout) |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
240 { |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
241 retval(3) = fact.Pc_vec (); |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
242 retval(2) = fact.Pr_vec (); |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
243 } |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
244 else |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
245 { |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
246 retval(3) = fact.Pc (); |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
247 retval(2) = fact.Pr (); |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
248 } |
6027 | 249 retval(1) = octave_value (fact.U (), |
250 MatrixType (MatrixType::Upper)); | |
251 retval(0) = octave_value (fact.L (), | |
252 MatrixType (MatrixType::Lower)); | |
253 } | |
5282 | 254 } |
255 break; | |
256 } | |
257 } | |
258 } | |
5322 | 259 else if (args(0).type_name () == "sparse complex matrix") |
5282 | 260 { |
261 SparseComplexMatrix sm = | |
262 args(0).sparse_complex_matrix_value (); | |
5322 | 263 octave_idx_type sm_nr = sm.rows (); |
5282 | 264 octave_idx_type sm_nc = sm.cols (); |
265 ColumnVector Qinit (sm_nc); | |
266 | |
267 for (octave_idx_type i = 0; i < sm_nc; i++) | |
268 Qinit (i) = i; | |
269 | |
270 if (! error_state) | |
271 { | |
272 switch (nargout) | |
273 { | |
274 case 0: | |
275 case 1: | |
276 case 2: | |
277 { | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
278 SparseComplexLU fact (sm, Qinit, thresh, false, true, |
5282 | 279 droptol, milu, udiag); |
280 | |
6027 | 281 |
282 if (! error_state) | |
283 { | |
284 SparseMatrix P = fact.Pr (); | |
285 SparseComplexMatrix L = P.transpose () * fact.L (); | |
286 retval(1) = octave_value (fact.U (), | |
287 MatrixType (MatrixType::Upper)); | |
288 retval(0) = octave_value (L, MatrixType | |
289 (MatrixType::Permuted_Lower, | |
290 sm_nr, fact.row_perm ())); | |
291 } | |
5282 | 292 } |
293 break; | |
294 | |
295 case 3: | |
296 { | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
297 SparseComplexLU fact (sm, Qinit, thresh, false, true, |
5282 | 298 droptol, milu, udiag); |
299 | |
6027 | 300 if (! error_state) |
301 { | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
302 if (vecout) |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
303 retval(2) = fact.Pr_vec (); |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
304 else |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
305 retval(2) = fact.Pr (); |
6027 | 306 retval(1) = octave_value (fact.U (), |
307 MatrixType (MatrixType::Upper)); | |
308 retval(0) = octave_value (fact.L (), | |
309 MatrixType (MatrixType::Lower)); | |
310 } | |
5282 | 311 } |
312 break; | |
313 | |
314 case 4: | |
315 default: | |
316 { | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
317 SparseComplexLU fact (sm, Qinit, thresh, false, false, |
5282 | 318 droptol, milu, udiag); |
319 | |
6027 | 320 if (! error_state) |
321 { | |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
322 if (vecout) |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
323 { |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
324 retval(3) = fact.Pc_vec (); |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
325 retval(2) = fact.Pr_vec (); |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
326 } |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
327 else |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
328 { |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
329 retval(3) = fact.Pc (); |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
330 retval(2) = fact.Pr (); |
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7243
diff
changeset
|
331 } |
6027 | 332 retval(1) = octave_value (fact.U (), |
333 MatrixType (MatrixType::Upper)); | |
334 retval(0) = octave_value (fact.L (), | |
335 MatrixType (MatrixType::Lower)); | |
336 } | |
5282 | 337 } |
338 break; | |
339 } | |
340 } | |
341 } | |
342 else | |
343 error ("luinc: first argument must be sparse"); | |
344 } | |
345 } | |
346 | |
347 return retval; | |
348 } | |
349 | |
350 /* | |
5610 | 351 |
7243 | 352 %!testif HAVE_UMFPACK |
5610 | 353 %! a=sparse([1,2,0,0;0,1,2,0;1e-14,0,3,0;0,0,0,1]); |
354 %! [l,u]=luinc(a,1e-10); | |
355 %! assert(l*u, sparse([1,2,0,0;0,1,2,0;0,0,3,0;0,0,0,1]),1e-10); | |
356 %! opts.droptol=1e-10; | |
357 %! [l,u]=luinc(a,opts); | |
358 %! assert(l*u, sparse([1,2,0,0;0,1,2,0;0,0,3,0;0,0,0,1]),1e-10); | |
359 | |
7243 | 360 %!testif HAVE_UMFPACK |
5610 | 361 %! a=sparse([1i,2,0,0;0,1,2,0;1e-14,0,3,0;0,0,0,1]); |
362 %! [l,u]=luinc(a,1e-10); | |
363 %! assert(l*u, sparse([1i,2,0,0;0,1,2,0;0,0,3,0;0,0,0,1]),1e-10); | |
364 %! opts.droptol=1e-10; | |
365 %! [l,u]=luinc(a,opts); | |
366 %! assert(l*u, sparse([1i,2,0,0;0,1,2,0;0,0,3,0;0,0,0,1]),1e-10); | |
367 | |
368 */ | |
369 | |
370 /* | |
5282 | 371 ;;; Local Variables: *** |
372 ;;; mode: C++ *** | |
373 ;;; End: *** | |
374 */ |