Ipopt  3.12.11
 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"
17 #include "IpPDSystemSolver.hpp"
18 #include <list>
19 #include <vector>
20 
21 namespace Ipopt
22 {
23 
25  typedef struct
27  {
31  }
33 
34 
40  {
41  public:
48  {
49  //ToDo figure out if that here is necessary
50  // Clear();
51  }
53 
54 
56  // Initialize Piecewise Penalty list
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 
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;
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:
127 
129  void operator=(const PiecewisePenalty&);
131 
134 
137 
140 
142  std::vector<PiecewisePenEntry> PiecewisePenalty_list_;
143 
144  };
145 
146 
147 
148 
149 
150 
151 
152 } // namespace Ipopt
153 
154 #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.
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
Index max_piece_number_
The max number of the break points in the piecewise penalty list.
struct Ipopt::PiecewisePenEntry PiecewisePenEntry
struct for one Piecewise Penalty entry.
void UpdateEntry(Number barrier_obj, Number infeasi)
Update Piecewise Penalty entry for given coordinates.
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 &)
Overloaded Equals Operator.
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
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.
~PiecewisePenalty()
Default Destructor.
Class for the Piecewise Penalty.