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 |
384
|
27 #include "Matrix.h" |
3
|
28 |
384
|
29 extern "C++" { |
3
|
30 |
|
31 #ifndef Vector |
|
32 #define Vector ColumnVector |
|
33 #endif |
|
34 |
384
|
35 #if !defined (octave_DAEFunc_typedefs) |
|
36 #define octave_DAEFunc_typedefs 1 |
3
|
37 |
|
38 typedef struct DAEJac |
|
39 { |
|
40 Matrix *dfdxdot; |
|
41 Matrix *dfdx; |
|
42 }; |
|
43 |
|
44 typedef Vector (*DAERHSFunc) (const Vector& x, const Vector& xdot, double); |
|
45 typedef DAEJac (*DAEJacFunc) (const Vector& x, const Vector& xdot, double); |
|
46 |
|
47 #endif |
|
48 |
|
49 class DAEFunc |
|
50 { |
|
51 public: |
|
52 |
|
53 DAEFunc (void); |
|
54 DAEFunc (DAERHSFunc f); |
|
55 DAEFunc (DAERHSFunc f, DAEJacFunc j); |
|
56 |
|
57 DAEFunc (const DAEFunc& a); |
|
58 |
|
59 DAEFunc& operator = (const DAEFunc& a); |
|
60 |
|
61 DAERHSFunc function (void) const; |
|
62 |
|
63 DAEFunc& set_function (DAERHSFunc f); |
|
64 |
|
65 DAEJacFunc jacobian_function (void) const; |
|
66 |
|
67 DAEFunc& set_jacobian_function (DAEJacFunc f); |
|
68 |
|
69 protected: |
|
70 |
|
71 DAERHSFunc fun; |
|
72 |
|
73 DAEJacFunc jac; |
|
74 }; |
|
75 |
382
|
76 } // extern "C++" |
|
77 |
3
|
78 #endif |
382
|
79 |
|
80 /* |
|
81 ;;; Local Variables: *** |
|
82 ;;; mode: C++ *** |
|
83 ;;; page-delimiter: "^/\\*" *** |
|
84 ;;; End: *** |
|
85 */ |