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