3
|
1 // NLP.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 (_NLP_h) |
|
25 #define _NLP_h 1 |
|
26 |
238
|
27 #include "Matrix.h" |
3
|
28 #include "Objective.h" |
|
29 #include "Bounds.h" |
|
30 #include "LinConst.h" |
|
31 #include "NLConst.h" |
|
32 |
|
33 #ifndef Vector |
|
34 #define Vector ColumnVector |
|
35 #endif |
|
36 |
|
37 class NLP |
|
38 { |
|
39 public: |
|
40 |
|
41 NLP (void); |
|
42 |
|
43 NLP (const Vector& x, const Objective& phi); |
|
44 |
|
45 NLP (const Vector& x, const Objective& phi, const Bounds& b); |
|
46 |
|
47 NLP (const Vector& x, const Objective& phi, const Bounds& b, const |
|
48 LinConst& lc); |
|
49 |
|
50 NLP (const Vector& x, const Objective& phi, const Bounds& b, const |
|
51 LinConst& lc, const NLConst& nlc); |
|
52 |
|
53 NLP (const Vector& x, const Objective& phi, const LinConst& lc); |
|
54 |
|
55 NLP (const Vector& x, const Objective& phi, const LinConst& lc, |
|
56 const NLConst& nlc); |
|
57 |
|
58 NLP (const Vector& x, const Objective& phi, const NLConst& nlc); |
|
59 |
|
60 NLP (const Vector& x, const Objective& phi, const Bounds& b, const |
|
61 NLConst& nlc); |
|
62 |
|
63 int size (void) const; |
|
64 |
|
65 protected: |
|
66 |
|
67 Vector x; |
|
68 Objective phi; |
|
69 Bounds bnds; |
|
70 LinConst lc; |
|
71 NLConst nlc; |
|
72 }; |
|
73 |
|
74 inline NLP::NLP (void) {} |
|
75 |
|
76 inline NLP::NLP (const Vector& xx, const Objective& obj) |
|
77 : x (xx), phi (obj) {} |
|
78 |
|
79 inline NLP::NLP (const Vector& xx, const Objective& obj, const Bounds& b) |
|
80 : x (xx), phi (obj), bnds (b) {} |
|
81 |
|
82 inline NLP::NLP (const Vector& xx, const Objective& obj, const Bounds& b, |
|
83 const LinConst& l) |
|
84 : x (xx), phi (obj), bnds (b), lc (l) {} |
|
85 |
|
86 inline NLP::NLP (const Vector& xx, const Objective& obj, const Bounds& b, |
|
87 const LinConst& l, const NLConst& nl) |
|
88 : x (xx), phi (obj), bnds (b), lc (l), nlc (nl) {} |
|
89 |
|
90 inline NLP::NLP (const Vector& xx, const Objective& obj, const LinConst& l) |
|
91 : x (xx), phi (obj), lc (l) {} |
|
92 |
|
93 inline NLP::NLP (const Vector& xx, const Objective& obj, const LinConst& l, |
|
94 const NLConst& nl) |
|
95 : x (xx), phi (obj), lc (l), nlc (nl) {} |
|
96 |
|
97 inline NLP::NLP (const Vector& xx, const Objective& obj, const NLConst& nl) |
|
98 : x (xx), phi (obj), nlc (nl) {} |
|
99 |
|
100 inline NLP::NLP (const Vector& xx, const Objective& obj, const Bounds& b, |
|
101 const NLConst& nl) |
|
102 : x (xx), phi (obj), bnds (b), nlc (nl) {} |
|
103 |
|
104 inline int |
|
105 NLP::size (void) const |
|
106 { |
|
107 return x.capacity (); |
|
108 } |
|
109 |
|
110 #endif |
|
111 |
|
112 /* |
|
113 ;;; Local Variables: *** |
|
114 ;;; mode: C++ *** |
|
115 ;;; page-delimiter: "^/\\*" *** |
|
116 ;;; End: *** |
|
117 */ |