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