Mercurial > hg > octave-nkf
annotate liboctave/ODES.h @ 10431:5dd7a7bf4950
simplify sparse->full conversions in liboctave
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Mon, 22 Mar 2010 12:05:33 +0100 |
parents | cbc402e64d83 |
children | 4638800cd660 |
rev | line source |
---|---|
3984 | 1 /* |
2 | |
7017 | 3 Copyright (C) 2002, 2003, 2004, 2005, 2007 John W. Eaton |
3984 | 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. | |
3984 | 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/>. | |
3984 | 20 |
21 */ | |
22 | |
23 #if !defined (octave_ODES_h) | |
24 #define octave_ODES_h 1 | |
25 | |
26 #include "ODESFunc.h" | |
27 #include "base-de.h" | |
28 | |
29 class | |
30 ODES : public base_diff_eqn, public ODESFunc | |
31 { | |
32 public: | |
33 | |
34 ODES (void) | |
35 : base_diff_eqn (), ODESFunc (), theta () { } | |
36 | |
4587 | 37 ODES (const ColumnVector& s, double tm, ODESFunc& f) |
38 : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.length (), 0.0), theta () { } | |
3984 | 39 |
4587 | 40 ODES (const ColumnVector& s, const ColumnVector& xtheta, double tm, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
41 ODESFunc& f) |
4587 | 42 : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.length (), 0.0), |
3984 | 43 theta (xtheta) { } |
44 | |
45 ODES (const ODES& a) | |
46 : base_diff_eqn (a), ODESFunc (a), theta (a.theta) { } | |
47 | |
48 ODES& operator = (const ODES& a) | |
49 { | |
50 if (this != &a) | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
51 { |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
52 base_diff_eqn::operator = (a); |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
53 ODESFunc::operator = (a); |
3984 | 54 |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
55 xdot = a.xdot; |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
56 theta = a.theta; |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
57 } |
3984 | 58 return *this; |
59 } | |
60 | |
61 ~ODES (void) { } | |
62 | |
63 ColumnVector parameter_vector (void) { return theta; } | |
64 | |
65 void initialize (const ColumnVector& x, double t); | |
66 | |
67 void initialize (const ColumnVector& x, double t, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
68 const ColumnVector& theta); |
3984 | 69 |
70 protected: | |
71 | |
72 // State vector time derivatives. | |
73 ColumnVector xdot; | |
74 | |
75 // Parameter vector. | |
76 ColumnVector theta; | |
77 }; | |
78 | |
79 #endif |