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