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_ODES_h) |
|
24 #define octave_ODES_h 1 |
|
25 |
4192
|
26 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION) |
3984
|
27 #pragma interface |
|
28 #endif |
|
29 |
|
30 #include "ODESFunc.h" |
|
31 #include "base-de.h" |
|
32 |
|
33 class |
|
34 ODES : public base_diff_eqn, public ODESFunc |
|
35 { |
|
36 public: |
|
37 |
|
38 ODES (void) |
|
39 : base_diff_eqn (), ODESFunc (), theta () { } |
|
40 |
4587
|
41 ODES (const ColumnVector& s, double tm, ODESFunc& f) |
|
42 : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.length (), 0.0), theta () { } |
3984
|
43 |
4587
|
44 ODES (const ColumnVector& s, const ColumnVector& xtheta, double tm, |
3984
|
45 ODESFunc& f) |
4587
|
46 : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.length (), 0.0), |
3984
|
47 theta (xtheta) { } |
|
48 |
|
49 ODES (const ODES& a) |
|
50 : base_diff_eqn (a), ODESFunc (a), theta (a.theta) { } |
|
51 |
|
52 ODES& operator = (const ODES& a) |
|
53 { |
|
54 if (this != &a) |
|
55 { |
|
56 base_diff_eqn::operator = (a); |
|
57 ODESFunc::operator = (a); |
|
58 |
|
59 xdot = a.xdot; |
|
60 theta = a.theta; |
|
61 } |
|
62 return *this; |
|
63 } |
|
64 |
|
65 ~ODES (void) { } |
|
66 |
|
67 ColumnVector parameter_vector (void) { return theta; } |
|
68 |
|
69 void initialize (const ColumnVector& x, double t); |
|
70 |
|
71 void initialize (const ColumnVector& x, double t, |
|
72 const ColumnVector& theta); |
|
73 |
|
74 protected: |
|
75 |
|
76 // State vector time derivatives. |
|
77 ColumnVector xdot; |
|
78 |
|
79 // Parameter vector. |
|
80 ColumnVector theta; |
|
81 }; |
|
82 |
|
83 #endif |
|
84 |
|
85 /* |
|
86 ;;; Local Variables: *** |
|
87 ;;; mode: C++ *** |
|
88 ;;; End: *** |
|
89 */ |