3990
|
1 /* |
|
2 |
|
3 Copyright (C) 2002 John W. Eaton |
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_DASRT_h) |
|
24 #define octave_DASRT_h 1 |
|
25 |
|
26 #if defined (__GNUG__) |
|
27 #pragma interface |
|
28 #endif |
|
29 |
|
30 #include <cfloat> |
|
31 #include <cmath> |
|
32 |
3998
|
33 #include "DASRT-opts.h" |
3990
|
34 |
|
35 class |
|
36 DASRT_result |
|
37 { |
|
38 public: |
|
39 |
|
40 DASRT_result (void) { } |
|
41 |
|
42 DASRT_result (const Matrix& xx, const Matrix& xxdot, const ColumnVector& tt) |
|
43 : x (xx), xdot (xxdot), t (tt) { } |
|
44 |
|
45 DASRT_result (const DASRT_result& r) |
|
46 : x (r.x), xdot (r.xdot), t (r.t) { } |
|
47 |
|
48 DASRT_result& operator = (const DASRT_result& r) |
|
49 { |
|
50 if (this != &r) |
|
51 { |
|
52 x = r.x; |
|
53 xdot = r.xdot; |
|
54 t = r.t; |
|
55 } |
|
56 return *this; |
|
57 } |
|
58 |
|
59 ~DASRT_result (void) { } |
|
60 |
|
61 Matrix state (void) const { return x; } |
|
62 Matrix deriv (void) const { return xdot; } |
|
63 ColumnVector times (void) const { return t; } |
|
64 |
|
65 private: |
|
66 |
|
67 Matrix x; |
|
68 Matrix xdot; |
|
69 ColumnVector t; |
|
70 }; |
|
71 |
|
72 class |
|
73 DASRT : public DAERT, public DASRT_options |
|
74 { |
|
75 public: |
|
76 |
|
77 DASRT (void); |
|
78 |
3994
|
79 DASRT (const ColumnVector& state, double time, DAERTFunc& f); |
|
80 |
3992
|
81 DASRT (const ColumnVector& state, const ColumnVector& deriv, |
3990
|
82 double time, DAERTFunc& f); |
|
83 |
|
84 ~DASRT (void) { } |
|
85 |
|
86 DASRT_result integrate (const ColumnVector& tout); |
|
87 |
|
88 DASRT_result integrate (const ColumnVector& tout, |
|
89 const ColumnVector& tcrit); |
|
90 |
3995
|
91 std::string error_message (void) const; |
|
92 |
3990
|
93 private: |
|
94 |
|
95 bool initialized; |
|
96 |
|
97 bool sanity_checked; |
|
98 |
|
99 int liw; |
|
100 int lrw; |
|
101 |
|
102 int n; |
|
103 int ng; |
|
104 |
|
105 Array<int> info; |
|
106 Array<int> iwork; |
|
107 Array<int> jroot; |
|
108 |
|
109 Array<double> rwork; |
|
110 |
3998
|
111 Array<double> abs_tol; |
|
112 Array<double> rel_tol; |
3990
|
113 |
3994
|
114 double *px; |
|
115 double *pxdot; |
3998
|
116 double *pabs_tol; |
|
117 double *prel_tol; |
3990
|
118 int *pinfo; |
|
119 int *piwork; |
|
120 double *prwork; |
|
121 int *pjroot; |
|
122 |
|
123 void integrate (double t); |
|
124 }; |
|
125 |
|
126 #endif |
|
127 |
|
128 /* |
|
129 ;;; Local Variables: *** |
|
130 ;;; mode: C++ *** |
|
131 ;;; End: *** |
|
132 */ |