Mercurial > jwe > octave
comparison libinterp/octave-value/ov-scalar.h @ 21120:499b851fbfae
Replace pattern if/err_XXX/else/code with if/err_XXX/ code.
* schur.cc, ov-complex.h, ov-cx-mat.cc, ov-cx-sparse.cc, ov-float.h,
ov-flt-complex.h, ov-flt-cx-mat.cc, ov-flt-re-mat.cc, ov-range.cc,
ov-re-mat.cc, ov-re-sparse.cc, ov-scalar.h, ov-str-mat.cc, ops.h, pt-idx.cc,
Array.cc, CColVector.cc, CMatrix.cc, CRowVector.cc, MSparse.cc, PermMatrix.cc,
Sparse.cc, dColVector.cc, dMatrix.cc, dRowVector.cc, dSparse.cc,
fCColVector.cc, fCMatrix.cc, fCRowVector.cc, fColVector.cc, fMatrix.cc,
fRowVector.cc:
Replace pattern if/err_XXX/else/code with if/err_XXX/ code.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 20 Jan 2016 16:58:59 -0800 |
parents | e39e05d90788 |
children | 1473547f50f5 |
comparison
equal
deleted
inserted
replaced
21119:90cd0f9442d5 | 21120:499b851fbfae |
---|---|
195 | 195 |
196 bool bool_value (bool warn = false) const | 196 bool bool_value (bool warn = false) const |
197 { | 197 { |
198 if (xisnan (scalar)) | 198 if (xisnan (scalar)) |
199 err_nan_to_logical_conversion (); | 199 err_nan_to_logical_conversion (); |
200 else if (warn && scalar != 0 && scalar != 1) | 200 if (warn && scalar != 0 && scalar != 1) |
201 warn_logical_conversion (); | 201 warn_logical_conversion (); |
202 | 202 |
203 return scalar; | 203 return scalar; |
204 } | 204 } |
205 | 205 |
206 boolNDArray bool_array_value (bool warn = false) const | 206 boolNDArray bool_array_value (bool warn = false) const |
207 { | 207 { |
208 if (xisnan (scalar)) | 208 if (xisnan (scalar)) |
209 err_nan_to_logical_conversion (); | 209 err_nan_to_logical_conversion (); |
210 else if (warn && scalar != 0 && scalar != 1) | 210 if (warn && scalar != 0 && scalar != 1) |
211 warn_logical_conversion (); | 211 warn_logical_conversion (); |
212 | 212 |
213 return boolNDArray (dim_vector (1, 1), scalar); | 213 return boolNDArray (dim_vector (1, 1), scalar); |
214 } | 214 } |
215 | 215 |