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