Mercurial > hg > octave-nkf
annotate liboctave/ODE.h @ 10687:a8ce6bdecce5
Improve documentation strings.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Tue, 08 Jun 2010 20:22:38 -0700 |
parents | cbc402e64d83 |
children | 81ff63e43f54 |
rev | line source |
---|---|
3 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1993, 1994, 1995, 1996, 1997, 2002, 2003, 2005, 2007 |
4 John W. Eaton | |
3 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
3 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
3 | 21 |
22 */ | |
23 | |
382 | 24 #if !defined (octave_ODE_h) |
25 #define octave_ODE_h 1 | |
26 | |
3 | 27 #include "ODEFunc.h" |
1842 | 28 #include "base-de.h" |
289 | 29 |
1861 | 30 class |
31 ODE : public base_diff_eqn, public ODEFunc | |
3 | 32 { |
33 public: | |
34 | |
1842 | 35 ODE (void) |
36 : base_diff_eqn (), ODEFunc () { } | |
3 | 37 |
4587 | 38 ODE (const ColumnVector& s, double tm, const ODEFunc& f) |
39 : base_diff_eqn (s, tm), ODEFunc (f) { } | |
3 | 40 |
1842 | 41 ODE (const ODE& a) |
42 : base_diff_eqn (a), ODEFunc (a) { } | |
3 | 43 |
1842 | 44 ODE& operator = (const ODE& a) |
45 { | |
46 if (this != &a) | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
47 { |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
48 base_diff_eqn::operator = (a); |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
49 ODEFunc::operator = (a); |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
50 } |
1842 | 51 return *this; |
52 } | |
3 | 53 |
1842 | 54 ~ODE (void) { } |
3984 | 55 |
56 // Derived classes must provide functions to actually do the | |
57 // integration. | |
58 | |
59 // Return the vector of states at output time t. | |
60 virtual ColumnVector do_integrate (double tt) = 0; | |
61 | |
62 // Return a matrix of states at each output time specified by t. | |
63 // The rows of the result matrix should each correspond to a new | |
64 // output time. | |
65 virtual Matrix do_integrate (const ColumnVector& tt) = 0; | |
66 | |
67 virtual Matrix do_integrate (const ColumnVector& tt, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
68 const ColumnVector& ttcrit) = 0; |
3984 | 69 |
70 // Lots of ways to call the single function and optionally set and | |
71 // get additional information. | |
72 | |
73 // Integrate to t from current point. | |
74 virtual ColumnVector integrate (double tt) | |
75 { return do_integrate (tt); } | |
76 | |
77 // Set new x0, t0 and integrate to t. | |
78 virtual ColumnVector integrate (const ColumnVector& x0, double t0, double tt) | |
79 { | |
80 initialize (x0, t0); | |
81 return do_integrate (tt); | |
82 } | |
83 | |
84 // Integrate from current point and return output at all points | |
85 // specified by t. | |
86 virtual Matrix integrate (const ColumnVector& tt) | |
87 { return do_integrate (tt); } | |
88 | |
89 // Set new x0, t0 and integrate to return output at all points | |
90 // specified by t. | |
91 virtual Matrix integrate (const ColumnVector& x0, double t0, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
92 const ColumnVector& tt) |
3984 | 93 { |
94 initialize (x0, t0); | |
95 return do_integrate (tt); | |
96 } | |
97 | |
98 // Integrate from current point and return output at all points | |
99 // specified by t. | |
100 virtual Matrix integrate (const ColumnVector& tt, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
101 const ColumnVector& ttcrit) |
3984 | 102 { return do_integrate (tt, ttcrit); } |
103 | |
104 // Set new x0, t0 and integrate to return output at all points | |
105 // specified by t. | |
106 virtual Matrix integrate (const ColumnVector& x0, double t0, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
107 const ColumnVector& tt, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
108 const ColumnVector& ttcrit) |
3984 | 109 { |
110 initialize (x0, t0); | |
111 return do_integrate (tt, ttcrit); | |
112 } | |
3 | 113 }; |
114 | |
115 #endif |