3
|
1 // ODEFunc.h -*- C++ -*- |
|
2 /* |
|
3 |
|
4 Copyright (C) 1992, 1993 John W. Eaton |
|
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 |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (_ODEFunc_h) |
|
25 #define _ODEFunc_h 1 |
|
26 |
|
27 #include "Matrix.h" |
|
28 |
|
29 #ifndef Vector |
|
30 #define Vector ColumnVector |
|
31 #endif |
|
32 |
|
33 #ifndef _ODEFunc_typedefs |
|
34 #define _ODEFunc_typedefs 1 |
|
35 |
|
36 typedef Vector (*ODERHSFunc) (const Vector&, double); |
|
37 typedef Matrix (*ODEJacFunc) (const Vector&, double); |
|
38 |
|
39 #endif |
|
40 |
|
41 class ODEFunc |
|
42 { |
|
43 public: |
|
44 |
|
45 ODEFunc (void); |
|
46 ODEFunc (ODERHSFunc f); |
|
47 ODEFunc (ODERHSFunc f, ODEJacFunc j); |
|
48 |
|
49 ODEFunc (const ODEFunc& a); |
|
50 |
|
51 ODEFunc& operator = (const ODEFunc& a); |
|
52 |
|
53 ODERHSFunc function (void) const; |
|
54 |
|
55 ODEFunc& set_function (ODERHSFunc f); |
|
56 |
|
57 ODEJacFunc jacobian_function (void) const; |
|
58 |
|
59 ODEFunc& set_jacobian_function (ODEJacFunc j); |
|
60 |
|
61 protected: |
|
62 |
|
63 ODERHSFunc fun; |
|
64 |
|
65 ODEJacFunc jac; |
|
66 |
|
67 private: |
|
68 }; |
|
69 |
|
70 #endif |
|
71 |
|
72 /* |
|
73 ;;; Local Variables: *** |
|
74 ;;; mode: C++ *** |
|
75 ;;; page-delimiter: "^/\\*" *** |
|
76 ;;; End: *** |
|
77 */ |