3
|
1 // QPSOL.h -*- C++ -*- |
|
2 /* |
|
3 |
296
|
4 Copyright (C) 1992, 1993, 1994 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 |
382
|
24 #if !defined (octave_QPSOL_h) |
|
25 #define octave_QPSOL_h 1 |
|
26 |
645
|
27 #ifndef QPSOL_MISSING |
|
28 |
465
|
29 #if defined (__GNUG__) |
|
30 #pragma interface |
|
31 #endif |
|
32 |
|
33 #include "dMatrix.h" |
|
34 #include "dColVector.h" |
3
|
35 #include "QP.h" |
|
36 |
384
|
37 extern "C++" { |
|
38 |
3
|
39 #ifndef Vector |
|
40 #define Vector ColumnVector |
|
41 #endif |
|
42 |
289
|
43 class QPSOL_options |
|
44 { |
|
45 public: |
|
46 |
|
47 QPSOL_options (void); |
|
48 QPSOL_options (const QPSOL_options& opt); |
|
49 |
|
50 QPSOL_options& operator = (const QPSOL_options& opt); |
|
51 |
|
52 ~QPSOL_options (void); |
|
53 |
|
54 void init (void); |
|
55 void copy (const QPSOL_options& opt); |
|
56 |
|
57 void set_default_options (void); |
|
58 |
|
59 void set_feasibility_tolerance (double); |
|
60 void set_infinite_bound (double); |
|
61 void set_iteration_limit (int); |
|
62 void set_print_level (int); |
|
63 |
|
64 double feasibility_tolerance (void); |
|
65 double infinite_bound (void); |
|
66 int iteration_limit (void); |
|
67 int print_level (void); |
|
68 |
|
69 private: |
|
70 |
|
71 double x_feasibility_tolerance; |
|
72 double x_infinite_bound; |
|
73 int x_iteration_limit; |
|
74 int x_print_level; |
|
75 }; |
|
76 |
|
77 class QPSOL : public QP, public QPSOL_options |
3
|
78 { |
|
79 public: |
|
80 |
|
81 QPSOL (void) : QP () |
289
|
82 { } |
3
|
83 |
|
84 QPSOL (const Vector& x, const Matrix& H) : QP (x, H) |
289
|
85 { } |
3
|
86 |
|
87 QPSOL (const Vector& x, const Matrix& H, const Vector& c) : QP (x, H, c) |
289
|
88 { } |
3
|
89 |
|
90 QPSOL (const Vector& x, const Matrix& H, const Bounds& b) : QP (x, H, b) |
289
|
91 { } |
3
|
92 |
|
93 QPSOL (const Vector& x, const Matrix& H, const LinConst& lc) : QP (x, H, lc) |
289
|
94 { } |
3
|
95 |
|
96 QPSOL (const Vector& x, const Matrix& H, const Vector& c, const Bounds& b) |
289
|
97 : QP (x, H, c, b) { } |
3
|
98 |
|
99 QPSOL (const Vector& x, const Matrix& H, const Vector& c, const LinConst& lc) |
289
|
100 : QP (x, H, c, lc) { } |
3
|
101 |
|
102 QPSOL (const Vector& x, const Matrix& H, const Bounds& b, const LinConst& lc) |
289
|
103 : QP (x, H, b, lc) { } |
3
|
104 |
|
105 QPSOL (const Vector& x, const Matrix& H, const Vector& c, const Bounds& b, |
|
106 const LinConst& lc) |
289
|
107 : QP (x, H, c, b, lc) { } |
3
|
108 |
|
109 QPSOL (const QPSOL& a); |
|
110 |
|
111 QPSOL& operator = (const QPSOL& a); |
|
112 |
|
113 Vector minimize (double& objf, int& inform, Vector& lambda); |
|
114 }; |
|
115 |
|
116 inline QPSOL::QPSOL (const QPSOL& a) : QP (a.x, a.H, a.c, a.bnds, a.lc) |
289
|
117 { } |
3
|
118 |
|
119 inline QPSOL& |
|
120 QPSOL::operator = (const QPSOL& a) |
|
121 { |
|
122 x = a.x; |
|
123 H = a.H; |
|
124 c = a.c; |
|
125 bnds = a.bnds; |
|
126 lc = a.lc; |
|
127 return *this; |
|
128 } |
|
129 |
645
|
130 } // extern "C++" |
238
|
131 |
645
|
132 #endif /* QPSOL_MISSING */ |
382
|
133 |
3
|
134 #endif |
|
135 |
|
136 /* |
|
137 ;;; Local Variables: *** |
|
138 ;;; mode: C++ *** |
|
139 ;;; page-delimiter: "^/\\*" *** |
|
140 ;;; End: *** |
|
141 */ |