comparison liboctave/NLP.h @ 1528:dc527156c38c

[project @ 1995-10-05 01:44:18 by jwe]
author jwe
date Thu, 05 Oct 1995 01:45:30 +0000
parents 611d403c7f3d
children 12a94a17509d
comparison
equal deleted inserted replaced
1527:13d27938e778 1528:dc527156c38c
27 #include "dColVector.h" 27 #include "dColVector.h"
28 #include "Objective.h" 28 #include "Objective.h"
29 #include "Bounds.h" 29 #include "Bounds.h"
30 #include "LinConst.h" 30 #include "LinConst.h"
31 #include "NLConst.h" 31 #include "NLConst.h"
32 #include "base-min.h"
32 33
33 #ifndef Vector 34 class NLP : public base_minimizer
34 #define Vector ColumnVector
35 #endif
36
37 class NLP
38 { 35 {
39 public: 36 public:
40 37
41 NLP (void); 38 NLP (void) : base_minimizer () { }
42 39
43 NLP (const Vector& x, const Objective& phi); 40 NLP (const ColumnVector& x, const Objective& obj)
41 : base_minimizer (x), phi (obj) { }
44 42
45 NLP (const Vector& x, const Objective& phi, const Bounds& b); 43 NLP (const ColumnVector& x, const Objective& obj, const Bounds& b)
44 : base_minimizer (x), phi (obj), bnds (b) { }
46 45
47 NLP (const Vector& x, const Objective& phi, const Bounds& b, const 46 NLP (const ColumnVector& x, const Objective& obj, const Bounds& b,
48 LinConst& lc); 47 const LinConst& l)
48 : base_minimizer (x), phi (obj), bnds (b), lc (l) { }
49 49
50 NLP (const Vector& x, const Objective& phi, const Bounds& b, const 50 NLP (const ColumnVector& x, const Objective& obj, const Bounds& b,
51 LinConst& lc, const NLConst& nlc); 51 const LinConst& l, const NLConst& nl)
52 : base_minimizer (x), phi (obj), bnds (b), lc (l), nlc (nl) { }
52 53
53 NLP (const Vector& x, const Objective& phi, const LinConst& lc); 54 NLP (const ColumnVector& x, const Objective& obj, const LinConst& l)
55 : base_minimizer (x), phi (obj), lc (l) { }
54 56
55 NLP (const Vector& x, const Objective& phi, const LinConst& lc, 57 NLP (const ColumnVector& x, const Objective& obj, const LinConst& l,
56 const NLConst& nlc); 58 const NLConst& nl)
59 : base_minimizer (x), phi (obj), lc (l), nlc (nl) { }
57 60
58 NLP (const Vector& x, const Objective& phi, const NLConst& nlc); 61 NLP (const ColumnVector& x, const Objective& obj, const NLConst& nl)
62 : base_minimizer (x), phi (obj), nlc (nl) { }
59 63
60 NLP (const Vector& x, const Objective& phi, const Bounds& b, const 64 NLP (const ColumnVector& x, const Objective& obj, const Bounds& b,
61 NLConst& nlc); 65 const NLConst& nl)
66 : base_minimizer (x), phi (obj), bnds (b), nlc (nl) { }
62 67
63 ~NLP (void); 68 NLP& operator = (const NLP& a)
69 {
70 if (this != &a)
71 {
72 x = a.x;
73 phi = a.phi;
74 bnds = a.bnds;
75 lc = a.lc;
76 nlc = a.nlc;
77 }
64 78
65 NLP& operator = (const NLP& a); 79 return *this;
80 }
66 81
67 int size (void) const; 82 virtual ~NLP (void) { }
83
84 int size (void) const { return x.capacity (); }
68 85
69 protected: 86 protected:
70 87
71 Vector x;
72 Objective phi; 88 Objective phi;
73 Bounds bnds; 89 Bounds bnds;
74 LinConst lc; 90 LinConst lc;
75 NLConst nlc; 91 NLConst nlc;
76 }; 92 };
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
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
125 inline int
126 NLP::size (void) const
127 {
128 return x.capacity ();
129 }
130 93
131 #endif 94 #endif
132 95
133 /* 96 /*
134 ;;; Local Variables: *** 97 ;;; Local Variables: ***