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_DAERTFunc_h) |
|
25 #define octave_DAERTFunc_h 1 |
|
26 |
|
27 #include "dMatrix.h" |
|
28 |
|
29 class |
3993
|
30 DAERTFunc : public DAEFunc |
3990
|
31 { |
|
32 public: |
|
33 |
|
34 typedef ColumnVector (*DAERTConstrFunc) (const ColumnVector& x, double t); |
|
35 |
|
36 DAERTFunc (void) |
4049
|
37 : DAEFunc (), constr (0), reset (true) { } |
3990
|
38 |
|
39 DAERTFunc (DAERHSFunc f) |
4049
|
40 : DAEFunc (f), constr (0), reset (true) { } |
3990
|
41 |
|
42 DAERTFunc (DAERHSFunc f, DAEJacFunc j) |
4049
|
43 : DAEFunc (f, j), constr (0), reset (true) { } |
3990
|
44 |
|
45 DAERTFunc (DAERHSFunc f, DAERTConstrFunc cf) |
4049
|
46 : DAEFunc (f), constr (cf), reset (true) { } |
3990
|
47 |
|
48 DAERTFunc (DAERHSFunc f, DAERTConstrFunc cf, DAEJacFunc j) |
4049
|
49 : DAEFunc (f, j), constr (cf), reset (true) { } |
3990
|
50 |
|
51 DAERTFunc (const DAERTFunc& a) |
4049
|
52 : DAEFunc (a), constr (a.constr), reset (a.reset) { } |
3990
|
53 |
|
54 DAERTFunc& operator = (const DAERTFunc& a) |
|
55 { |
|
56 if (this != &a) |
|
57 { |
|
58 DAEFunc::operator = (a); |
|
59 constr = a.constr; |
4049
|
60 reset = a.reset; |
3990
|
61 } |
|
62 return *this; |
|
63 } |
|
64 |
|
65 ~DAERTFunc (void) { } |
|
66 |
|
67 DAERTConstrFunc constraint_function (void) const { return constr; } |
|
68 |
|
69 DAERTFunc& set_constraint_function (DAERTConstrFunc cf) |
|
70 { |
|
71 constr = cf; |
4049
|
72 reset = true; |
3990
|
73 return *this; |
|
74 } |
|
75 |
|
76 protected: |
|
77 |
|
78 DAERTConstrFunc constr; |
4049
|
79 |
|
80 // This variable is TRUE when this object is constructed, and also |
|
81 // after any internal data has changed. Derived classes may use |
|
82 // this information (and change it) to know when to (re)initialize |
|
83 // their own internal data related to this object. |
|
84 |
|
85 bool reset; |
3990
|
86 }; |
|
87 |
|
88 #endif |
|
89 |
|
90 /* |
|
91 ;;; Local Variables: *** |
|
92 ;;; mode: C++ *** |
|
93 ;;; End: *** |
|
94 */ |