3
|
1 // Objective.h -*- 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 |
382
|
24 #if !defined (octave_Objective_h) |
|
25 #define octave_Objective_h 1 |
|
26 |
1296
|
27 #if defined (__GNUG__) |
|
28 #pragma interface |
|
29 #endif |
3
|
30 |
1296
|
31 #include "dColVector.h" |
3
|
32 |
|
33 #ifndef Vector |
|
34 #define Vector ColumnVector |
|
35 #endif |
|
36 |
1206
|
37 typedef double (*objective_fcn) (const Vector&); |
|
38 typedef Vector (*gradient_fcn) (const Vector&); |
3
|
39 |
|
40 class Objective |
|
41 { |
|
42 public: |
|
43 |
|
44 Objective (void); |
|
45 Objective (const objective_fcn); |
|
46 Objective (const objective_fcn, const gradient_fcn); |
|
47 |
|
48 Objective (const Objective& a); |
|
49 |
|
50 Objective& operator = (const Objective& a); |
|
51 |
|
52 objective_fcn objective_function (void) const; |
|
53 |
|
54 Objective& set_objective_function (const objective_fcn); |
|
55 |
|
56 gradient_fcn gradient_function (void) const; |
|
57 |
|
58 Objective& set_gradient_function (const gradient_fcn); |
|
59 |
|
60 private: |
|
61 |
|
62 objective_fcn phi; |
|
63 gradient_fcn grad; |
|
64 |
|
65 }; |
|
66 |
|
67 #endif |
|
68 |
|
69 /* |
|
70 ;;; Local Variables: *** |
|
71 ;;; mode: C++ *** |
|
72 ;;; page-delimiter: "^/\\*" *** |
|
73 ;;; End: *** |
|
74 */ |