ROL
ROL_RiskBoundConstraint.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Rapid Optimization Library (ROL) Package
4 //
5 // Copyright 2014 NTESS and the ROL contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef ROL_RISK_BOUND_CONSTRAINT_H
11 #define ROL_RISK_BOUND_CONSTRAINT_H
12 
14 #include "ROL_RiskVector.hpp"
15 #include "ROL_Types.hpp"
16 
17 namespace ROL {
18 
19 template <class Real>
20 class RiskBoundConstraint : public BoundConstraint<Real> {
21 private:
22  Ptr<BoundConstraint<Real>> bc_;
23 
24  Ptr<StdBoundConstraint<Real>> statObj_bc_;
25  std::vector<Real> lowerObj_, upperObj_;
26 
27  std::vector<Ptr<StdBoundConstraint<Real>>> statCon_bc_;
28  std::vector<std::vector<Real>> lowerCon_, upperCon_;
29 
31  int nStatObj_;
32 
34  std::vector<bool> activatedCon_;
35  std::vector<int> nStatCon_;
36 
38  mutable Ptr<RiskVector<Real>> lo_, hi_;
39 
40  void setBoundInfo(ParameterList &parlist,
41  int &nStat,
42  std::vector<Real> &lower,
43  std::vector<Real> &upper,
44  bool &augmented,
45  bool &activated) {
46  lower.clear(); upper.clear();
47  // Get stochastic optimization information
48  std::string optType = parlist.sublist("SOL").get("Type","Risk Averse");
49  if ( optType == "Risk Averse" ||
50  optType == "Deviation" ||
51  optType == "Regret" ||
52  optType == "Error" ||
53  optType == "Probability" ) {
54  std::string name;
55  RandVarFunctionalInfo<Real>(parlist,name,nStat,lower,upper,activated);
56  augmented = (nStat > 0) ? true : false;
57  }
58  else if ( optType == "Risk Neutral" || optType == "Mean Value" ) {
59  augmented = false;
60  activated = false;
61  nStat = 0;
62  }
63  else {
64  ROL_TEST_FOR_EXCEPTION(true,std::invalid_argument,
65  ">>> (ROL::RiskBoundConstraint): Invalid stochastic optimization type!" << optType);
66  }
67  }
68 
69  bool buildObjStatBnd(Ptr<ParameterList> &parlist) {
70  // Objective statistic bound
71  if (parlist != nullPtr) {
73  // Build statistic bound constraint
74  if ( augmentedObj_ ) {
75  statObj_bc_ = makePtr<StdBoundConstraint<Real>>(lowerObj_,upperObj_);
76  }
77  }
78  else {
79  augmentedObj_ = false;
80  activatedObj_ = false;
81  nStatObj_ = 0;
82  statObj_bc_ = nullPtr;
83  }
84  // Determine whether or not bound constraint is activated
85  if ( !activatedObj_ ) {
86  if ( statObj_bc_ != nullPtr ) {
87  statObj_bc_->deactivate();
88  }
89  }
90  return activatedObj_;
91  }
92 
93  bool buildConStatBnd(std::vector<Ptr<ParameterList>> &parlist) {
94  // Constraint statistic bound
95  int size = parlist.size();
96  nStatCon_.clear(); nStatCon_.resize(size,0);
97  lowerCon_.clear(); lowerCon_.resize(size);
98  upperCon_.clear(); upperCon_.resize(size);
99  activatedCon_.clear(); activatedCon_.resize(size,false);
100  statCon_bc_.clear(); statCon_bc_.resize(size,nullPtr);
101  bool activated = false;
102  for (int i = 0; i < size; ++i) {
103  if ( parlist[i] != nullPtr ) {
104  bool augmented = false;
105  int nStat = 0;
106  std::vector<Real> lo, up;
107  bool act = false;
108  setBoundInfo(*parlist[i],nStat,lo,up,augmented,act);
109  nStatCon_[i] = nStat;
110  lowerCon_[i] = lo;
111  upperCon_[i] = up;
112  activatedCon_[i] = act;
113  augmentedCon_ = (augmented ? true : augmentedCon_);
114  // Build statistic bound constraint
115  if ( augmented ) {
116  statCon_bc_[i] = makePtr<StdBoundConstraint<Real>>(lowerCon_[i],upperCon_[i]);
117  }
118  }
119  else {
120  activatedCon_[i] = false;
121  nStatCon_[i] = 0;
122  statCon_bc_[i] = nullPtr;
123  }
124  if ( !activatedCon_[i] ) {
125  if ( statCon_bc_[i] != nullPtr ) {
126  statCon_bc_[i]->deactivate();
127  }
128  }
129  activated = (activatedCon_[i] ? true : activated);
130  }
131  return activated;
132  }
133 
134 public:
135 
136  // Objective risk only
137  RiskBoundConstraint(Ptr<ParameterList> &parlist,
138  const Ptr<BoundConstraint<Real>> &bc = nullPtr)
139  : BoundConstraint<Real>(), bc_(bc), statObj_bc_(nullPtr),
140  augmentedObj_(false), activatedObj_(false),
141  augmentedCon_(false),
142  isLOinitialized_(false), isHIinitialized_(false) {
143  bool activatedObj = buildObjStatBnd(parlist);
144  // Determine whether or not bound constraint is activated
146  if ( !activatedObj ) {
147  if ( bc == nullPtr || (bc != nullPtr && !bc->isActivated()) ) {
149  }
150  }
151  }
152 
153  // Constraint risk only
154  RiskBoundConstraint(std::vector<Ptr<ParameterList>> &parlist,
155  const Ptr<BoundConstraint<Real>> &bc = nullPtr)
156  : BoundConstraint<Real>(), bc_(bc), statObj_bc_(nullPtr),
157  augmentedObj_(false), activatedObj_(false),
158  augmentedCon_(false),
159  isLOinitialized_(false), isHIinitialized_(false) {
160  bool activatedCon = buildConStatBnd(parlist);
161  // Determine whether or not bound constraint is activated
163  if ( !activatedCon ) {
164  if ( bc == nullPtr || (bc != nullPtr && !bc->isActivated()) ) {
166  }
167  }
168  }
169 
170  // Objective and constraint risk
171  RiskBoundConstraint(Ptr<ParameterList> &parlistObj,
172  std::vector<Ptr<ParameterList>> &parlistCon,
173  const Ptr<BoundConstraint<Real>> &bc = nullPtr)
174  : BoundConstraint<Real>(), bc_(bc), statObj_bc_(nullPtr),
175  augmentedObj_(false), activatedObj_(false),
176  augmentedCon_(false),
177  isLOinitialized_(false), isHIinitialized_(false) {
178  bool activatedObj = buildObjStatBnd(parlistObj);
179  bool activatedCon = buildConStatBnd(parlistCon);
180  // Determine whether or not bound constraint is activated
182  if ( !activatedObj && !activatedCon ) {
183  if ( bc == nullPtr || (bc != nullPtr && !bc->isActivated()) ) {
185  }
186  }
187  }
188 
189  // Objective only -- no statistic
191  : BoundConstraint<Real>(), bc_(bc), statObj_bc_(nullPtr),
192  augmentedObj_(false), activatedObj_(false),
193  augmentedCon_(false),
194  isLOinitialized_(false), isHIinitialized_(false) {
195  activatedObj_ = bc_->isActivated();
197  if (!activatedObj_) {
199  }
200  }
201 
202  void project( Vector<Real> &x ) {
203  if ( augmentedObj_ && activatedObj_ ) {
204  Ptr<StdVector<Real>> xs = dynamic_cast<RiskVector<Real>&>(x).getStatisticVector(0);
205  statObj_bc_->project(*xs);
206  }
207  if (augmentedCon_) {
208  int size = statCon_bc_.size();
209  for (int i = 0; i < size; ++i) {
210  if (activatedCon_[i]) {
211  Ptr<StdVector<Real>> xs = dynamic_cast<RiskVector<Real>&>(x).getStatisticVector(1,i);
212  statCon_bc_[i]->project(*xs);
213  }
214  }
215  }
216  if ( bc_ != nullPtr && bc_->isActivated() ) {
217  Ptr<Vector<Real>> xvec = dynamic_cast<RiskVector<Real>&>(x).getVector();
218  bc_->project(*xvec);
219  }
220  }
221 
223  if ( augmentedObj_ && activatedObj_ ) {
224  Ptr<StdVector<Real>> xs = dynamic_cast<RiskVector<Real>&>(x).getStatisticVector(0);
225  statObj_bc_->projectInterior(*xs);
226  }
227  if (augmentedCon_) {
228  int size = statCon_bc_.size();
229  for (int i = 0; i < size; ++i) {
230  if (activatedCon_[i]) {
231  Ptr<StdVector<Real>> xs = dynamic_cast<RiskVector<Real>&>(x).getStatisticVector(1,i);
232  statCon_bc_[i]->projectInterior(*xs);
233  }
234  }
235  }
236  if ( bc_ != nullPtr && bc_->isActivated() ) {
237  Ptr<Vector<Real>> xvec = dynamic_cast<RiskVector<Real>&>(x).getVector();
238  bc_->projectInterior(*xvec);
239  }
240  }
241 
242  void pruneUpperActive( Vector<Real> &v, const Vector<Real> &x, Real eps = Real(0) ) {
243  if ( augmentedObj_ && activatedObj_ ) {
244  Ptr<StdVector<Real>> vs = dynamic_cast<RiskVector<Real>&>(v).getStatisticVector(0);
245  Ptr<const StdVector<Real>> xs = dynamic_cast<const RiskVector<Real>&>(x).getStatisticVector(0);
246  statObj_bc_->pruneUpperActive(*vs,*xs,eps);
247  }
248  if (augmentedCon_) {
249  int size = statCon_bc_.size();
250  for (int i = 0; i < size; ++i) {
251  if (activatedCon_[i]) {
252  Ptr<StdVector<Real>> vs = dynamic_cast<RiskVector<Real>&>(v).getStatisticVector(1,i);
253  Ptr<const StdVector<Real>> xs = dynamic_cast<const RiskVector<Real>&>(x).getStatisticVector(1,i);
254  statCon_bc_[i]->pruneUpperActive(*vs,*xs,eps);
255  }
256  }
257  }
258  if ( bc_ != nullPtr && bc_->isActivated() ) {
259  Ptr<Vector<Real>> vv = dynamic_cast<RiskVector<Real>&>(v).getVector();
260  Ptr<const Vector<Real>> xv = dynamic_cast<const RiskVector<Real>&>(x).getVector();
261  bc_->pruneUpperActive(*vv,*xv,eps);
262  }
263  }
264 
265  void pruneUpperActive( Vector<Real> &v, const Vector<Real> &g, const Vector<Real> &x, Real xeps = Real(0), Real geps = Real(0) ) {
266  if ( augmentedObj_ && activatedObj_ ) {
267  Ptr<StdVector<Real>> vs = dynamic_cast<RiskVector<Real>&>(v).getStatisticVector(0);
268  Ptr<const StdVector<Real>> gs = dynamic_cast<const RiskVector<Real>&>(g).getStatisticVector(0);
269  Ptr<const StdVector<Real>> xs = dynamic_cast<const RiskVector<Real>&>(x).getStatisticVector(0);
270  statObj_bc_->pruneUpperActive(*vs,*gs,*xs,xeps,geps);
271  }
272  if (augmentedCon_) {
273  int size = statCon_bc_.size();
274  for (int i = 0; i < size; ++i) {
275  if (activatedCon_[i]) {
276  Ptr<StdVector<Real>> vs = dynamic_cast<RiskVector<Real>&>(v).getStatisticVector(1,i);
277  Ptr<const StdVector<Real>> gs = dynamic_cast<const RiskVector<Real>&>(g).getStatisticVector(1,i);
278  Ptr<const StdVector<Real>> xs = dynamic_cast<const RiskVector<Real>&>(x).getStatisticVector(1,i);
279  statCon_bc_[i]->pruneUpperActive(*vs,*gs,*xs,xeps,geps);
280  }
281  }
282  }
283  if ( bc_ != nullPtr && bc_->isActivated() ) {
284  Ptr<Vector<Real>> vv = dynamic_cast<RiskVector<Real>&>(v).getVector();
285  Ptr<const Vector<Real>> gv = dynamic_cast<const RiskVector<Real>&>(g).getVector();
286  Ptr<const Vector<Real>> xv = dynamic_cast<const RiskVector<Real>&>(x).getVector();
287  bc_->pruneUpperActive(*vv,*gv,*xv,xeps,geps);
288  }
289  }
290 
291  void pruneLowerActive( Vector<Real> &v, const Vector<Real> &x, Real eps = Real(0) ) {
292  if ( augmentedObj_ && activatedObj_ ) {
293  Ptr<StdVector<Real>> vs = dynamic_cast<RiskVector<Real>&>(v).getStatisticVector(0);
294  Ptr<const StdVector<Real>> xs = dynamic_cast<const RiskVector<Real>&>(x).getStatisticVector(0);
295  statObj_bc_->pruneLowerActive(*vs,*xs,eps);
296  }
297  if (augmentedCon_) {
298  int size = statCon_bc_.size();
299  for (int i = 0; i < size; ++i) {
300  if (activatedCon_[i]) {
301  Ptr<StdVector<Real>> vs = dynamic_cast<RiskVector<Real>&>(v).getStatisticVector(1,i);
302  Ptr<const StdVector<Real>> xs = dynamic_cast<const RiskVector<Real>&>(x).getStatisticVector(1,i);
303  statCon_bc_[i]->pruneLowerActive(*vs,*xs,eps);
304  }
305  }
306  }
307  if ( bc_ != nullPtr && bc_->isActivated() ) {
308  Ptr<Vector<Real>> vv = dynamic_cast<RiskVector<Real>&>(v).getVector();
309  Ptr<const Vector<Real>> xv = dynamic_cast<const RiskVector<Real>&>(x).getVector();
310  bc_->pruneLowerActive(*vv,*xv,eps);
311  }
312  }
313 
314  void pruneLowerActive( Vector<Real> &v, const Vector<Real> &g, const Vector<Real> &x, Real xeps = Real(0), Real geps = Real(0) ) {
315  if ( augmentedObj_ && activatedObj_ ) {
316  Ptr<StdVector<Real>> vs = dynamic_cast<RiskVector<Real>&>(v).getStatisticVector(0);
317  Ptr<const StdVector<Real>> gs = dynamic_cast<const RiskVector<Real>&>(g).getStatisticVector(0);
318  Ptr<const StdVector<Real>> xs = dynamic_cast<const RiskVector<Real>&>(x).getStatisticVector(0);
319  statObj_bc_->pruneLowerActive(*vs,*gs,*xs,xeps,geps);
320  }
321  if (augmentedCon_) {
322  int size = statCon_bc_.size();
323  for (int i = 0; i < size; ++i) {
324  if (activatedCon_[i]) {
325  Ptr<StdVector<Real>> vs = dynamic_cast<RiskVector<Real>&>(v).getStatisticVector(1,i);
326  Ptr<const StdVector<Real>> gs = dynamic_cast<const RiskVector<Real>&>(g).getStatisticVector(1,i);
327  Ptr<const StdVector<Real>> xs = dynamic_cast<const RiskVector<Real>&>(x).getStatisticVector(1,i);
328  statCon_bc_[i]->pruneLowerActive(*vs,*gs,*xs,xeps,geps);
329  }
330  }
331  }
332  if ( bc_ != nullPtr && bc_->isActivated() ) {
333  Ptr<Vector<Real>> vv = dynamic_cast<RiskVector<Real>&>(v).getVector();
334  Ptr<const Vector<Real>> gv = dynamic_cast<const RiskVector<Real>&>(g).getVector();
335  Ptr<const Vector<Real>> xv = dynamic_cast<const RiskVector<Real>&>(x).getVector();
336  bc_->pruneLowerActive(*vv,*gv,*xv,xeps,geps);
337  }
338  }
339 
340  const Ptr<const Vector<Real>> getLowerBound(void) const {
341  if (!isLOinitialized_) {
342  const Ptr<const Vector<Real>> vlo = bc_->getLowerBound();
343  Ptr<std::vector<Real>> lowerObj = makePtr<std::vector<Real>>(lowerObj_);
344  int size = statCon_bc_.size();
345  std::vector<Ptr<std::vector<Real>>> lowerCon(size);
346  for (int i = 0; i < size; ++i) {
347  lowerCon[i] = makePtr<std::vector<Real>>(lowerCon_[i]);
348  }
349  lo_ = makePtr<RiskVector<Real>>(constPtrCast<Vector<Real>>(vlo),
350  lowerObj,lowerCon);
351  isLOinitialized_ = true;
352  }
353  return lo_;
354  }
355 
356  const Ptr<const Vector<Real>> getUpperBound(void) const {
357  if (!isHIinitialized_) {
358  const Ptr<const Vector<Real>> vhi = bc_->getUpperBound();
359  Ptr<std::vector<Real>> upperObj = makePtr<std::vector<Real>>(upperObj_);
360  int size = statCon_bc_.size();
361  std::vector<Ptr<std::vector<Real>>> upperCon(size);
362  for (int i = 0; i < size; ++i) {
363  upperCon[i] = makePtr<std::vector<Real>>(upperCon_[i]);
364  }
365  hi_ = makePtr<RiskVector<Real>>(constPtrCast<Vector<Real>>(vhi),
366  upperObj,upperCon);
367  isHIinitialized_ = true;
368  }
369  return hi_;
370  }
371 
372  bool isFeasible( const Vector<Real> &v ) {
373  bool flagstat = true, flagcon = true, flagvec = true;
374  if ( augmentedObj_ && activatedObj_ ) {
375  Ptr<const StdVector<Real>> vs = dynamic_cast<const RiskVector<Real>&>(v).getStatisticVector(0);
376  flagstat = statObj_bc_->isFeasible(*vs);
377  }
378  if (augmentedCon_) {
379  int size = statCon_bc_.size();
380  for (int i = 0; i < size; ++i) {
381  if (activatedCon_[i]) {
382  Ptr<const StdVector<Real>> vs = dynamic_cast<const RiskVector<Real>&>(v).getStatisticVector(1,i);
383  flagcon = (!statCon_bc_[i]->isFeasible(*vs) ? false : flagcon);
384  }
385  }
386  }
387  if ( bc_ != nullPtr && bc_->isActivated() ) {
388  Ptr<const Vector<Real>> vv = dynamic_cast<const RiskVector<Real>&>(v).getVector();
389  flagvec = bc_->isFeasible(*vv);
390  }
391  return (flagstat && flagcon && flagvec);
392  }
393 
394  void applyInverseScalingFunction(Vector<Real> &dv, const Vector<Real> &v, const Vector<Real> &x, const Vector<Real> &g) const {
395  if ( augmentedObj_ && activatedObj_ ) {
396  Ptr<StdVector<Real>> dvs = dynamic_cast<RiskVector<Real>&>(dv).getStatisticVector(0);
397  Ptr<const StdVector<Real>> vs = dynamic_cast<const RiskVector<Real>&>(v).getStatisticVector(0);
398  Ptr<const StdVector<Real>> xs = dynamic_cast<const RiskVector<Real>&>(x).getStatisticVector(0);
399  Ptr<const StdVector<Real>> gs = dynamic_cast<const RiskVector<Real>&>(g).getStatisticVector(0);
400  statObj_bc_->applyInverseScalingFunction(*dvs,*vs,*xs,*gs);
401  }
402  if (augmentedCon_) {
403  int size = statCon_bc_.size();
404  for (int i = 0; i < size; ++i) {
405  if (activatedCon_[i]) {
406  Ptr<StdVector<Real>> dvs = dynamic_cast<RiskVector<Real>&>(dv).getStatisticVector(1,i);
407  Ptr<const StdVector<Real>> vs = dynamic_cast<const RiskVector<Real>&>(v).getStatisticVector(1,i);
408  Ptr<const StdVector<Real>> xs = dynamic_cast<const RiskVector<Real>&>(x).getStatisticVector(1,i);
409  Ptr<const StdVector<Real>> gs = dynamic_cast<const RiskVector<Real>&>(g).getStatisticVector(1,i);
410  statCon_bc_[i]->applyInverseScalingFunction(*dvs,*vs,*xs,*gs);
411  }
412  }
413  }
414  if ( bc_ != nullPtr && bc_->isActivated() ) {
415  Ptr<Vector<Real>> dvs = dynamic_cast<RiskVector<Real>&>(dv).getVector();
416  Ptr<const Vector<Real>> vs = dynamic_cast<const RiskVector<Real>&>(v).getVector();
417  Ptr<const Vector<Real>> xs = dynamic_cast<const RiskVector<Real>&>(x).getVector();
418  Ptr<const Vector<Real>> gs = dynamic_cast<const RiskVector<Real>&>(g).getVector();
419  bc_->applyInverseScalingFunction(*dvs,*vs,*xs,*gs);
420  }
421  }
422 
423  void applyScalingFunctionJacobian(Vector<Real> &dv, const Vector<Real> &v, const Vector<Real> &x, const Vector<Real> &g) const {
424  if ( augmentedObj_ && activatedObj_ ) {
425  Ptr<StdVector<Real>> dvs = dynamic_cast<RiskVector<Real>&>(dv).getStatisticVector(0);
426  Ptr<const StdVector<Real>> vs = dynamic_cast<const RiskVector<Real>&>(v).getStatisticVector(0);
427  Ptr<const StdVector<Real>> xs = dynamic_cast<const RiskVector<Real>&>(x).getStatisticVector(0);
428  Ptr<const StdVector<Real>> gs = dynamic_cast<const RiskVector<Real>&>(g).getStatisticVector(0);
429  statObj_bc_->applyScalingFunctionJacobian(*dvs,*vs,*xs,*gs);
430  }
431  if (augmentedCon_) {
432  int size = statCon_bc_.size();
433  for (int i = 0; i < size; ++i) {
434  if (activatedCon_[i]) {
435  Ptr<StdVector<Real>> dvs = dynamic_cast<RiskVector<Real>&>(dv).getStatisticVector(1,i);
436  Ptr<const StdVector<Real>> vs = dynamic_cast<const RiskVector<Real>&>(v).getStatisticVector(1,i);
437  Ptr<const StdVector<Real>> xs = dynamic_cast<const RiskVector<Real>&>(x).getStatisticVector(1,i);
438  Ptr<const StdVector<Real>> gs = dynamic_cast<const RiskVector<Real>&>(g).getStatisticVector(1,i);
439  statCon_bc_[i]->applyScalingFunctionJacobian(*dvs,*vs,*xs,*gs);
440  }
441  }
442  }
443  if ( bc_ != nullPtr && bc_->isActivated() ) {
444  Ptr<Vector<Real>> dvs = dynamic_cast<RiskVector<Real>&>(dv).getVector();
445  Ptr<const Vector<Real>> vs = dynamic_cast<const RiskVector<Real>&>(v).getVector();
446  Ptr<const Vector<Real>> xs = dynamic_cast<const RiskVector<Real>&>(x).getVector();
447  Ptr<const Vector<Real>> gs = dynamic_cast<const RiskVector<Real>&>(g).getVector();
448  bc_->applyScalingFunctionJacobian(*dvs,*vs,*xs,*gs);
449  }
450  }
451 
452 }; // class RiskBoundConstraint
453 
454 } // namespace ROL
455 
456 #endif
Contains definitions for std::vector bound constraints.
RiskBoundConstraint(const Ptr< BoundConstraint< Real >> &bc)
RiskBoundConstraint(Ptr< ParameterList > &parlistObj, std::vector< Ptr< ParameterList >> &parlistCon, const Ptr< BoundConstraint< Real >> &bc=nullPtr)
void activate(void)
Turn on bounds.
void pruneUpperActive(Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x, Real xeps=Real(0), Real geps=Real(0))
Set variables to zero if they correspond to the upper -binding set.
Contains definitions of custom data types in ROL.
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
bool buildObjStatBnd(Ptr< ParameterList > &parlist)
void pruneLowerActive(Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x, Real xeps=Real(0), Real geps=Real(0))
Set variables to zero if they correspond to the -binding set.
std::vector< std::vector< Real > > lowerCon_
Ptr< RiskVector< Real > > lo_
RiskBoundConstraint(std::vector< Ptr< ParameterList >> &parlist, const Ptr< BoundConstraint< Real >> &bc=nullPtr)
void pruneLowerActive(Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
Set variables to zero if they correspond to the lower -active set.
void applyScalingFunctionJacobian(Vector< Real > &dv, const Vector< Real > &v, const Vector< Real > &x, const Vector< Real > &g) const
Apply scaling function Jacobian.
void setBoundInfo(ParameterList &parlist, int &nStat, std::vector< Real > &lower, std::vector< Real > &upper, bool &augmented, bool &activated)
void pruneUpperActive(Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
Set variables to zero if they correspond to the upper -active set.
RiskBoundConstraint(Ptr< ParameterList > &parlist, const Ptr< BoundConstraint< Real >> &bc=nullPtr)
const Ptr< const Vector< Real > > getLowerBound(void) const
Return the ref count pointer to the lower bound vector.
std::vector< std::vector< Real > > upperCon_
bool isFeasible(const Vector< Real > &v)
Check if the vector, v, is feasible.
const Ptr< const Vector< Real > > getUpperBound(void) const
Return the ref count pointer to the upper bound vector.
Ptr< StdBoundConstraint< Real > > statObj_bc_
Provides the interface to apply upper and lower bound constraints.
bool buildConStatBnd(std::vector< Ptr< ParameterList >> &parlist)
void projectInterior(Vector< Real > &x)
Project optimization variables into the interior of the feasible set.
void applyInverseScalingFunction(Vector< Real > &dv, const Vector< Real > &v, const Vector< Real > &x, const Vector< Real > &g) const
Apply inverse scaling function.
void deactivate(void)
Turn off bounds.
void project(Vector< Real > &x)
Project optimization variables onto the bounds.
Ptr< BoundConstraint< Real > > bc_
Ptr< RiskVector< Real > > hi_
std::vector< Ptr< StdBoundConstraint< Real > > > statCon_bc_