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