3990
|
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. |
3990
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_base_dae_h) |
|
25 #define octave_base_dae_h 1 |
|
26 |
|
27 #include "base-de.h" |
|
28 |
|
29 class |
|
30 base_diff_alg_eqn : public base_diff_eqn |
|
31 { |
|
32 public: |
|
33 |
|
34 base_diff_alg_eqn (void) |
|
35 : base_diff_eqn (), xdot () { } |
|
36 |
|
37 base_diff_alg_eqn (const ColumnVector& xx, double tt) |
|
38 : base_diff_eqn (xx, tt), xdot (xx.length (), 0.0) { } |
|
39 |
|
40 base_diff_alg_eqn (const ColumnVector& xx, const ColumnVector& xxdot, |
|
41 double tt) |
|
42 : base_diff_eqn (xx, tt), xdot (xxdot) { } |
|
43 |
|
44 base_diff_alg_eqn (const base_diff_alg_eqn& a) |
|
45 : base_diff_eqn (a), xdot (a.xdot) { } |
|
46 |
|
47 virtual ~base_diff_alg_eqn (void) { } |
|
48 |
|
49 base_diff_alg_eqn& operator = (const base_diff_alg_eqn& a) |
|
50 { |
|
51 if (this != &a) |
|
52 { |
|
53 base_diff_eqn::operator = (a); |
|
54 xdot = a.xdot; |
|
55 } |
|
56 return *this; |
|
57 } |
|
58 |
|
59 void initialize (const ColumnVector& x0, double t0) |
|
60 { |
|
61 base_diff_eqn::initialize (x0, t0); |
3995
|
62 xdot = ColumnVector (x0.length (), 0.0); |
3990
|
63 } |
|
64 |
|
65 void initialize (const ColumnVector& x0, const ColumnVector& xdot0, |
|
66 double t0) |
|
67 { |
|
68 base_diff_eqn::initialize (x0, t0); |
|
69 xdot = xdot0; |
|
70 } |
|
71 |
|
72 ColumnVector state_derivative (void) { return xdot; } |
|
73 |
|
74 protected: |
|
75 |
|
76 ColumnVector xdot; |
|
77 }; |
|
78 |
|
79 #endif |
|
80 |
|
81 /* |
|
82 ;;; Local Variables: *** |
|
83 ;;; mode: C++ *** |
|
84 ;;; End: *** |
|
85 */ |