Ipopt Documentation  
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 // Authors: Lifeng Chen/Zaiwen Wen Columbia Univ
6 
7 #ifndef __IPPIECEWISEPENALTY_HPP__
8 #define __IPPIECEWISEPENALTY_HPP__
9 
10 #include "IpJournalist.hpp"
11 #include "IpDebug.hpp"
12 #include "IpOptionsList.hpp"
15 #include "IpPDSystemSolver.hpp"
16 #include <list>
17 #include <vector>
18 
19 namespace Ipopt
20 {
21 
23 typedef struct PiecewisePenEntry
24 {
29 
37 {
38 public:
40 
43  Index dim);
46  {
47  // ToDo figure out if that here is necessary
48  // Clear();
49  }
51 
53  // Initialize Piecewise Penalty list
55  {
56  return PiecewisePenalty_list_.empty();
57  }
58 
60  Number pen_r,
61  Number barrier_obj,
62  Number infeasi)
63  {
64  AddEntry(pen_r, barrier_obj, infeasi);
65  }
66 
72  bool Acceptable(
73  Number Fzconst,
74  Number Fzlin
75  );
76 
79 
81  void UpdateEntry(
82  Number barrier_obj,
83  Number infeasi );
84 
86  void AddEntry(
87  Number pen_r,
88  Number barrier_obj,
89  Number infeasi
90  )
91  {
92  PiecewisePenEntry TmpEntry;
94  {
95  TmpEntry.pen_r = 0.0;
96  }
97  else
98  {
99  TmpEntry.pen_r = pen_r;
100  }
101  TmpEntry.barrier_obj = barrier_obj;
102  TmpEntry.infeasi = infeasi;
103  PiecewisePenalty_list_.push_back(TmpEntry);
104  }
105 
107  void ResetList(
108  Number pen_r,
109  Number barrier_obj,
110  Number infeasi
111  )
112  {
113  PiecewisePenalty_list_.clear();
114  AddEntry(pen_r, barrier_obj, infeasi);
115  }
116 
118 
120  void Clear()
121  {
122  PiecewisePenalty_list_.clear();
123  }
124 
126  void Print(
127  const Journalist& jnlst
128  );
129 
130 private:
140 
145  const PiecewisePenalty&
146  );
147 
149  void operator=(
150  const PiecewisePenalty&
151  );
153 
156 
159 
162 
164  std::vector<PiecewisePenEntry> PiecewisePenalty_list_;
165 };
166 
167 } // namespace Ipopt
168 
169 #endif
void AddEntry(Number pen_r, Number barrier_obj, Number infeasi)
Add a entry to the list.
struct for one Piecewise Penalty entry.
std::vector< PiecewisePenEntry > PiecewisePenalty_list_
vector storing the Piecewise Penalty entries
PiecewisePenalty()
Default Constructor.
bool Acceptable(Number Fzconst, Number Fzlin)
Check acceptability of given coordinates with respect to the Piecewise Penalty.
Index max_piece_number_
The max number of the break points in the piecewise penalty list.
ipindex Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:20
This file contains a base class for all exceptions and a set of macros to help with exceptions...
void UpdateEntry(Number barrier_obj, Number infeasi)
Update Piecewise Penalty entry for given coordinates.
struct Ipopt::PiecewisePenEntry PiecewisePenEntry
struct for one Piecewise Penalty entry.
void InitPiecewisePenaltyList(Number pen_r, Number barrier_obj, Number infeasi)
Index dim_
Dimension of the Piecewise Penalty (number of coordinates per entry)
Number BiggestBarr()
Get the value of the biggest barrier function so far.
Number min_piece_penalty_
The min penalty value for the piecewise penalty list.
void Print(const Journalist &jnlst)
Print current Piecewise Penalty entries.
void operator=(const PiecewisePenalty &)
Default Assignment Operator.
ipnumber Number
Type of all numbers.
Definition: IpTypes.hpp:17
void Clear()
Delete all Piecewise Penalty entries.
void ResetList(Number pen_r, Number barrier_obj, Number infeasi)
Clear and reset the piecewise penalty list.
Class responsible for all message output.
Class for the Piecewise Penalty.