3
|
1 // DAE.h -*- C++ -*- |
|
2 /* |
|
3 |
1842
|
4 Copyright (C) 1996 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 |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
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 |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
1315
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
3
|
21 |
|
22 */ |
|
23 |
382
|
24 #if !defined (octave_DAE_h) |
|
25 #define octave_DAE_h 1 |
|
26 |
1296
|
27 #if defined (__GNUG__) |
|
28 #pragma interface |
|
29 #endif |
|
30 |
3
|
31 #include "DAEFunc.h" |
1842
|
32 #include "base-de.h" |
3
|
33 |
1868
|
34 class |
|
35 DAE : public base_diff_eqn, public DAEFunc |
3
|
36 { |
|
37 public: |
|
38 |
1842
|
39 DAE (void) |
|
40 : base_diff_eqn (), DAEFunc (), xdot () { } |
3
|
41 |
1842
|
42 DAE (const ColumnVector& x, double t, DAEFunc& f) |
|
43 : base_diff_eqn (x, t), DAEFunc (f), xdot (x.capacity (), 0.0) { } |
3
|
44 |
1842
|
45 DAE (const ColumnVector& x, const ColumnVector& xxdot, |
|
46 double t, DAEFunc& f); |
3
|
47 |
1842
|
48 DAE (const DAE& a) |
|
49 : base_diff_eqn (a), DAEFunc (a), xdot (a.xdot) { } |
3
|
50 |
1842
|
51 DAE& operator = (const DAE& a) |
|
52 { |
|
53 if (this != &a) |
|
54 { |
|
55 base_diff_eqn::operator = (a); |
|
56 DAEFunc::operator = (a); |
3
|
57 |
1842
|
58 xdot = a.xdot; |
|
59 } |
|
60 return *this; |
|
61 } |
|
62 |
|
63 ~DAE (void) { } |
3
|
64 |
1842
|
65 ColumnVector state_derivative (void) { return xdot; } |
|
66 |
|
67 void initialize (const ColumnVector& x, double t); |
|
68 |
|
69 void initialize (const ColumnVector& x, const ColumnVector& xxdot, |
|
70 double t); |
3
|
71 |
|
72 protected: |
|
73 |
1536
|
74 ColumnVector xdot; |
3
|
75 }; |
|
76 |
|
77 #endif |
382
|
78 |
|
79 /* |
|
80 ;;; Local Variables: *** |
|
81 ;;; mode: C++ *** |
|
82 ;;; page-delimiter: "^/\\*" *** |
|
83 ;;; End: *** |
|
84 */ |