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