3984
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 2002, 2005, 2007 John W. Eaton |
3984
|
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. |
3984
|
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/>. |
3984
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_ODESFunc_h) |
|
24 #define octave_ODESFunc_h 1 |
|
25 |
|
26 #include "dMatrix.h" |
|
27 |
|
28 class |
|
29 ODESFunc |
|
30 { |
|
31 public: |
|
32 |
|
33 struct DAEJac |
|
34 { |
|
35 Matrix *dfdxdot; |
|
36 Matrix *dfdx; |
|
37 }; |
|
38 |
4141
|
39 typedef ColumnVector (*ODES_fsub) (const ColumnVector& x, double, |
3984
|
40 const ColumnVector& theta); |
|
41 |
4141
|
42 typedef ColumnVector (*ODES_bsub) (const ColumnVector& x, double, |
3984
|
43 const ColumnVector& theta, int column); |
|
44 |
4141
|
45 typedef Matrix (*ODES_jsub) (const ColumnVector& x, double, |
3984
|
46 const ColumnVector& theta); |
|
47 |
|
48 ODESFunc (void) |
|
49 : fsub (0), bsub (0), jsub (0) { } |
|
50 |
|
51 ODESFunc (ODES_fsub f) |
|
52 : fsub (f), bsub (0), jsub (0) { } |
|
53 |
|
54 ODESFunc (ODES_fsub f, ODES_bsub b) |
|
55 : fsub (f), bsub (b), jsub (0) { } |
|
56 |
|
57 ODESFunc (ODES_fsub f, ODES_bsub b, ODES_jsub j) |
|
58 : fsub (f), bsub (b), jsub (j) { } |
|
59 |
|
60 ODESFunc (const ODESFunc& a) |
|
61 : fsub (a.fsub), bsub (a.bsub), jsub (a.jsub) { } |
|
62 |
|
63 ODESFunc& operator = (const ODESFunc& a) |
|
64 { |
|
65 if (this != &a) |
|
66 { |
|
67 fsub = a.fsub; |
|
68 bsub = a.bsub; |
|
69 jsub = a.jsub; |
|
70 } |
|
71 return *this; |
|
72 } |
|
73 |
|
74 ~ODESFunc (void) { } |
|
75 |
|
76 ODES_fsub fsub_function (void) const { return fsub; } |
|
77 |
|
78 ODESFunc& set_fsub_function (ODES_fsub f) |
|
79 { |
|
80 fsub = f; |
|
81 return *this; |
|
82 } |
|
83 |
|
84 ODES_bsub bsub_function (void) const { return bsub; } |
|
85 |
|
86 ODESFunc& set_bsub_function (ODES_bsub b) |
|
87 { |
|
88 bsub = b; |
|
89 return *this; |
|
90 } |
|
91 |
|
92 ODES_jsub jsub_function (void) const { return jsub; } |
|
93 |
|
94 ODESFunc& set_jsub_function (ODES_jsub j) |
|
95 { |
|
96 jsub = j; |
|
97 return *this; |
|
98 } |
|
99 |
|
100 protected: |
|
101 |
|
102 ODES_fsub fsub; |
|
103 ODES_bsub bsub; |
|
104 ODES_jsub jsub; |
|
105 }; |
|
106 |
|
107 #endif |
|
108 |
|
109 /* |
|
110 ;;; Local Variables: *** |
|
111 ;;; mode: C++ *** |
|
112 ;;; End: *** |
|
113 */ |
|
114 |
|
115 |
|
116 |
|
117 |