3984
|
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_ODESSA_h) |
|
24 #define octave_ODESSA_h 1 |
|
25 |
4192
|
26 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION) |
3984
|
27 #pragma interface |
|
28 #endif |
|
29 |
|
30 #include <cfloat> |
|
31 #include <cmath> |
|
32 |
3998
|
33 #include "ODESSA-opts.h" |
3984
|
34 |
|
35 class |
|
36 ODESSA_result |
|
37 { |
|
38 public: |
|
39 |
|
40 ODESSA_result (void) { } |
|
41 |
|
42 ODESSA_result (const Matrix& xx, |
|
43 const Array<Matrix>& xx_s) |
|
44 |
|
45 : x (xx), x_s (xx_s) { } |
|
46 |
|
47 ODESSA_result (const ODESSA_result& r) |
|
48 : x (r.x), x_s (r.x_s) { } |
|
49 |
|
50 ODESSA_result& operator = (const ODESSA_result& r) |
|
51 { |
|
52 if (this != &r) |
|
53 { |
|
54 x = r.x; |
|
55 x_s = r.x_s; |
|
56 } |
|
57 return *this; |
|
58 } |
|
59 |
|
60 ~ODESSA_result (void) { } |
|
61 |
|
62 Matrix state (void) const { return x; } |
|
63 Array<Matrix> state_sensitivity (void) const { return x_s; } |
|
64 |
|
65 private: |
|
66 |
|
67 Matrix x; |
|
68 Array<Matrix> x_s; |
|
69 }; |
|
70 |
|
71 class |
|
72 ODESSA : public ODES, public ODESSA_options |
|
73 { |
|
74 public: |
|
75 |
|
76 ODESSA (void); |
|
77 |
|
78 ODESSA (const ColumnVector& x, double time, ODESFunc& f); |
|
79 |
|
80 ODESSA (const ColumnVector& x, const ColumnVector& theta, |
|
81 const Matrix& sensitivity_guess, double time, ODESFunc& f); |
|
82 |
|
83 ~ODESSA (void) { } |
|
84 |
|
85 ODESSA_result integrate (const ColumnVector& tout); |
|
86 |
|
87 ODESSA_result integrate (const ColumnVector& tout, |
|
88 const ColumnVector& tcrit); |
|
89 |
|
90 std::string error_message (void) const; |
|
91 |
|
92 private: |
|
93 |
|
94 bool initialized; |
|
95 |
|
96 bool sanity_checked; |
|
97 |
|
98 int liw; |
|
99 int lrw; |
|
100 int method_flag; |
|
101 Array<int> iwork; |
|
102 Array<double> rwork; |
|
103 int itask; |
|
104 Array<int> iopt; |
|
105 int isopt; |
|
106 |
|
107 Array<int> neq; |
|
108 |
|
109 int n; |
|
110 int npar; |
|
111 |
4049
|
112 // XXX FIXME XXX -- ??? |
3984
|
113 Array<double> par; |
|
114 |
|
115 Matrix sx0; |
|
116 |
|
117 Matrix y; |
|
118 |
|
119 double *py; |
|
120 double *ppar; |
|
121 int *piwork; |
|
122 int *piopt; |
|
123 int *pneq; |
|
124 double *prwork; |
|
125 |
|
126 void init_work_size (int); |
|
127 |
|
128 void integrate (double t); |
|
129 }; |
|
130 |
|
131 #endif |
|
132 |
|
133 /* |
|
134 ;;; Local Variables: *** |
|
135 ;;; mode: C++ *** |
|
136 ;;; End: *** |
|
137 */ |