Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IpPiecewisePenalty.hpp
Go to the documentation of this file.
1 // Copyright (C) 2007 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id: IpPiecewisePenalty.hpp 1861 2010-12-21 21:34:47Z andreasw $
6 //
7 // Authors: Lifeng Chen/Zaiwen Wen Columbia Univ
8
9 #ifndef __IPPIECEWISEPENALTY_HPP__
10 #define __IPPIECEWISEPENALTY_HPP__
11
12 #include "IpJournalist.hpp"
13 #include "IpDebug.hpp"
14 #include "IpOptionsList.hpp"
15 #include "IpIpoptCalculatedQuantities.hpp"
16 #include "IpBacktrackingLSAcceptor.hpp"
17 #include "IpPDSystemSolver.hpp"
18 #include <list>
19 #include <vector>
20
21 namespace Ipopt
22 {
23
25 typedef struct
26 PiecewisePenEntry
27 {
28 Number pen_r;
29 Number barrier_obj;
30 Number infeasi;
31 }
32 PiecewisePenEntry;
33
34
39 class PiecewisePenalty
40 {
41 public:
45 PiecewisePenalty(Index dim);
47 ~PiecewisePenalty()
48 {
49 //ToDo figure out if that here is necessary
50 // Clear();
51 }
53
54
56 // Initialize Piecewise Penalty list
57 bool IsPiecewisePenaltyListEmpty()
58 {
59 return PiecewisePenalty_list_.empty();
60 }
61
62 void InitPiecewisePenaltyList(Number pen_r, Number barrier_obj, Number infeasi)
63 {
64 AddEntry( pen_r, barrier_obj, infeasi);
65 }
66
70 bool Acceptable(Number Fzconst, Number Fzlin);
71
73 Number BiggestBarr();
74
77 void UpdateEntry(Number barrier_obj, Number infeasi);
78
81 void AddEntry(Number pen_r, Number barrier_obj, Number infeasi)
82 {
83 PiecewisePenEntry TmpEntry;
84 if (IsPiecewisePenaltyListEmpty()) {
85 TmpEntry.pen_r = 0.0;
86 }
87 else {
88 TmpEntry.pen_r = pen_r;
89 }
90 TmpEntry.barrier_obj = barrier_obj;
91 TmpEntry.infeasi = infeasi;
92 PiecewisePenalty_list_.push_back(TmpEntry);
93 }
94
97 void ResetList(Number pen_r, Number barrier_obj, Number infeasi)
98 {
99 PiecewisePenalty_list_.clear();
100 AddEntry( pen_r, barrier_obj, infeasi);
101 }
102
104
106 void Clear()
107 {
108 PiecewisePenalty_list_.clear();
109 }
110
112 void Print(const Journalist& jnlst);
113
114 private:
124 PiecewisePenalty();
126 PiecewisePenalty(const PiecewisePenalty&);
127
129 void operator=(const PiecewisePenalty&);
131
133 Index dim_;
134
136 Number min_piece_penalty_;
137
139 Index max_piece_number_;
140
142 std::vector<PiecewisePenEntry> PiecewisePenalty_list_;
143
144 };
145
146
147
148
149
150
151
152 } // namespace Ipopt
153
154 #endif
Ipopt::PiecewisePenalty::AddEntry
void AddEntry(Number pen_r, Number barrier_obj, Number infeasi)
Add a entry to the list.
Definition: IpPiecewisePenalty.hpp:81
Ipopt::PiecewisePenEntry
struct for one Piecewise Penalty entry.
Definition: IpPiecewisePenalty.hpp:25
Ipopt::PiecewisePenalty::PiecewisePenalty_list_
std::vector< PiecewisePenEntry > PiecewisePenalty_list_
vector storing the Piecewise Penalty entries
Definition: IpPiecewisePenalty.hpp:142
IpPDSystemSolver.hpp
Ipopt::PiecewisePenalty::PiecewisePenalty
PiecewisePenalty()
Default Constructor.
Ipopt::PiecewisePenEntry::infeasi
Number infeasi
Definition: IpPiecewisePenalty.hpp:30
IpIpoptCalculatedQuantities.hpp
Ipopt::PiecewisePenalty::Acceptable
bool Acceptable(Number Fzconst, Number Fzlin)
Check acceptability of given coordinates with respect to the Piecewise Penalty.
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
Ipopt::PiecewisePenalty::max_piece_number_
Index max_piece_number_
The max number of the break points in the piecewise penalty list.
Definition: IpPiecewisePenalty.hpp:139
Ipopt::PiecewisePenEntry
struct Ipopt::PiecewisePenEntry PiecewisePenEntry
struct for one Piecewise Penalty entry.
IpBacktrackingLSAcceptor.hpp
Ipopt::PiecewisePenEntry::barrier_obj
Number barrier_obj
Definition: IpPiecewisePenalty.hpp:29
Ipopt::PiecewisePenalty::UpdateEntry
void UpdateEntry(Number barrier_obj, Number infeasi)
Update Piecewise Penalty entry for given coordinates.
Ipopt::PiecewisePenalty::InitPiecewisePenaltyList
void InitPiecewisePenaltyList(Number pen_r, Number barrier_obj, Number infeasi)
Definition: IpPiecewisePenalty.hpp:62
Ipopt::PiecewisePenalty::dim_
Index dim_
Dimension of the Piecewise Penalty (number of coordinates per entry)
Definition: IpPiecewisePenalty.hpp:133
Ipopt::PiecewisePenalty::BiggestBarr
Number BiggestBarr()
Get the value of the biggest barrier function so far.
Ipopt::PiecewisePenalty::IsPiecewisePenaltyListEmpty
bool IsPiecewisePenaltyListEmpty()
Definition: IpPiecewisePenalty.hpp:57
Ipopt::PiecewisePenalty::min_piece_penalty_
Number min_piece_penalty_
The min penalty value for the piecewise penalty list.
Definition: IpPiecewisePenalty.hpp:136
IpDebug.hpp
Ipopt::PiecewisePenalty::Print
void Print(const Journalist &jnlst)
Print current Piecewise Penalty entries.
Ipopt::PiecewisePenalty::operator=
void operator=(const PiecewisePenalty &)
Overloaded Equals Operator.
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::PiecewisePenalty::Clear
void Clear()
Delete all Piecewise Penalty entries.
Definition: IpPiecewisePenalty.hpp:106
Ipopt::PiecewisePenalty::ResetList
void ResetList(Number pen_r, Number barrier_obj, Number infeasi)
Clear and reset the piecewise penalty list.
Definition: IpPiecewisePenalty.hpp:97
IpOptionsList.hpp
IpJournalist.hpp
Ipopt::Journalist
Class responsible for all message output.
Definition: IpJournalist.hpp:134
Ipopt::PiecewisePenalty::~PiecewisePenalty
~PiecewisePenalty()
Default Destructor.
Definition: IpPiecewisePenalty.hpp:47
Ipopt::PiecewisePenEntry::pen_r
Number pen_r
Definition: IpPiecewisePenalty.hpp:28
Ipopt::PiecewisePenalty
Class for the Piecewise Penalty.
Definition: IpPiecewisePenalty.hpp:39