1841
|
1 // DASSL.h -*- C++ -*- |
|
2 /* |
|
3 |
|
4 Copyright (C) 1996 John W. Eaton |
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_DASSL_h) |
|
25 #define octave_DASSL_h 1 |
|
26 |
|
27 #if defined (__GNUG__) |
|
28 #pragma interface |
|
29 #endif |
|
30 |
|
31 #include "DAE.h" |
|
32 |
|
33 class DASSL_options |
|
34 { |
|
35 public: |
|
36 |
|
37 DASSL_options (void); |
|
38 DASSL_options (const DASSL_options& opt); |
|
39 |
|
40 DASSL_options& operator = (const DASSL_options& opt); |
|
41 |
|
42 ~DASSL_options (void); |
|
43 |
|
44 void init (void); |
|
45 void copy (const DASSL_options& opt); |
|
46 |
|
47 void set_default_options (void); |
|
48 |
|
49 void set_absolute_tolerance (double); |
|
50 void set_initial_step_size (double); |
|
51 void set_maximum_step_size (double); |
|
52 void set_minimum_step_size (double); |
|
53 void set_relative_tolerance (double); |
|
54 |
|
55 double absolute_tolerance (void); |
|
56 double initial_step_size (void); |
|
57 double maximum_step_size (void); |
|
58 double minimum_step_size (void); |
|
59 double relative_tolerance (void); |
|
60 |
|
61 private: |
|
62 |
|
63 double x_absolute_tolerance; |
|
64 double x_initial_step_size; |
|
65 double x_maximum_step_size; |
|
66 double x_minimum_step_size; |
|
67 double x_relative_tolerance; |
|
68 }; |
|
69 |
|
70 class DASSL : public DAE, public DASSL_options |
|
71 { |
|
72 public: |
|
73 |
|
74 DASSL (void); |
|
75 |
|
76 DASSL (const ColumnVector& x, double time, DAEFunc& f); |
|
77 |
|
78 DASSL (const ColumnVector& x, const ColumnVector& xdot, |
|
79 double time, DAEFunc& f); |
|
80 |
|
81 ~DASSL (void); |
|
82 |
|
83 void force_restart (void); |
|
84 |
|
85 void set_stop_time (double t); |
|
86 void clear_stop_time (void); |
|
87 |
|
88 ColumnVector do_integrate (double t); |
|
89 |
|
90 Matrix do_integrate (const ColumnVector& tout); |
|
91 |
|
92 Matrix integrate (const ColumnVector& tout, Matrix& xdot_out); |
|
93 |
|
94 Matrix integrate (const ColumnVector& tout, Matrix& xdot_out, |
|
95 const ColumnVector& tcrit); |
|
96 |
|
97 private: |
|
98 |
|
99 double stop_time; |
|
100 int stop_time_set; |
|
101 |
|
102 int n; |
|
103 int integration_error; |
|
104 int restart; |
|
105 int liw; |
|
106 int lrw; |
|
107 int idid; |
|
108 int *info; |
|
109 int *iwork; |
|
110 double *rwork; |
|
111 |
|
112 friend int ddassl_j (double *time, double *state, double *deriv, |
|
113 double *pd, double *cj, double *rpar, int *ipar); |
|
114 |
|
115 friend int ddassl_f (double *time, double *state, double *deriv, |
|
116 double *delta, int *ires, double *rpar, int *ipar); |
|
117 |
|
118 }; |
|
119 |
|
120 #endif |
|
121 |
|
122 /* |
|
123 ;;; Local Variables: *** |
|
124 ;;; mode: C++ *** |
|
125 ;;; page-delimiter: "^/\\*" *** |
|
126 ;;; End: *** |
|
127 */ |