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 |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
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, |
|
40 double tt) |
|
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) |
|
51 { |
|
52 base_diff_eqn::operator = (a); |
|
53 xdot = a.xdot; |
|
54 } |
|
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, |
|
65 double t0) |
|
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 |
|
79 |
|
80 /* |
|
81 ;;; Local Variables: *** |
|
82 ;;; mode: C++ *** |
|
83 ;;; End: *** |
|
84 */ |