3
|
1 // NLP.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_NLP_h) |
|
25 #define octave_NLP_h 1 |
|
26 |
465
|
27 #include "dColVector.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 |
287
|
63 ~NLP (void); |
|
64 |
|
65 NLP& operator = (const NLP& a); |
|
66 |
3
|
67 int size (void) const; |
|
68 |
|
69 protected: |
|
70 |
|
71 Vector x; |
|
72 Objective phi; |
|
73 Bounds bnds; |
|
74 LinConst lc; |
|
75 NLConst nlc; |
|
76 }; |
|
77 |
|
78 inline NLP::NLP (void) {} |
|
79 |
|
80 inline NLP::NLP (const Vector& xx, const Objective& obj) |
|
81 : x (xx), phi (obj) {} |
|
82 |
|
83 inline NLP::NLP (const Vector& xx, const Objective& obj, const Bounds& b) |
|
84 : x (xx), phi (obj), bnds (b) {} |
|
85 |
|
86 inline NLP::NLP (const Vector& xx, const Objective& obj, const Bounds& b, |
|
87 const LinConst& l) |
|
88 : x (xx), phi (obj), bnds (b), lc (l) {} |
|
89 |
|
90 inline NLP::NLP (const Vector& xx, const Objective& obj, const Bounds& b, |
|
91 const LinConst& l, const NLConst& nl) |
|
92 : x (xx), phi (obj), bnds (b), lc (l), nlc (nl) {} |
|
93 |
|
94 inline NLP::NLP (const Vector& xx, const Objective& obj, const LinConst& l) |
|
95 : x (xx), phi (obj), lc (l) {} |
|
96 |
|
97 inline NLP::NLP (const Vector& xx, const Objective& obj, const LinConst& l, |
|
98 const NLConst& nl) |
|
99 : x (xx), phi (obj), lc (l), nlc (nl) {} |
|
100 |
|
101 inline NLP::NLP (const Vector& xx, const Objective& obj, const NLConst& nl) |
|
102 : x (xx), phi (obj), nlc (nl) {} |
|
103 |
|
104 inline NLP::NLP (const Vector& xx, const Objective& obj, const Bounds& b, |
|
105 const NLConst& nl) |
|
106 : x (xx), phi (obj), bnds (b), nlc (nl) {} |
|
107 |
287
|
108 inline NLP::~NLP (void) { } |
|
109 |
|
110 inline NLP& |
|
111 NLP::operator = (const NLP& a) |
|
112 { |
|
113 if (this != &a) |
|
114 { |
|
115 x = a.x; |
|
116 phi = a.phi; |
|
117 bnds = a.bnds; |
|
118 lc = a.lc; |
|
119 nlc = a.nlc; |
|
120 } |
|
121 |
|
122 return *this; |
|
123 } |
|
124 |
3
|
125 inline int |
|
126 NLP::size (void) const |
|
127 { |
|
128 return x.capacity (); |
|
129 } |
|
130 |
|
131 #endif |
|
132 |
|
133 /* |
|
134 ;;; Local Variables: *** |
|
135 ;;; mode: C++ *** |
|
136 ;;; page-delimiter: "^/\\*" *** |
|
137 ;;; End: *** |
|
138 */ |