3
|
1 // NLFunc.cc -*- C++ -*- |
|
2 /* |
|
3 |
461
|
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 |
461
|
28 #if defined (__GNUG__) |
|
29 #pragma implementation |
|
30 #endif |
|
31 |
3
|
32 #include "NLFunc.h" |
|
33 |
|
34 NLFunc::NLFunc (void) |
|
35 { |
461
|
36 fun = 0; |
|
37 jac = 0; |
3
|
38 } |
|
39 |
|
40 NLFunc::NLFunc (const nonlinear_fcn f) |
|
41 { |
|
42 fun = f; |
461
|
43 jac = 0; |
3
|
44 } |
|
45 |
|
46 NLFunc::NLFunc (const nonlinear_fcn f, const jacobian_fcn j) |
|
47 { |
|
48 fun = f; |
|
49 jac = j; |
|
50 } |
|
51 |
|
52 NLFunc::NLFunc (const NLFunc& a) |
|
53 { |
|
54 fun = a.function (); |
|
55 jac = a.jacobian_function (); |
|
56 } |
|
57 |
|
58 NLFunc& |
|
59 NLFunc::operator = (const NLFunc& a) |
|
60 { |
|
61 fun = a.function (); |
|
62 jac = a.jacobian_function (); |
|
63 |
|
64 return *this; |
|
65 } |
|
66 |
|
67 nonlinear_fcn |
|
68 NLFunc::function (void) const |
|
69 { |
|
70 return fun; |
|
71 } |
|
72 |
|
73 NLFunc& |
|
74 NLFunc::set_function (const nonlinear_fcn f) |
|
75 { |
|
76 fun = f; |
|
77 |
|
78 return *this; |
|
79 } |
|
80 |
|
81 jacobian_fcn |
|
82 NLFunc::jacobian_function (void) const |
|
83 { |
|
84 return jac; |
|
85 } |
|
86 |
|
87 NLFunc& |
|
88 NLFunc::set_jacobian_function (const jacobian_fcn j) |
|
89 { |
|
90 jac = j; |
|
91 |
|
92 return *this; |
|
93 } |
|
94 |
|
95 /* |
|
96 ;;; Local Variables: *** |
|
97 ;;; mode: C++ *** |
|
98 ;;; page-delimiter: "^/\\*" *** |
|
99 ;;; End: *** |
|
100 */ |