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 |
6108
|
70 OCTAVE_API |
3990
|
71 DASRT : public DAERT, public DASRT_options |
|
72 { |
|
73 public: |
|
74 |
4049
|
75 DASRT (void) : DAERT (), DASRT_options (), initialized (false) { } |
3990
|
76 |
4587
|
77 DASRT (const ColumnVector& s, double tm, DAERTFunc& f) |
|
78 : DAERT (s, tm, f), DASRT_options (), initialized (false) { } |
3994
|
79 |
4587
|
80 DASRT (const ColumnVector& s, const ColumnVector& deriv, |
|
81 double tm, DAERTFunc& f) |
|
82 : DAERT (s, deriv, tm, f), DASRT_options (), initialized (false) { } |
3990
|
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 |
5275
|
97 octave_idx_type liw; |
|
98 octave_idx_type lrw; |
3990
|
99 |
5275
|
100 octave_idx_type ng; |
3990
|
101 |
5275
|
102 Array<octave_idx_type> info; |
|
103 Array<octave_idx_type> iwork; |
|
104 Array<octave_idx_type> jroot; |
3990
|
105 |
|
106 Array<double> rwork; |
|
107 |
3998
|
108 Array<double> abs_tol; |
|
109 Array<double> rel_tol; |
3990
|
110 |
3994
|
111 double *px; |
|
112 double *pxdot; |
3998
|
113 double *pabs_tol; |
|
114 double *prel_tol; |
5275
|
115 octave_idx_type *pinfo; |
|
116 octave_idx_type *piwork; |
3990
|
117 double *prwork; |
5275
|
118 octave_idx_type *pjroot; |
3990
|
119 |
|
120 void integrate (double t); |
|
121 }; |
|
122 |
|
123 #endif |
|
124 |
|
125 /* |
|
126 ;;; Local Variables: *** |
|
127 ;;; mode: C++ *** |
|
128 ;;; End: *** |
|
129 */ |