3
|
1 // ODEFunc.h -*- C++ -*- |
|
2 /* |
|
3 |
1844
|
4 Copyright (C) 1996 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 |
1861
|
30 class |
|
31 ODEFunc |
3
|
32 { |
|
33 public: |
|
34 |
1536
|
35 typedef ColumnVector (*ODERHSFunc) (const ColumnVector&, double); |
|
36 typedef Matrix (*ODEJacFunc) (const ColumnVector&, double); |
|
37 |
|
38 ODEFunc (void) |
1844
|
39 : fun (0), jac (0) { } |
532
|
40 |
1536
|
41 ODEFunc (ODERHSFunc f) |
1844
|
42 : fun (f), jac (0) { } |
3
|
43 |
1536
|
44 ODEFunc (ODERHSFunc f, ODEJacFunc j) |
1844
|
45 : fun (f), jac (j) { } |
3
|
46 |
1536
|
47 ODEFunc (const ODEFunc& a) |
1844
|
48 : fun (a.fun), jac (a.jac) { } |
3
|
49 |
1536
|
50 ODEFunc& operator = (const ODEFunc& a) |
|
51 { |
1844
|
52 if (this != &a) |
|
53 { |
|
54 fun = a.fun; |
|
55 jac = a.jac; |
|
56 } |
1536
|
57 return *this; |
|
58 } |
3
|
59 |
1861
|
60 ~ODEFunc (void) { } |
|
61 |
1536
|
62 ODERHSFunc function (void) const { return fun; } |
|
63 |
|
64 ODEFunc& set_function (ODERHSFunc f) |
|
65 { |
|
66 fun = f; |
|
67 return *this; |
|
68 } |
3
|
69 |
1536
|
70 ODEJacFunc jacobian_function (void) const { return jac; } |
3
|
71 |
1536
|
72 ODEFunc& set_jacobian_function (ODEJacFunc j) |
|
73 { |
|
74 jac = j; |
|
75 return *this; |
|
76 } |
3
|
77 |
|
78 protected: |
|
79 |
|
80 ODERHSFunc fun; |
|
81 ODEJacFunc jac; |
382
|
82 }; |
3
|
83 |
|
84 #endif |
|
85 |
|
86 /* |
|
87 ;;; Local Variables: *** |
|
88 ;;; mode: C++ *** |
|
89 ;;; page-delimiter: "^/\\*" *** |
|
90 ;;; End: *** |
|
91 */ |