3
|
1 // NPSOL.h -*- 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 #if !defined (_NPSOL_h) |
|
25 #define _NPSOL_h 1 |
|
26 |
238
|
27 #ifndef NPSOL_MISSING |
3
|
28 |
238
|
29 #include "Matrix.h" |
3
|
30 #include "NLP.h" |
|
31 |
|
32 #ifndef Vector |
|
33 #define Vector ColumnVector |
|
34 #endif |
|
35 |
|
36 class NPSOL : public NLP |
|
37 { |
|
38 public: |
|
39 |
|
40 NPSOL (void) : NLP () |
|
41 { set_default_options (); } |
|
42 |
|
43 NPSOL (const Vector& x, const Objective& phi) : NLP (x, phi) |
|
44 { set_default_options (); } |
|
45 |
|
46 NPSOL (const Vector& x, const Objective& phi, |
|
47 const Bounds& b) : NLP (x, phi, b) |
|
48 { set_default_options (); } |
|
49 |
|
50 NPSOL (const Vector& x, const Objective& phi, const Bounds& b, |
|
51 const LinConst& lc) : NLP (x, phi, b, lc) |
|
52 { set_default_options (); } |
|
53 |
|
54 NPSOL (const Vector& x, const Objective& phi, const Bounds& b, |
|
55 const LinConst& lc, const NLConst& nlc) : NLP (x, phi, b, lc, nlc) |
|
56 { set_default_options (); } |
|
57 |
|
58 NPSOL (const Vector& x, const Objective& phi, |
|
59 const LinConst& lc) : NLP (x, phi, lc) |
|
60 { set_default_options (); } |
|
61 |
|
62 NPSOL (const Vector& x, const Objective& phi, const LinConst& lc, |
|
63 const NLConst& nlc) : NLP (x, phi, lc, nlc) |
|
64 { set_default_options (); } |
|
65 |
|
66 NPSOL (const Vector& x, const Objective& phi, |
|
67 const NLConst& nlc) : NLP (x, phi, nlc) |
|
68 { set_default_options (); } |
|
69 |
|
70 NPSOL (const Vector& x, const Objective& phi, const Bounds& b, |
|
71 const NLConst& nlc) : NLP (x, phi, b, nlc) |
|
72 { set_default_options (); } |
|
73 |
|
74 NPSOL (const NPSOL& a); |
|
75 |
|
76 NPSOL& operator = (const NPSOL& a); |
|
77 |
|
78 Vector minimize (void); |
|
79 Vector minimize (double& objf); |
|
80 Vector minimize (double& objf, int& inform); |
|
81 Vector minimize (double& objf, int& inform, Vector& lambda); |
|
82 |
|
83 Vector minimize (const Vector& x); |
|
84 Vector minimize (const Vector& x, double& objf); |
|
85 Vector minimize (const Vector& x, double& objf, int& inform); |
|
86 Vector minimize (const Vector& x, double& objf, int& inform, Vector& lambda); |
|
87 |
|
88 NPSOL& option (char *s); |
|
89 |
|
90 private: |
|
91 void set_default_options (void); |
|
92 |
|
93 }; |
|
94 |
|
95 inline NPSOL::NPSOL (const NPSOL& a) : NLP (a.x, a.phi, a.bnds, a.lc, a.nlc) |
|
96 { set_default_options (); } |
|
97 |
|
98 inline NPSOL& |
|
99 NPSOL::operator = (const NPSOL& a) |
|
100 { |
|
101 x = a.x; |
|
102 phi = a.phi; |
|
103 bnds = a.bnds; |
|
104 lc = a.lc; |
|
105 nlc = a.nlc; |
|
106 |
|
107 cerr << "warning: NPSOL options reset to default values\n"; |
|
108 |
|
109 set_default_options (); |
|
110 |
|
111 return *this; |
|
112 } |
|
113 |
238
|
114 #endif /* NPSOL_MISSING */ |
3
|
115 |
238
|
116 #endif |
3
|
117 |
|
118 /* |
|
119 ;;; Local Variables: *** |
|
120 ;;; mode: C++ *** |
|
121 ;;; page-delimiter: "^/\\*" *** |
|
122 ;;; End: *** |
|
123 */ |