Mercurial > hg > octave-nkf
comparison liboctave/DASRT.cc @ 3998:f6df65db67f9
[project @ 2002-07-24 18:10:39 by jwe]
author | jwe |
---|---|
date | Wed, 24 Jul 2002 18:10:40 +0000 |
parents | d4091aff6468 |
children | 6fae69a1796e |
comparison
equal
deleted
inserted
replaced
3997:d4091aff6468 | 3998:f6df65db67f9 |
---|---|
63 const int&, double*, double*, int*); | 63 const int&, double*, double*, int*); |
64 | 64 |
65 extern "C" | 65 extern "C" |
66 int F77_FUNC (ddasrt, DASRT) (dasrt_fcn_ptr, const int&, double&, | 66 int F77_FUNC (ddasrt, DASRT) (dasrt_fcn_ptr, const int&, double&, |
67 double*, double*, const double&, int*, | 67 double*, double*, const double&, int*, |
68 double*, double*, int&, double*, | 68 const double*, const double*, int&, double*, |
69 const int&, int*, const int&, double*, | 69 const int&, int*, const int&, double*, |
70 int*, dasrt_jac_ptr, dasrt_constr_ptr, | 70 int*, dasrt_jac_ptr, dasrt_constr_ptr, |
71 const int&, int*); | 71 const int&, int*); |
72 | 72 |
73 static DAEFunc::DAERHSFunc user_fsub; | 73 static DAEFunc::DAERHSFunc user_fsub; |
263 rwork.resize (lrw); | 263 rwork.resize (lrw); |
264 | 264 |
265 abs_tol = absolute_tolerance (); | 265 abs_tol = absolute_tolerance (); |
266 rel_tol = relative_tolerance (); | 266 rel_tol = relative_tolerance (); |
267 | 267 |
268 int abs_tol_len = abs_tol.length (); | |
269 int rel_tol_len = rel_tol.length (); | |
270 | |
271 if (abs_tol_len == 1 && rel_tol_len == 1) | |
272 { | |
273 info.elem (1) = 0; | |
274 } | |
275 else if (abs_tol_len == n && rel_tol_len == n) | |
276 { | |
277 info.elem (1) = 1; | |
278 } | |
279 else | |
280 { | |
281 (*current_liboctave_error_handler) | |
282 ("dassl: inconsistent sizes for tolerance arrays"); | |
283 | |
284 integration_error = true; | |
285 return; | |
286 } | |
287 | |
268 if (initial_step_size () >= 0.0) | 288 if (initial_step_size () >= 0.0) |
269 { | 289 { |
270 rwork(2) = initial_step_size (); | 290 rwork(2) = initial_step_size (); |
271 info(7) = 1; | 291 info(7) = 1; |
272 } | 292 } |
289 else | 309 else |
290 info(6) = 0; | 310 info(6) = 0; |
291 | 311 |
292 pinfo = info.fortran_vec (); | 312 pinfo = info.fortran_vec (); |
293 piwork = iwork.fortran_vec (); | 313 piwork = iwork.fortran_vec (); |
314 pabs_tol = abs_tol.fortran_vec (); | |
315 prel_tol = rel_tol.fortran_vec (); | |
294 prwork = rwork.fortran_vec (); | 316 prwork = rwork.fortran_vec (); |
295 pjroot = jroot.fortran_vec (); | 317 pjroot = jroot.fortran_vec (); |
296 | 318 |
297 info(5) = 0; | 319 info(5) = 0; |
298 info(8) = 0; | 320 info(8) = 0; |
314 | 336 |
315 double *dummy = 0; | 337 double *dummy = 0; |
316 int *idummy = 0; | 338 int *idummy = 0; |
317 | 339 |
318 F77_XFCN (ddasrt, DASRT, (ddasrt_f, n, t, px, pxdot, tout, pinfo, | 340 F77_XFCN (ddasrt, DASRT, (ddasrt_f, n, t, px, pxdot, tout, pinfo, |
319 &rel_tol, &abs_tol, istate, prwork, lrw, | 341 prel_tol, pabs_tol, istate, prwork, lrw, |
320 piwork, liw, dummy, idummy, ddasrt_j, | 342 piwork, liw, dummy, idummy, ddasrt_j, |
321 ddasrt_g, ng, pjroot)); | 343 ddasrt_g, ng, pjroot)); |
322 | 344 |
323 if (f77_exception_encountered) | 345 if (f77_exception_encountered) |
324 { | 346 { |