3
|
1 // Objective.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 |
1315
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
3
|
21 |
|
22 */ |
|
23 |
1296
|
24 #if defined (__GNUG__) |
|
25 #pragma implementation |
|
26 #endif |
|
27 |
238
|
28 #ifdef HAVE_CONFIG_H |
1192
|
29 #include <config.h> |
3
|
30 #endif |
|
31 |
|
32 #include "Objective.h" |
|
33 |
|
34 Objective::Objective (void) |
|
35 { |
461
|
36 phi = 0; |
|
37 grad = 0; |
3
|
38 } |
|
39 |
|
40 Objective::Objective (const objective_fcn obj) |
|
41 { |
|
42 phi = obj; |
461
|
43 grad = 0; |
3
|
44 } |
|
45 |
|
46 Objective::Objective (const objective_fcn obj, const gradient_fcn g) |
|
47 { |
|
48 phi = obj; |
|
49 grad = g; |
|
50 } |
|
51 |
|
52 Objective::Objective (const Objective& a) |
|
53 { |
|
54 phi = a.phi; |
|
55 grad = a.grad; |
|
56 } |
|
57 |
|
58 Objective& |
|
59 Objective::operator = (const Objective& a) |
|
60 { |
|
61 phi = a.phi; |
|
62 grad = a.grad; |
|
63 return *this; |
|
64 } |
|
65 |
|
66 objective_fcn |
|
67 Objective::objective_function (void) const |
|
68 { |
|
69 return phi; |
|
70 } |
|
71 |
|
72 Objective& |
|
73 Objective::set_objective_function (const objective_fcn obj) |
|
74 { |
|
75 phi = obj; |
|
76 return *this; |
|
77 } |
|
78 |
|
79 gradient_fcn |
|
80 Objective::gradient_function (void) const |
|
81 { |
|
82 return grad; |
|
83 } |
|
84 |
|
85 Objective& |
|
86 Objective::set_gradient_function (const gradient_fcn g) |
|
87 { |
|
88 grad = g; |
|
89 return *this; |
|
90 } |
|
91 |
|
92 /* |
|
93 ;;; Local Variables: *** |
|
94 ;;; mode: C++ *** |
|
95 ;;; page-delimiter: "^/\\*" *** |
|
96 ;;; End: *** |
|
97 */ |