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