Mercurial > hg > octave-nkf
annotate liboctave/numeric/base-dae.h @ 16660:cbb1bb7a5c3d
Added tag ss-3-7-5 for changeset 608e307b4914
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 14 May 2013 05:23:53 -0400 |
parents | 648dabbb4c6b |
children | d63878346099 |
rev | line source |
---|---|
3990 | 1 /* |
2 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
3 Copyright (C) 2002-2012 John W. Eaton |
3990 | 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. | |
3990 | 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/>. | |
3990 | 20 |
21 */ | |
22 | |
23 #if !defined (octave_base_dae_h) | |
24 #define octave_base_dae_h 1 | |
25 | |
26 #include "base-de.h" | |
27 | |
28 class | |
29 base_diff_alg_eqn : public base_diff_eqn | |
30 { | |
31 public: | |
32 | |
33 base_diff_alg_eqn (void) | |
34 : base_diff_eqn (), xdot () { } | |
35 | |
36 base_diff_alg_eqn (const ColumnVector& xx, double tt) | |
37 : base_diff_eqn (xx, tt), xdot (xx.length (), 0.0) { } | |
38 | |
39 base_diff_alg_eqn (const ColumnVector& xx, const ColumnVector& xxdot, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
40 double tt) |
3990 | 41 : base_diff_eqn (xx, tt), xdot (xxdot) { } |
42 | |
43 base_diff_alg_eqn (const base_diff_alg_eqn& a) | |
44 : base_diff_eqn (a), xdot (a.xdot) { } | |
45 | |
46 virtual ~base_diff_alg_eqn (void) { } | |
47 | |
48 base_diff_alg_eqn& operator = (const base_diff_alg_eqn& 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 xdot = a.xdot; |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
54 } |
3990 | 55 return *this; |
56 } | |
57 | |
58 void initialize (const ColumnVector& x0, double t0) | |
59 { | |
60 base_diff_eqn::initialize (x0, t0); | |
3995 | 61 xdot = ColumnVector (x0.length (), 0.0); |
3990 | 62 } |
63 | |
64 void initialize (const ColumnVector& x0, const ColumnVector& xdot0, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
65 double t0) |
3990 | 66 { |
67 base_diff_eqn::initialize (x0, t0); | |
68 xdot = xdot0; | |
69 } | |
70 | |
71 ColumnVector state_derivative (void) { return xdot; } | |
72 | |
73 protected: | |
74 | |
75 ColumnVector xdot; | |
76 }; | |
77 | |
78 #endif |