3
|
1 // DAEFunc.cc -*- C++ -*- |
|
2 /* |
|
3 |
465
|
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 |
238
|
24 #ifdef HAVE_CONFIG_H |
|
25 #include "config.h" |
3
|
26 #endif |
|
27 |
465
|
28 #if defined (__GNUG__) |
|
29 #pragma implementation |
|
30 #endif |
|
31 |
3
|
32 #include "DAEFunc.h" |
|
33 |
|
34 DAEFunc::DAEFunc (void) |
|
35 { |
465
|
36 fun = 0; |
|
37 jac = 0; |
3
|
38 } |
|
39 |
|
40 DAEFunc::DAEFunc (DAERHSFunc f) |
|
41 { |
|
42 fun = f; |
465
|
43 jac = 0; |
3
|
44 } |
|
45 |
|
46 DAEFunc::DAEFunc (DAERHSFunc f, DAEJacFunc j) |
|
47 { |
|
48 fun = f; |
|
49 jac = j; |
|
50 } |
|
51 |
|
52 DAEFunc::DAEFunc (const DAEFunc& a) |
|
53 { |
|
54 fun = a.fun; |
|
55 jac = a.jac; |
|
56 } |
|
57 |
|
58 DAEFunc& |
|
59 DAEFunc::operator = (const DAEFunc& a) |
|
60 { |
|
61 fun = a.fun; |
|
62 jac = a.jac; |
|
63 |
|
64 return *this; |
|
65 } |
|
66 |
532
|
67 DAEFunc::DAERHSFunc |
3
|
68 DAEFunc::function (void) const |
|
69 { |
|
70 return fun; |
|
71 } |
|
72 |
|
73 DAEFunc& |
|
74 DAEFunc::set_function (DAERHSFunc f) |
|
75 { |
|
76 fun = f; |
|
77 return *this; |
|
78 } |
|
79 |
532
|
80 DAEFunc::DAEJacFunc |
3
|
81 DAEFunc::jacobian_function (void) const |
|
82 { |
|
83 return jac; |
|
84 } |
|
85 |
|
86 DAEFunc& |
|
87 DAEFunc::set_jacobian_function (DAEJacFunc j) |
|
88 { |
|
89 jac = j; |
|
90 return *this; |
|
91 } |
|
92 |