3
|
1 // QP.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_QP_h) |
|
25 #define octave_QP_h 1 |
|
26 |
1296
|
27 #if defined (__GNUG__) |
|
28 #pragma interface |
|
29 #endif |
|
30 |
463
|
31 #include "dMatrix.h" |
|
32 #include "dColVector.h" |
3
|
33 #include "Bounds.h" |
|
34 #include "LinConst.h" |
1528
|
35 #include "base-min.h" |
3
|
36 |
1528
|
37 class QP : public base_minimizer |
3
|
38 { |
|
39 public: |
|
40 |
1528
|
41 QP (void) : base_minimizer () { } |
|
42 |
|
43 QP (const ColumnVector& x, const Matrix& H_arg) |
|
44 : base_minimizer (x), H (H_arg) |
|
45 { make_h_symmetric (); } |
|
46 |
|
47 QP (const ColumnVector& x, const Matrix& H_arg, const ColumnVector& c_arg) |
|
48 : base_minimizer (x), H (H_arg), c (c_arg) |
|
49 { make_h_symmetric (); } |
|
50 |
|
51 QP (const ColumnVector& x, const Matrix& H_arg, const Bounds& b) |
|
52 : base_minimizer (x), H (H_arg), bnds (b) |
|
53 { make_h_symmetric (); } |
|
54 |
|
55 QP (const ColumnVector& x, const Matrix& H_arg, const LinConst& l) |
|
56 : base_minimizer (x), H (H_arg), lc (l) |
|
57 { make_h_symmetric (); } |
3
|
58 |
1528
|
59 QP (const ColumnVector& x, const Matrix& H_arg, const ColumnVector& c_arg, |
|
60 const Bounds& b) |
|
61 : base_minimizer (x), H (H_arg), c (c_arg), bnds (b) |
|
62 { make_h_symmetric (); } |
|
63 |
|
64 QP (const ColumnVector& x, const Matrix& H_arg, const ColumnVector& c_arg, |
|
65 const LinConst& l) |
|
66 : base_minimizer (x), H (H_arg), c (c_arg), lc (l) |
|
67 { make_h_symmetric (); } |
3
|
68 |
1528
|
69 QP (const ColumnVector& x, const Matrix& H_arg, const Bounds& b, |
|
70 const LinConst& l) |
|
71 : base_minimizer (x), H (H_arg), bnds (b), lc (l) |
|
72 { make_h_symmetric (); } |
|
73 |
|
74 QP (const ColumnVector& x, const Matrix& H_arg, const ColumnVector& c_arg, |
|
75 const Bounds& b, const LinConst& l) |
|
76 : base_minimizer (x), H (H_arg), c (c_arg), bnds (b), lc (l) |
|
77 { make_h_symmetric (); } |
|
78 |
|
79 virtual ~QP (void) { } |
3
|
80 |
|
81 protected: |
|
82 |
1528
|
83 ColumnVector x; |
3
|
84 Matrix H; |
1528
|
85 ColumnVector c; |
3
|
86 Bounds bnds; |
|
87 LinConst lc; |
|
88 |
|
89 private: |
|
90 |
1528
|
91 Matrix make_h_symmetric (void) { return 0.5 * (H + H.transpose ()); } |
3
|
92 }; |
|
93 |
|
94 #endif |
|
95 |
|
96 /* |
|
97 ;;; Local Variables: *** |
|
98 ;;; mode: C++ *** |
|
99 ;;; page-delimiter: "^/\\*" *** |
|
100 ;;; End: *** |
|
101 */ |