Mercurial > hg > octave-lyh
annotate liboctave/DAERTFunc.h @ 14348:95c43fc8dbe1 stable rc-3-6-1-0
3.6.1 release candidate 0
* configure.ac (AC_INIT): Version is now 3.6.1-rc0.
(OCTAVE_RELEASE_DATE): Now 2012-02-07.
* liboctave/Makefile.am: Bump liboctave revision version.
* src/Makefile.am: Bump liboctave revision version.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 09 Feb 2012 11:25:04 -0500 |
parents | 72c96de7a403 |
children |
rev | line source |
---|---|
3990 | 1 /* |
2 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
3 Copyright (C) 2002-2012 John W. Eaton |
3990 | 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 | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
3990 | 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 | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
3990 | 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) | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
56 { |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
57 DAEFunc::operator = (a); |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
58 constr = a.constr; |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
59 reset = a.reset; |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
60 } |
3990 | 61 return *this; |
62 } | |
63 | |
11504
81ff63e43f54
really make destuctors virtual in ODE/DAE base classes
John W. Eaton <jwe@octave.org>
parents:
10312
diff
changeset
|
64 virtual ~DAERTFunc (void) { } |
3990 | 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 |