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 |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
3990
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_DASRT_h) |
|
25 #define octave_DASRT_h 1 |
|
26 |
|
27 #include <cfloat> |
|
28 #include <cmath> |
|
29 |
3998
|
30 #include "DASRT-opts.h" |
3990
|
31 |
|
32 class |
|
33 DASRT_result |
|
34 { |
|
35 public: |
|
36 |
|
37 DASRT_result (void) { } |
|
38 |
|
39 DASRT_result (const Matrix& xx, const Matrix& xxdot, const ColumnVector& tt) |
|
40 : x (xx), xdot (xxdot), t (tt) { } |
|
41 |
|
42 DASRT_result (const DASRT_result& r) |
|
43 : x (r.x), xdot (r.xdot), t (r.t) { } |
|
44 |
|
45 DASRT_result& operator = (const DASRT_result& r) |
|
46 { |
|
47 if (this != &r) |
|
48 { |
|
49 x = r.x; |
|
50 xdot = r.xdot; |
|
51 t = r.t; |
|
52 } |
|
53 return *this; |
|
54 } |
|
55 |
|
56 ~DASRT_result (void) { } |
|
57 |
|
58 Matrix state (void) const { return x; } |
|
59 Matrix deriv (void) const { return xdot; } |
|
60 ColumnVector times (void) const { return t; } |
|
61 |
|
62 private: |
|
63 |
|
64 Matrix x; |
|
65 Matrix xdot; |
|
66 ColumnVector t; |
|
67 }; |
|
68 |
|
69 class |
|
70 DASRT : public DAERT, public DASRT_options |
|
71 { |
|
72 public: |
|
73 |
4049
|
74 DASRT (void) : DAERT (), DASRT_options (), initialized (false) { } |
3990
|
75 |
4587
|
76 DASRT (const ColumnVector& s, double tm, DAERTFunc& f) |
|
77 : DAERT (s, tm, f), DASRT_options (), initialized (false) { } |
3994
|
78 |
4587
|
79 DASRT (const ColumnVector& s, const ColumnVector& deriv, |
|
80 double tm, DAERTFunc& f) |
|
81 : DAERT (s, deriv, tm, f), DASRT_options (), initialized (false) { } |
3990
|
82 |
|
83 ~DASRT (void) { } |
|
84 |
|
85 DASRT_result integrate (const ColumnVector& tout); |
|
86 |
|
87 DASRT_result integrate (const ColumnVector& tout, |
|
88 const ColumnVector& tcrit); |
|
89 |
3995
|
90 std::string error_message (void) const; |
|
91 |
3990
|
92 private: |
|
93 |
|
94 bool initialized; |
|
95 |
5275
|
96 octave_idx_type liw; |
|
97 octave_idx_type lrw; |
3990
|
98 |
5275
|
99 octave_idx_type ng; |
3990
|
100 |
5275
|
101 Array<octave_idx_type> info; |
|
102 Array<octave_idx_type> iwork; |
|
103 Array<octave_idx_type> jroot; |
3990
|
104 |
|
105 Array<double> rwork; |
|
106 |
3998
|
107 Array<double> abs_tol; |
|
108 Array<double> rel_tol; |
3990
|
109 |
3994
|
110 double *px; |
|
111 double *pxdot; |
3998
|
112 double *pabs_tol; |
|
113 double *prel_tol; |
5275
|
114 octave_idx_type *pinfo; |
|
115 octave_idx_type *piwork; |
3990
|
116 double *prwork; |
5275
|
117 octave_idx_type *pjroot; |
3990
|
118 |
|
119 void integrate (double t); |
|
120 }; |
|
121 |
|
122 #endif |
|
123 |
|
124 /* |
|
125 ;;; Local Variables: *** |
|
126 ;;; mode: C++ *** |
|
127 ;;; End: *** |
|
128 */ |