3
|
1 // DAEFunc.h -*- C++ -*- |
|
2 /* |
|
3 |
382
|
4 Copyright (C) 1992, 1993, 1994 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 |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
382
|
24 #if !defined (octave_DAEFunc_h) |
|
25 #define octave_DAEFunc_h 1 |
|
26 |
465
|
27 #if defined (__GNUG__) |
|
28 #pragma interface |
|
29 #endif |
|
30 |
|
31 class Matrix; |
|
32 class ColumnVector; |
3
|
33 |
384
|
34 extern "C++" { |
3
|
35 |
|
36 #ifndef Vector |
|
37 #define Vector ColumnVector |
|
38 #endif |
|
39 |
384
|
40 #if !defined (octave_DAEFunc_typedefs) |
|
41 #define octave_DAEFunc_typedefs 1 |
3
|
42 |
|
43 #endif |
|
44 |
|
45 class DAEFunc |
|
46 { |
|
47 public: |
|
48 |
532
|
49 struct DAEJac |
|
50 { |
|
51 Matrix *dfdxdot; |
|
52 Matrix *dfdx; |
|
53 }; |
|
54 |
|
55 typedef Vector (*DAERHSFunc) (const Vector& x, |
|
56 const Vector& xdot, double); |
|
57 |
|
58 typedef DAEJac (*DAEJacFunc) (const Vector& x, |
|
59 const Vector& xdot, double); |
|
60 |
3
|
61 DAEFunc (void); |
|
62 DAEFunc (DAERHSFunc f); |
|
63 DAEFunc (DAERHSFunc f, DAEJacFunc j); |
|
64 |
|
65 DAEFunc (const DAEFunc& a); |
|
66 |
|
67 DAEFunc& operator = (const DAEFunc& a); |
|
68 |
|
69 DAERHSFunc function (void) const; |
|
70 |
|
71 DAEFunc& set_function (DAERHSFunc f); |
|
72 |
|
73 DAEJacFunc jacobian_function (void) const; |
|
74 |
|
75 DAEFunc& set_jacobian_function (DAEJacFunc f); |
|
76 |
|
77 protected: |
|
78 |
|
79 DAERHSFunc fun; |
|
80 |
|
81 DAEJacFunc jac; |
|
82 }; |
|
83 |
382
|
84 } // extern "C++" |
|
85 |
3
|
86 #endif |
382
|
87 |
|
88 /* |
|
89 ;;; Local Variables: *** |
|
90 ;;; mode: C++ *** |
|
91 ;;; page-delimiter: "^/\\*" *** |
|
92 ;;; End: *** |
|
93 */ |