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