GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
DASPK.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1996-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if defined (HAVE_CONFIG_H)
27 # include "config.h"
28 #endif
29 
30 #include <cinttypes>
31 #include <sstream>
32 
33 #include "DASPK.h"
34 #include "dMatrix.h"
35 #include "f77-fcn.h"
36 #include "lo-error.h"
37 #include "quit.h"
38 
39 typedef F77_INT (*daspk_fcn_ptr) (const double&, const double*, const double*,
40  const double&, double*, F77_INT&, double*,
41  F77_INT*);
42 
43 typedef F77_INT (*daspk_jac_ptr) (const double&, const double*, const double*,
44  double*, const double&, double*, F77_INT*);
45 
46 typedef F77_INT (*daspk_psol_ptr) (const F77_INT&, const double&,
47  const double*, const double*,
48  const double*, const double&,
49  const double*, double*, F77_INT*,
50  double*, const double&, F77_INT&,
51  double*, F77_INT*);
52 
53 extern "C"
54 {
55  F77_RET_T
57  F77_DBLE*, F77_DBLE*, F77_DBLE&, const F77_INT*,
58  const F77_DBLE*, const F77_DBLE*, F77_INT&,
59  F77_DBLE*, const F77_INT&, F77_INT*,
60  const F77_INT&, const F77_DBLE*, const F77_INT*,
62 }
63 
66 static F77_INT nn;
67 
68 static F77_INT
69 ddaspk_f (const double& time, const double *state, const double *deriv,
70  const double&, double *delta, F77_INT& ires, double *, F77_INT *)
71 {
72  ColumnVector tmp_deriv (nn);
73  ColumnVector tmp_state (nn);
74  ColumnVector tmp_delta (nn);
75 
76  for (F77_INT i = 0; i < nn; i++)
77  {
78  tmp_deriv.elem (i) = deriv[i];
79  tmp_state.elem (i) = state[i];
80  }
81 
82  octave_idx_type tmp_ires = ires;
83 
84  tmp_delta = user_fun (tmp_state, tmp_deriv, time, tmp_ires);
85 
86  ires = octave::to_f77_int (tmp_ires);
87 
88  if (ires >= 0)
89  {
90  if (tmp_delta.isempty ())
91  ires = -2;
92  else
93  {
94  for (F77_INT i = 0; i < nn; i++)
95  delta[i] = tmp_delta.elem (i);
96  }
97  }
98 
99  return 0;
100 }
101 
102 //NEQ, T, Y, YPRIME, SAVR, WK, CJ, WGHT,
103 //C WP, IWP, B, EPLIN, IER, RPAR, IPAR)
104 
105 static F77_INT
106 ddaspk_psol (const F77_INT&, const double&, const double *,
107  const double *, const double *, const double&,
108  const double *, double *, F77_INT *, double *,
109  const double&, F77_INT&, double *, F77_INT*)
110 {
111  (*current_liboctave_error_handler) ("daspk: PSOL is not implemented");
112 
113  return 0;
114 }
115 
116 static F77_INT
117 ddaspk_j (const double& time, const double *state, const double *deriv,
118  double *pd, const double& cj, double *, F77_INT *)
119 {
120  // FIXME: would be nice to avoid copying the data.
121 
122  ColumnVector tmp_state (nn);
123  ColumnVector tmp_deriv (nn);
124 
125  for (F77_INT i = 0; i < nn; i++)
126  {
127  tmp_deriv.elem (i) = deriv[i];
128  tmp_state.elem (i) = state[i];
129  }
130 
131  Matrix tmp_pd = user_jac (tmp_state, tmp_deriv, time, cj);
132 
133  for (F77_INT j = 0; j < nn; j++)
134  for (F77_INT i = 0; i < nn; i++)
135  pd[nn * j + i] = tmp_pd.elem (i, j);
136 
137  return 0;
138 }
139 
141 DASPK::do_integrate (double tout)
142 {
143  // FIXME: should handle all this option stuff just once for each new problem.
144 
146 
147  if (! initialized || restart || DAEFunc::reset || DASPK_options::reset)
148  {
149  integration_error = false;
150 
151  initialized = true;
152 
153  info.resize (dim_vector (20, 1));
154 
155  for (F77_INT i = 0; i < 20; i++)
156  info(i) = 0;
157 
158  F77_INT n = octave::to_f77_int (size ());
159 
160  nn = n;
161 
162  info(0) = 0;
163 
164  if (stop_time_set)
165  {
166  rwork(0) = stop_time;
167  info(3) = 1;
168  }
169  else
170  info(3) = 0;
171 
172  // DAEFunc
173 
176 
177  if (user_fun)
178  {
179  octave_idx_type ires = 0;
180 
181  ColumnVector res = (*user_fun) (x, xdot, t, ires);
182 
183  if (res.numel () != x.numel ())
184  {
185  // FIXME: Should this be a warning?
186  (*current_liboctave_error_handler)
187  ("daspk: inconsistent sizes for state and residual vectors");
188 
189  integration_error = true;
190  return retval;
191  }
192  }
193  else
194  {
195  // FIXME: Should this be a warning?
196  (*current_liboctave_error_handler)
197  ("daspk: no user supplied RHS subroutine!");
198 
199  integration_error = true;
200  return retval;
201  }
202 
203  info(4) = (user_jac ? 1 : 0);
204 
205  DAEFunc::reset = false;
206 
207  octave_idx_type eiq = enforce_inequality_constraints ();
208  octave_idx_type ccic = compute_consistent_initial_condition ();
209  octave_idx_type eavfet = exclude_algebraic_variables_from_error_test ();
210 
211  liw = 40 + n;
212  if (eiq == 1 || eiq == 3)
213  liw += n;
214  if (ccic == 1 || eavfet == 1)
215  liw += n;
216 
217  lrw = 50 + 9*n + n*n;
218  if (eavfet == 1)
219  lrw += n;
220 
221  iwork.resize (dim_vector (liw, 1));
222  rwork.resize (dim_vector (lrw, 1));
223 
224  // DASPK_options
225 
226  abs_tol = absolute_tolerance ();
227  rel_tol = relative_tolerance ();
228 
229  F77_INT abs_tol_len = octave::to_f77_int (abs_tol.numel ());
230  F77_INT rel_tol_len = octave::to_f77_int (rel_tol.numel ());
231 
232  if (abs_tol_len == 1 && rel_tol_len == 1)
233  {
234  info(1) = 0;
235  }
236  else if (abs_tol_len == n && rel_tol_len == n)
237  {
238  info(1) = 1;
239  }
240  else
241  {
242  // FIXME: Should this be a warning?
243  (*current_liboctave_error_handler)
244  ("daspk: inconsistent sizes for tolerance arrays");
245 
246  integration_error = true;
247  return retval;
248  }
249 
250  double hmax = maximum_step_size ();
251  if (hmax >= 0.0)
252  {
253  rwork(1) = hmax;
254  info(6) = 1;
255  }
256  else
257  info(6) = 0;
258 
259  double h0 = initial_step_size ();
260  if (h0 >= 0.0)
261  {
262  rwork(2) = h0;
263  info(7) = 1;
264  }
265  else
266  info(7) = 0;
267 
268  octave_idx_type maxord = maximum_order ();
269  if (maxord >= 0)
270  {
271  if (maxord > 0 && maxord < 6)
272  {
273  info(8) = 1;
274  iwork(2) = octave::to_f77_int (maxord);
275  }
276  else
277  {
278  // FIXME: Should this be a warning?
279  (*current_liboctave_error_handler)
280  ("daspk: invalid value for maximum order");
281  integration_error = true;
282  return retval;
283  }
284  }
285 
286  switch (eiq)
287  {
288  case 1:
289  case 3:
290  {
291  Array<octave_idx_type> ict = inequality_constraint_types ();
292 
293  F77_INT ict_nel = octave::to_f77_int (ict.numel ());
294 
295  if (ict_nel == n)
296  {
297  for (F77_INT i = 0; i < n; i++)
298  {
299  F77_INT val = octave::to_f77_int (ict(i));
300  if (val < -2 || val > 2)
301  {
302  // FIXME: Should this be a warning?
303  (*current_liboctave_error_handler)
304  ("daspk: invalid value for inequality constraint type");
305  integration_error = true;
306  return retval;
307  }
308  iwork(40+i) = val;
309  }
310  }
311  else
312  {
313  // FIXME: Should this be a warning?
314  (*current_liboctave_error_handler)
315  ("daspk: inequality constraint types size mismatch");
316  integration_error = true;
317  return retval;
318  }
319  }
320  OCTAVE_FALLTHROUGH;
321 
322  case 0:
323  case 2:
324  info(9) = octave::to_f77_int (eiq);
325  break;
326 
327  default:
328  // FIXME: Should this be a warning?
329  (*current_liboctave_error_handler)
330  ("daspk: invalid value for enforce inequality constraints option");
331  integration_error = true;
332  return retval;
333  }
334 
335  if (ccic)
336  {
337  if (ccic == 1)
338  {
339  // FIXME: this code is duplicated below.
340 
341  Array<octave_idx_type> av = algebraic_variables ();
342 
343  F77_INT av_nel = octave::to_f77_int (av.numel ());
344 
345  if (av_nel == n)
346  {
347  F77_INT lid;
348  if (eiq == 0 || eiq == 2)
349  lid = 40;
350  else if (eiq == 1 || eiq == 3)
351  lid = 40 + n;
352  else
354  ("daspk: invalid value for eiq: "
355  "%" OCTAVE_IDX_TYPE_FORMAT, eiq);
356 
357  for (F77_INT i = 0; i < n; i++)
358  iwork(lid+i) = (av(i) ? -1 : 1);
359  }
360  else
361  {
362  // FIXME: Should this be a warning?
363  (*current_liboctave_error_handler)
364  ("daspk: algebraic variables size mismatch");
365  integration_error = true;
366  return retval;
367  }
368  }
369  else if (ccic != 2)
370  {
371  // FIXME: Should this be a warning?
372  (*current_liboctave_error_handler)
373  ("daspk: invalid value for compute consistent initial condition option");
374  integration_error = true;
375  return retval;
376  }
377 
378  info(10) = octave::to_f77_int (ccic);
379  }
380 
381  if (eavfet)
382  {
383  info(15) = 1;
384 
385  // FIXME: this code is duplicated above.
386 
387  Array<octave_idx_type> av = algebraic_variables ();
388 
389  F77_INT av_nel = octave::to_f77_int (av.numel ());
390 
391  if (av_nel == n)
392  {
393  F77_INT lid;
394  if (eiq == 0 || eiq == 2)
395  lid = 40;
396  else if (eiq == 1 || eiq == 3)
397  lid = 40 + n;
398  else
400  ("daspk: invalid value for eiq: %" OCTAVE_IDX_TYPE_FORMAT,
401  eiq);
402 
403  for (F77_INT i = 0; i < n; i++)
404  iwork(lid+i) = (av(i) ? -1 : 1);
405  }
406  }
407 
408  if (use_initial_condition_heuristics ())
409  {
410  Array<double> ich = initial_condition_heuristics ();
411 
412  if (ich.numel () == 6)
413  {
414  iwork(31) = octave::to_f77_int (octave::math::nint_big (ich(0)));
415  iwork(32) = octave::to_f77_int (octave::math::nint_big (ich(1)));
416  iwork(33) = octave::to_f77_int (octave::math::nint_big (ich(2)));
417  iwork(34) = octave::to_f77_int (octave::math::nint_big (ich(3)));
418 
419  rwork(13) = ich(4);
420  rwork(14) = ich(5);
421  }
422  else
423  {
424  // FIXME: Should this be a warning?
425  (*current_liboctave_error_handler)
426  ("daspk: invalid initial condition heuristics option");
427  integration_error = true;
428  return retval;
429  }
430 
431  info(16) = 1;
432  }
433 
434  octave_idx_type pici = print_initial_condition_info ();
435  switch (pici)
436  {
437  case 0:
438  case 1:
439  case 2:
440  info(17) = octave::to_f77_int (pici);
441  break;
442 
443  default:
444  // FIXME: Should this be a warning?
445  (*current_liboctave_error_handler)
446  ("daspk: invalid value for print initial condition info option");
447  integration_error = true;
448  return retval;
449  break;
450  }
451 
452  DASPK_options::reset = false;
453 
454  restart = false;
455  }
456 
457  double *px = x.fortran_vec ();
458  double *pxdot = xdot.fortran_vec ();
459 
460  F77_INT *pinfo = info.fortran_vec ();
461 
462  double *prel_tol = rel_tol.fortran_vec ();
463  double *pabs_tol = abs_tol.fortran_vec ();
464 
465  double *prwork = rwork.fortran_vec ();
466  F77_INT *piwork = iwork.fortran_vec ();
467 
468  double *dummy = nullptr;
469  F77_INT *idummy = nullptr;
470 
471  F77_INT tmp_istate = octave::to_f77_int (istate);
472 
473  F77_XFCN (ddaspk, DDASPK, (ddaspk_f, nn, t, px, pxdot, tout, pinfo,
474  prel_tol, pabs_tol, tmp_istate, prwork, lrw,
475  piwork, liw, dummy, idummy, ddaspk_j,
476  ddaspk_psol));
477 
478  istate = tmp_istate;
479 
480  switch (istate)
481  {
482  case 1: // A step was successfully taken in intermediate-output
483  // mode. The code has not yet reached TOUT.
484  case 2: // The integration to TSTOP was successfully completed
485  // (T=TSTOP) by stepping exactly to TSTOP.
486  case 3: // The integration to TOUT was successfully completed
487  // (T=TOUT) by stepping past TOUT. Y(*) is obtained by
488  // interpolation. YPRIME(*) is obtained by interpolation.
489  case 4: // The initial condition calculation, with
490  // INFO(11) > 0, was successful, and INFO(14) = 1.
491  // No integration steps were taken, and the solution
492  // is not considered to have been started.
493  retval = x;
494  t = tout;
495  break;
496 
497  case -1: // A large amount of work has been expended. (~500 steps).
498  case -2: // The error tolerances are too stringent.
499  case -3: // The local error test cannot be satisfied because you
500  // specified a zero component in ATOL and the
501  // corresponding computed solution component is zero.
502  // Thus, a pure relative error test is impossible for
503  // this component.
504  case -6: // DDASPK had repeated error test failures on the last
505  // attempted step.
506  case -7: // The corrector could not converge.
507  case -8: // The matrix of partial derivatives is singular.
508  case -9: // The corrector could not converge. There were repeated
509  // error test failures in this step.
510  case -10: // The corrector could not converge because IRES was
511  // equal to minus one.
512  case -11: // IRES equal to -2 was encountered and control is being
513  // returned to the calling program.
514  case -12: // DDASPK failed to compute the initial YPRIME.
515  case -13: // Unrecoverable error encountered inside user's
516  // PSOL routine, and control is being returned to
517  // the calling program.
518  case -14: // The Krylov linear system solver could not
519  // achieve convergence.
520  case -33: // The code has encountered trouble from which it cannot
521  // recover. A message is printed explaining the trouble
522  // and control is returned to the calling program. For
523  // example, this occurs when invalid input is detected.
524  integration_error = true;
525  break;
526 
527  default:
528  integration_error = true;
529  (*current_liboctave_error_handler)
530  ("unrecognized value of istate (= %" OCTAVE_IDX_TYPE_FORMAT ") "
531  "returned from ddaspk", istate);
532  break;
533  }
534 
535  return retval;
536 }
537 
538 Matrix
540 {
541  Matrix dummy;
542  return integrate (tout, dummy);
543 }
544 
545 Matrix
546 DASPK::integrate (const ColumnVector& tout, Matrix& xdot_out)
547 {
548  Matrix retval;
549 
550  octave_idx_type n_out = tout.numel ();
551  F77_INT n = octave::to_f77_int (size ());
552 
553  if (n_out > 0 && n > 0)
554  {
555  retval.resize (n_out, n);
556  xdot_out.resize (n_out, n);
557 
558  for (F77_INT i = 0; i < n; i++)
559  {
560  retval.elem (0, i) = x.elem (i);
561  xdot_out.elem (0, i) = xdot.elem (i);
562  }
563 
564  for (octave_idx_type j = 1; j < n_out; j++)
565  {
566  ColumnVector x_next = do_integrate (tout.elem (j));
567 
568  if (integration_error)
569  return retval;
570 
571  for (F77_INT i = 0; i < n; i++)
572  {
573  retval.elem (j, i) = x_next.elem (i);
574  xdot_out.elem (j, i) = xdot.elem (i);
575  }
576  }
577  }
578 
579  return retval;
580 }
581 
582 Matrix
583 DASPK::do_integrate (const ColumnVector& tout, const ColumnVector& tcrit)
584 {
585  Matrix dummy;
586  return integrate (tout, dummy, tcrit);
587 }
588 
589 Matrix
590 DASPK::integrate (const ColumnVector& tout, Matrix& xdot_out,
591  const ColumnVector& tcrit)
592 {
593  Matrix retval;
594 
595  octave_idx_type n_out = tout.numel ();
596  F77_INT n = octave::to_f77_int (size ());
597 
598  if (n_out > 0 && n > 0)
599  {
600  retval.resize (n_out, n);
601  xdot_out.resize (n_out, n);
602 
603  for (F77_INT i = 0; i < n; i++)
604  {
605  retval.elem (0, i) = x.elem (i);
606  xdot_out.elem (0, i) = xdot.elem (i);
607  }
608 
609  octave_idx_type n_crit = tcrit.numel ();
610 
611  if (n_crit > 0)
612  {
613  octave_idx_type i_crit = 0;
614  octave_idx_type i_out = 1;
615  double next_crit = tcrit.elem (0);
616  double next_out;
617  while (i_out < n_out)
618  {
619  bool do_restart = false;
620 
621  next_out = tout.elem (i_out);
622  if (i_crit < n_crit)
623  next_crit = tcrit.elem (i_crit);
624 
625  bool save_output;
626  double t_out;
627 
628  if (next_crit == next_out)
629  {
630  set_stop_time (next_crit);
631  t_out = next_out;
632  save_output = true;
633  i_out++;
634  i_crit++;
635  do_restart = true;
636  }
637  else if (next_crit < next_out)
638  {
639  if (i_crit < n_crit)
640  {
641  set_stop_time (next_crit);
642  t_out = next_crit;
643  save_output = false;
644  i_crit++;
645  do_restart = true;
646  }
647  else
648  {
649  clear_stop_time ();
650  t_out = next_out;
651  save_output = true;
652  i_out++;
653  }
654  }
655  else
656  {
657  set_stop_time (next_crit);
658  t_out = next_out;
659  save_output = true;
660  i_out++;
661  }
662 
663  ColumnVector x_next = do_integrate (t_out);
664 
665  if (integration_error)
666  return retval;
667 
668  if (save_output)
669  {
670  for (F77_INT i = 0; i < n; i++)
671  {
672  retval.elem (i_out-1, i) = x_next.elem (i);
673  xdot_out.elem (i_out-1, i) = xdot.elem (i);
674  }
675  }
676 
677  if (do_restart)
678  force_restart ();
679  }
680  }
681  else
682  {
683  retval = integrate (tout, xdot_out);
684 
685  if (integration_error)
686  return retval;
687  }
688  }
689 
690  return retval;
691 }
692 
693 std::string
695 {
696  std::string retval;
697 
698  std::ostringstream buf;
699  buf << t;
700  std::string t_curr = buf.str ();
701 
702  switch (istate)
703  {
704  case 1:
705  retval = "a step was successfully taken in intermediate-output mode.";
706  break;
707 
708  case 2:
709  retval = "integration completed by stepping exactly to TOUT";
710  break;
711 
712  case 3:
713  retval = "integration to tout completed by stepping past TOUT";
714  break;
715 
716  case 4:
717  retval = "initial condition calculation completed successfully";
718  break;
719 
720  case -1:
721  retval = "a large amount of work has been expended (t =" + t_curr + ')';
722  break;
723 
724  case -2:
725  retval = "the error tolerances are too stringent";
726  break;
727 
728  case -3:
729  retval = "error weight became zero during problem. (t = " + t_curr +
730  "; solution component i vanished, and atol or atol(i) == 0)";
731  break;
732 
733  case -6:
734  retval = "repeated error test failures on the last attempted step (t = "
735  + t_curr + ')';
736  break;
737 
738  case -7:
739  retval = "the corrector could not converge (t = " + t_curr + ')';
740  break;
741 
742  case -8:
743  retval = "the matrix of partial derivatives is singular (t = " + t_curr +
744  ')';
745  break;
746 
747  case -9:
748  retval = "the corrector could not converge (t = " + t_curr +
749  "; repeated test failures)";
750  break;
751 
752  case -10:
753  retval = "corrector could not converge because IRES was -1 (t = "
754  + t_curr + ')';
755  break;
756 
757  case -11:
758  retval = "return requested in user-supplied function (t = " + t_curr +
759  ')';
760  break;
761 
762  case -12:
763  retval = "failed to compute consistent initial conditions";
764  break;
765 
766  case -13:
767  retval = "unrecoverable error encountered inside user's PSOL function (t = "
768  + t_curr + ')';
769  break;
770 
771  case -14:
772  retval = "the Krylov linear system solver failed to converge (t = "
773  + t_curr + ')';
774  break;
775 
776  case -33:
777  retval = "unrecoverable error (see printed message)";
778  break;
779 
780  default:
781  retval = "unknown error state";
782  break;
783  }
784 
785  return retval;
786 }
static DAEFunc::DAEJacFunc user_jac
Definition: DASPK.cc:65
static F77_INT ddaspk_f(const double &time, const double *state, const double *deriv, const double &, double *delta, F77_INT &ires, double *, F77_INT *)
Definition: DASPK.cc:69
static F77_INT ddaspk_j(const double &time, const double *state, const double *deriv, double *pd, const double &cj, double *, F77_INT *)
Definition: DASPK.cc:117
static F77_INT nn
Definition: DASPK.cc:66
F77_INT(* daspk_fcn_ptr)(const double &, const double *, const double *, const double &, double *, F77_INT &, double *, F77_INT *)
Definition: DASPK.cc:39
F77_RET_T F77_FUNC(ddaspk, DDASPK)(daspk_fcn_ptr
static F77_INT ddaspk_psol(const F77_INT &, const double &, const double *, const double *, const double *, const double &, const double *, double *, F77_INT *, double *, const double &, F77_INT &, double *, F77_INT *)
Definition: DASPK.cc:106
static DAEFunc::DAERHSFunc user_fun
Definition: DASPK.cc:64
F77_INT(* daspk_psol_ptr)(const F77_INT &, const double &, const double *, const double *, const double *, const double &, const double *, double *, F77_INT *, double *, const double &, F77_INT &, double *, F77_INT *)
Definition: DASPK.cc:46
F77_INT(* daspk_jac_ptr)(const double &, const double *, const double *, double *, const double &, double *, F77_INT *)
Definition: DASPK.cc:43
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
Definition: Array.cc:1011
octave_idx_type numel(void) const
Number of elements in the array.
Definition: Array.h:377
T & elem(octave_idx_type n)
Size of the specified dimension.
Definition: Array.h:499
const T * fortran_vec(void) const
Size of the specified dimension.
Definition: Array.h:583
bool isempty(void) const
Size of the specified dimension.
Definition: Array.h:572
DAEJacFunc jacobian_function(void) const
Definition: DAEFunc.h:85
bool reset
Definition: DAEFunc.h:104
Matrix(* DAEJacFunc)(const ColumnVector &x, const ColumnVector &xdot, double t, double cj)
Definition: DAEFunc.h:47
ColumnVector(* DAERHSFunc)(const ColumnVector &x, const ColumnVector &xdot, double t, octave_idx_type &ires)
Definition: DAEFunc.h:39
DAERHSFunc function(void) const
Definition: DAEFunc.h:76
Array< octave_f77_int_type > iwork
Definition: DASPK.h:81
octave_f77_int_type liw
Definition: DASPK.h:77
std::string error_message(void) const
Definition: DASPK.cc:694
Array< double > abs_tol
Definition: DASPK.h:85
Array< octave_f77_int_type > info
Definition: DASPK.h:80
Array< double > rel_tol
Definition: DASPK.h:86
Array< double > rwork
Definition: DASPK.h:83
octave_f77_int_type lrw
Definition: DASPK.h:78
Matrix integrate(const ColumnVector &tout, Matrix &xdot_out)
Definition: DASPK.cc:546
bool initialized
Definition: DASPK.h:75
ColumnVector do_integrate(double t)
Definition: DASPK.cc:141
Definition: dMatrix.h:42
void resize(octave_idx_type nr, octave_idx_type nc, double rfv=0)
Definition: dMatrix.h:151
ColumnVector xdot
Definition: base-dae.h:80
bool restart
Definition: base-de.h:116
virtual void force_restart(void)
Definition: base-de.h:98
double t
Definition: base-de.h:110
bool integration_error
Definition: base-de.h:118
double stop_time
Definition: base-de.h:112
octave_idx_type size(void) const
Definition: base-de.h:79
octave_idx_type istate
Definition: base-de.h:120
ColumnVector x
Definition: base-de.h:108
void set_stop_time(double tt)
Definition: base-de.h:85
bool stop_time_set
Definition: base-de.h:114
void clear_stop_time(void)
Definition: base-de.h:92
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:95
subroutine ddaspk(RES, NEQ, T, Y, YPRIME, TOUT, INFO, RTOL, ATOL, IDID, RWORK, LRW, IWORK, LIW, RPAR, IPAR, JAC, PSOL)
Definition: ddaspk.f:7
#define F77_XFCN(f, F, args)
Definition: f77-fcn.h:44
double F77_DBLE
Definition: f77-fcn.h:301
octave_f77_int_type F77_INT
Definition: f77-fcn.h:305
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
Definition: lo-error.c:41
F77_RET_T(F77_CONST_CHAR_ARG_DECL, F77_CONST_CHAR_ARG_DECL, F77_CONST_CHAR_ARG_DECL, const F77_INT &, const F77_INT &, const F77_INT &, F77_INT &, F77_INT &, F77_DBLE *, const F77_INT &, F77_DBLE *, const F77_INT &, F77_DBLE *, F77_DBLE *, F77_DBLE *, const F77_INT &, F77_DBLE *, const F77_INT &, F77_DBLE *, const F77_INT &, F77_DBLE *, F77_INT *, F77_INT &F77_CHAR_ARG_LEN_DECL F77_CHAR_ARG_LEN_DECL F77_CHAR_ARG_LEN_DECL)
octave_idx_type n
Definition: mx-inlines.cc:753
octave_idx_type nint_big(double x)
Definition: lo-mappers.cc:184
static uint32_t state[624]
Definition: randmtzig.cc:190
octave_value::octave_value(const Array< char > &chm, char type) return retval
Definition: ov.cc:811