3
|
1 // ODEFunc.h -*- C++ -*- |
|
2 /* |
|
3 |
1011
|
4 Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton |
3
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
1315
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
3
|
21 |
|
22 */ |
|
23 |
382
|
24 #if !defined (octave_ODEFunc_h) |
|
25 #define octave_ODEFunc_h 1 |
|
26 |
465
|
27 class Matrix; |
|
28 class ColumnVector; |
3
|
29 |
|
30 class ODEFunc |
|
31 { |
|
32 public: |
|
33 |
1536
|
34 typedef ColumnVector (*ODERHSFunc) (const ColumnVector&, double); |
|
35 typedef Matrix (*ODEJacFunc) (const ColumnVector&, double); |
|
36 |
|
37 ODEFunc (void) |
|
38 { |
|
39 fun = 0; |
|
40 jac = 0; |
|
41 } |
532
|
42 |
1536
|
43 ODEFunc (ODERHSFunc f) |
|
44 { |
|
45 fun = f; |
|
46 jac = 0; |
|
47 } |
3
|
48 |
1536
|
49 ODEFunc (ODERHSFunc f, ODEJacFunc j) |
|
50 { |
|
51 fun = f; |
|
52 jac = j; |
|
53 } |
3
|
54 |
1536
|
55 ODEFunc (const ODEFunc& a) |
|
56 { |
|
57 fun = a.function (); |
|
58 jac = a.jacobian_function (); |
|
59 } |
3
|
60 |
1536
|
61 ODEFunc& operator = (const ODEFunc& a) |
|
62 { |
|
63 fun = a.function (); |
|
64 jac = a.jacobian_function (); |
|
65 |
|
66 return *this; |
|
67 } |
3
|
68 |
1536
|
69 ODERHSFunc function (void) const { return fun; } |
|
70 |
|
71 ODEFunc& set_function (ODERHSFunc f) |
|
72 { |
|
73 fun = f; |
|
74 return *this; |
|
75 } |
3
|
76 |
1536
|
77 ODEJacFunc jacobian_function (void) const { return jac; } |
3
|
78 |
1536
|
79 ODEFunc& set_jacobian_function (ODEJacFunc j) |
|
80 { |
|
81 jac = j; |
|
82 return *this; |
|
83 } |
3
|
84 |
|
85 protected: |
|
86 |
|
87 ODERHSFunc fun; |
|
88 |
|
89 ODEJacFunc jac; |
382
|
90 }; |
3
|
91 |
|
92 #endif |
|
93 |
|
94 /* |
|
95 ;;; Local Variables: *** |
|
96 ;;; mode: C++ *** |
|
97 ;;; page-delimiter: "^/\\*" *** |
|
98 ;;; End: *** |
|
99 */ |