comparison libinterp/corefcn/lsode.cc @ 21118:3ac9f47fb04b

Invert pattern if/code/else/err_XXX to if !/err_XXX/code. * daspk.cc, dasrt.cc, dassl.cc, data.cc, debug.cc, load-save.cc, lsode.cc, quad.cc, xnorm.cc, xpow.cc, ov-base-diag.cc, ov-base-mat.cc, ov-base-scalar.cc, ov-base.cc, ov-bool-mat.cc, ov-bool-sparse.cc, ov-cell.cc, ov-ch-mat.cc, ov-class.cc, ov-cx-mat.cc, ov-cx-sparse.cc, ov-float.cc, ov-flt-cx-mat.cc, ov-flt-re-mat.cc, ov-intx.h, ov-perm.cc, ov-range.cc, ov-re-mat.cc, ov-re-sparse.cc, ov-scalar.cc, ov-struct.cc, ov.cc, pt-idx.cc, Array-util.cc, Array.cc, Sparse.cc, lo-specfun.cc, mx-inlines.cc, oct-binmap.h: Invert pattern if/code/else/err_XXX to if !/err_XXX/code.
author Rik <rik@octave.org>
date Wed, 20 Jan 2016 16:08:30 -0800
parents e39e05d90788
children fcac5dbbf9ed
comparison
equal deleted inserted replaced
21117:c1df36373272 21118:3ac9f47fb04b
79 catch (octave_execution_exception& e) 79 catch (octave_execution_exception& e)
80 { 80 {
81 err_user_supplied_eval (e, "lsode"); 81 err_user_supplied_eval (e, "lsode");
82 } 82 }
83 83
84 if (tmp.length () > 0 && tmp(0).is_defined ()) 84 if (tmp.length () == 0 || ! tmp(0).is_defined ())
85 { 85 err_user_supplied_eval ("lsode");
86 if (! warned_fcn_imaginary && tmp(0).is_complex_type ()) 86
87 { 87 if (! warned_fcn_imaginary && tmp(0).is_complex_type ())
88 warning ("lsode: ignoring imaginary part returned from user-supplied function"); 88 {
89 warned_fcn_imaginary = true; 89 warning ("lsode: ignoring imaginary part returned from user-supplied function");
90 } 90 warned_fcn_imaginary = true;
91 91 }
92 retval = tmp(0).xvector_value ("lsode: expecting user supplied function to return numeric vector"); 92
93 93 retval = tmp(0).xvector_value ("lsode: expecting user supplied function to return numeric vector");
94 if (retval.is_empty ()) 94
95 err_user_supplied_eval ("lsode"); 95 if (retval.is_empty ())
96 }
97 else
98 err_user_supplied_eval ("lsode"); 96 err_user_supplied_eval ("lsode");
99 } 97 }
100 98
101 return retval; 99 return retval;
102 } 100 }
121 catch (octave_execution_exception& e) 119 catch (octave_execution_exception& e)
122 { 120 {
123 err_user_supplied_eval (e, "lsode"); 121 err_user_supplied_eval (e, "lsode");
124 } 122 }
125 123
126 if (tmp.length () > 0 && tmp(0).is_defined ()) 124 if (tmp.length () == 0 || ! tmp(0).is_defined ())
127 { 125 err_user_supplied_eval ("lsode");
128 if (! warned_jac_imaginary && tmp(0).is_complex_type ()) 126
129 { 127 if (! warned_jac_imaginary && tmp(0).is_complex_type ())
130 warning ("lsode: ignoring imaginary part returned from user-supplied jacobian function"); 128 {
131 warned_jac_imaginary = true; 129 warning ("lsode: ignoring imaginary part returned from user-supplied jacobian function");
132 } 130 warned_jac_imaginary = true;
133 131 }
134 retval = tmp(0).xmatrix_value ("lsode: expecting user supplied jacobian function to return numeric array"); 132
135 133 retval = tmp(0).xmatrix_value ("lsode: expecting user supplied jacobian function to return numeric array");
136 if (retval.is_empty ()) 134
137 err_user_supplied_eval ("lsode"); 135 if (retval.is_empty ())
138 }
139 else
140 err_user_supplied_eval ("lsode"); 136 err_user_supplied_eval ("lsode");
141 } 137 }
142 138
143 return retval; 139 return retval;
144 } 140 }