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