3990
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 John W. Eaton |
3990
|
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 |
7016
|
9 Free Software Foundation; either version 3 of the License, or (at your |
|
10 option) any later version. |
3990
|
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 |
7016
|
18 along with Octave; see the file COPYING. If not, see |
|
19 <http://www.gnu.org/licenses/>. |
3990
|
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 |
6108
|
69 OCTAVE_API |
3990
|
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 */ |