Mercurial > octave-libtiff
comparison scripts/ode/ode15s.m @ 30897:260ce8667d96
maint: Revert changeset 360d330cc30e to match updated names in c9788d7f6e65.
* ode15i.m, ode15s.m: Use "havejacfcn" in options structure passed to
__ode15__.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 05 Apr 2022 08:55:38 -0700 |
parents | 360d330cc30e |
children |
comparison
equal
deleted
inserted
replaced
30896:c9788d7f6e65 | 30897:260ce8667d96 |
---|---|
214 endif | 214 endif |
215 | 215 |
216 ## Jacobian | 216 ## Jacobian |
217 options.havejac = false; | 217 options.havejac = false; |
218 options.havejacsparse = false; | 218 options.havejacsparse = false; |
219 options.havejacfun = false; | 219 options.havejacfcn = false; |
220 | 220 |
221 if (! isempty (options.Jacobian)) | 221 if (! isempty (options.Jacobian)) |
222 options.havejac = true; | 222 options.havejac = true; |
223 if (is_function_handle (options.Jacobian)) | 223 if (is_function_handle (options.Jacobian)) |
224 options.havejacfun = true; | 224 options.havejacfcn = true; |
225 if (nargin (options.Jacobian) == 2) | 225 if (nargin (options.Jacobian) == 2) |
226 A = options.Jacobian (trange(1), y0); | 226 A = options.Jacobian (trange(1), y0); |
227 if (! issquare (A) || rows (A) != n || ! isnumeric (A) || ! isreal (A)) | 227 if (! issquare (A) || rows (A) != n || ! isnumeric (A) || ! isreal (A)) |
228 error ("Octave:invalid-input-arg", | 228 error ("Octave:invalid-input-arg", |
229 'ode15s: "Jacobian" function must evaluate to a real square matrix'); | 229 'ode15s: "Jacobian" function must evaluate to a real square matrix'); |
261 options.havejacsparse = false; | 261 options.havejacsparse = false; |
262 endif | 262 endif |
263 | 263 |
264 ## If Mass or Jacobian is fcn, then new Jacobian is fcn | 264 ## If Mass or Jacobian is fcn, then new Jacobian is fcn |
265 if (options.havejac) | 265 if (options.havejac) |
266 if (options.havejacfun || options.havetimedep) | 266 if (options.havejacfcn || options.havetimedep) |
267 options.Jacobian = @ (t, y, yp) wrapjacfcn (t, y, yp, | 267 options.Jacobian = @ (t, y, yp) wrapjacfcn (t, y, yp, |
268 options.Jacobian, | 268 options.Jacobian, |
269 options.Mass, | 269 options.Mass, |
270 options.havetimedep, | 270 options.havetimedep, |
271 options.havejacfun); | 271 options.havejacfcn); |
272 options.havejacfun = true; | 272 options.havejacfcn = true; |
273 else # All matrices are constant | 273 else # All matrices are constant |
274 if (! isempty (options.Mass)) | 274 if (! isempty (options.Mass)) |
275 options.Jacobian = {[- options.Jacobian], [options.Mass]}; | 275 options.Jacobian = {[- options.Jacobian], [options.Mass]}; |
276 else | 276 else |
277 if (options.havejacsparse) | 277 if (options.havejacsparse) |