Ipopt  3.11.4
 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