Mercurial > octave-nkf
comparison libinterp/octave-value/ov-base-sparse.cc @ 20587:f90c8372b7ba
eliminate many more simple uses of error_state
* Cell.cc, __ichol__.cc, __ilu__.cc, balance.cc, bsxfun.cc, colloc.cc,
det.cc, dlmread.cc, dynamic-ld.cc, eig.cc, fft.cc, fft2.cc, fftn.cc,
gcd.cc, getgrent.cc, getpwent.cc, givens.cc, hess.cc, input.cc,
levenshtein.cc, load-path.cc, lookup.cc, ls-mat-ascii.cc, ls-mat4.cc,
lsode.cc, lu.cc, max.cc, md5sum.cc, mex.cc, pager.cc, pinv.cc,
pr-output.cc, qz.cc, schur.cc, sparse.cc, sqrtm.cc, str2double.cc,
strfns.cc, sub2ind.cc, sysdep.cc, time.cc, toplev.cc, tril.cc,
tsearch.cc, typecast.cc, __init_gnuplot__.cc, __magick_read__.cc,
__osmesa_print__.cc, amd.cc, audiodevinfo.cc, dmperm.cc, fftw.cc,
symrcm.cc, ov-base-diag.cc, ov-base-sparse.cc, ov-base.cc,
ov-bool-sparse.cc, ov-builtin.cc, ov-complex.cc, ov-cx-diag.cc,
ov-cx-mat.cc, ov-cx-sparse.cc, ov-fcn-handle.cc, ov-fcn-inline.cc,
ov-float.cc, ov-flt-complex.cc, ov-flt-cx-diag.cc, ov-flt-cx-mat.cc,
ov-flt-re-diag.cc, ov-flt-re-mat.cc, ov-lazy-idx.cc, ov-mex-fcn.cc,
ov-perm.cc, ov-range.cc, ov-re-diag.cc, ov-re-mat.cc, ov-re-sparse.cc,
ov-scalar.cc, ov-str-mat.cc, op-bm-b.cc, op-bm-bm.cc, op-sbm-b.cc,
op-sbm-bm.cc, op-str-m.cc, op-str-s.cc, oct-parse.in.yy, pt-cbinop.cc,
pt-colon.cc, pt-decl.cc, pt-exp.cc, pt-id.cc, pt-misc.cc,
pt-select.cc, pt-unop.cc: Eliminate simple uses of error_state.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 05 Oct 2015 19:29:36 -0400 |
parents | dd6345fd8a97 |
children |
comparison
equal
deleted
inserted
replaced
20586:b7ac1e94266e | 20587:f90c8372b7ba |
---|---|
71 | 71 |
72 case 1: | 72 case 1: |
73 { | 73 { |
74 idx_vector i = idx (0).index_vector (); | 74 idx_vector i = idx (0).index_vector (); |
75 | 75 |
76 if (! error_state) | 76 retval = octave_value (matrix.index (i, resize_ok)); |
77 retval = octave_value (matrix.index (i, resize_ok)); | |
78 } | 77 } |
79 break; | 78 break; |
80 | 79 |
81 case 2: | 80 case 2: |
82 { | 81 { |
83 idx_vector i = idx (0).index_vector (); | 82 idx_vector i = idx (0).index_vector (); |
84 | 83 |
85 if (! error_state) | 84 k = 1; |
86 { | 85 idx_vector j = idx (1).index_vector (); |
87 k = 1; | 86 |
88 idx_vector j = idx (1).index_vector (); | 87 retval = octave_value (matrix.index (i, j, resize_ok)); |
89 | |
90 if (! error_state) | |
91 retval = octave_value (matrix.index (i, j, resize_ok)); | |
92 } | |
93 } | 88 } |
94 break; | 89 break; |
95 default: | 90 default: |
96 error ("sparse indexing needs 1 or 2 indices"); | 91 error ("sparse indexing needs 1 or 2 indices"); |
97 } | 92 } |
200 { | 195 { |
201 case 1: | 196 case 1: |
202 { | 197 { |
203 idx_vector i = idx (0).index_vector (); | 198 idx_vector i = idx (0).index_vector (); |
204 | 199 |
205 if (! error_state) | 200 matrix.assign (i, rhs); |
206 matrix.assign (i, rhs); | |
207 | 201 |
208 break; | 202 break; |
209 } | 203 } |
210 | 204 |
211 case 2: | 205 case 2: |
212 { | 206 { |
213 idx_vector i = idx (0).index_vector (); | 207 idx_vector i = idx (0).index_vector (); |
214 | 208 |
215 if (! error_state) | 209 k = 1; |
216 { | 210 idx_vector j = idx (1).index_vector (); |
217 k = 1; | 211 |
218 idx_vector j = idx (1).index_vector (); | 212 matrix.assign (i, j, rhs); |
219 | 213 |
220 if (! error_state) | |
221 matrix.assign (i, j, rhs); | |
222 } | |
223 break; | 214 break; |
224 } | 215 } |
225 | 216 |
226 default: | 217 default: |
227 error ("sparse indexing needs 1 or 2 indices"); | 218 error ("sparse indexing needs 1 or 2 indices"); |
257 { | 248 { |
258 case 1: | 249 case 1: |
259 { | 250 { |
260 idx_vector i = idx (0).index_vector (); | 251 idx_vector i = idx (0).index_vector (); |
261 | 252 |
262 if (! error_state) | 253 matrix.delete_elements (i); |
263 matrix.delete_elements (i); | |
264 | 254 |
265 break; | 255 break; |
266 } | 256 } |
267 | 257 |
268 case 2: | 258 case 2: |
269 { | 259 { |
270 idx_vector i = idx (0).index_vector (); | 260 idx_vector i = idx (0).index_vector (); |
271 | 261 |
272 if (! error_state) | 262 k = 1; |
273 { | 263 idx_vector j = idx (1).index_vector (); |
274 k = 1; | 264 |
275 idx_vector j = idx (1).index_vector (); | 265 matrix.delete_elements (i, j); |
276 | |
277 if (! error_state) | |
278 matrix.delete_elements (i, j); | |
279 } | |
280 | 266 |
281 break; | 267 break; |
282 } | 268 } |
283 | 269 |
284 default: | 270 default: |