ROL
ROL_StochasticProblem.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ************************************************************************
3 //
4 // Rapid Optimization Library (ROL) Package
5 // Copyright (2014) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact lead developers:
38 // Drew Kouri (dpkouri@sandia.gov) and
39 // Denis Ridzal (dridzal@sandia.gov)
40 //
41 // ************************************************************************
42 // @HEADER
43 
44 #ifndef ROL_STOCHASTICPROBLEM_HPP
45 #define ROL_STOCHASTICPROBLEM_HPP
46 
48 #include "ROL_SampleGenerator.hpp"
49 
50 // Risk-Neutral Includes
52 
53 // Risk-Averse Includes
55 #include "ROL_RiskVector.hpp"
57 
58 // BPOE Includes
59 #include "ROL_BPOEObjective.hpp"
60 
61 #include "Teuchos_ParameterList.hpp"
62 
63 namespace ROL {
64 
65 template<class Real>
66 class StochasticProblem : public OptimizationProblem<Real> {
67 private:
68  Teuchos::RCP<Teuchos::ParameterList> parlist_;
69 
70  Teuchos::RCP<ParametrizedObjective<Real> > ORIGINAL_obj_;
71  Teuchos::RCP<Vector<Real> > ORIGINAL_vec_;
72  Teuchos::RCP<BoundConstraint<Real> > ORIGINAL_bnd_;
73 
74  Teuchos::RCP<Objective<Real> > obj_;
75  Teuchos::RCP<Vector<Real> > vec_;
76  Teuchos::RCP<BoundConstraint<Real> > bnd_;
77 
78  Teuchos::RCP<SampleGenerator<Real> > vsampler_;
79  Teuchos::RCP<SampleGenerator<Real> > gsampler_;
80  Teuchos::RCP<SampleGenerator<Real> > hsampler_;
81 
82  bool setVector_;
83 
84 public:
86  : parlist_(Teuchos::null),
87  ORIGINAL_obj_(Teuchos::null), ORIGINAL_vec_(Teuchos::null), ORIGINAL_bnd_(Teuchos::null),
88  obj_(Teuchos::null), vec_(Teuchos::null), bnd_(Teuchos::null),
89  vsampler_(Teuchos::null), gsampler_(Teuchos::null), hsampler_(Teuchos::null),
90  setVector_(false) {}
91 
92  StochasticProblem(Teuchos::ParameterList &parlist)
93  : ORIGINAL_obj_(Teuchos::null), ORIGINAL_vec_(Teuchos::null), ORIGINAL_bnd_(Teuchos::null),
94  obj_(Teuchos::null), vec_(Teuchos::null), bnd_(Teuchos::null),
95  vsampler_(Teuchos::null), gsampler_(Teuchos::null), hsampler_(Teuchos::null),
96  setVector_(false) {
97  parlist_ = Teuchos::rcp(&parlist,false);
98  }
99 
100  StochasticProblem(Teuchos::ParameterList &parlist,
101  const Teuchos::RCP<ParametrizedObjective<Real> > &obj,
102  const Teuchos::RCP<SampleGenerator<Real> > &sampler,
103  const Teuchos::RCP<Vector<Real> > &vec)
104  : OptimizationProblem<Real>(),
105  ORIGINAL_obj_(obj), ORIGINAL_vec_(vec), ORIGINAL_bnd_(Teuchos::null),
106  obj_(Teuchos::null), vec_(Teuchos::null), bnd_(Teuchos::null),
107  vsampler_(sampler), gsampler_(sampler), hsampler_(sampler),
108  setVector_(false) {
109  parlist_ = Teuchos::rcp(&parlist,false);
110  setObjective(obj);
111  setSolutionVector(vec);
112  }
113 
114  StochasticProblem(Teuchos::ParameterList &parlist,
115  const Teuchos::RCP<ParametrizedObjective<Real> > &obj,
116  const Teuchos::RCP<SampleGenerator<Real> > &vsampler,
117  const Teuchos::RCP<SampleGenerator<Real> > &gsampler,
118  const Teuchos::RCP<Vector<Real> > &vec)
119  : OptimizationProblem<Real>(),
120  ORIGINAL_obj_(obj), ORIGINAL_vec_(vec), ORIGINAL_bnd_(Teuchos::null),
121  obj_(Teuchos::null), vec_(Teuchos::null), bnd_(Teuchos::null),
122  vsampler_(vsampler), gsampler_(gsampler), hsampler_(gsampler),
123  setVector_(false) {
124  parlist_ = Teuchos::rcp(&parlist,false);
125  setObjective(obj);
126  setSolutionVector(vec);
127  }
128 
129  StochasticProblem(Teuchos::ParameterList &parlist,
130  const Teuchos::RCP<ParametrizedObjective<Real> > &obj,
131  const Teuchos::RCP<SampleGenerator<Real> > &vsampler,
132  const Teuchos::RCP<SampleGenerator<Real> > &gsampler,
133  const Teuchos::RCP<SampleGenerator<Real> > &hsampler,
134  const Teuchos::RCP<Vector<Real> > &vec)
135  : OptimizationProblem<Real>(),
136  ORIGINAL_obj_(obj), ORIGINAL_vec_(vec), ORIGINAL_bnd_(Teuchos::null),
137  obj_(Teuchos::null), vec_(Teuchos::null), bnd_(Teuchos::null),
138  vsampler_(vsampler), gsampler_(gsampler), hsampler_(hsampler),
139  setVector_(false) {
140  parlist_ = Teuchos::rcp(&parlist,false);
141  setObjective(obj);
142  setSolutionVector(vec);
143  }
144 
145  StochasticProblem(Teuchos::ParameterList &parlist,
146  const Teuchos::RCP<ParametrizedObjective<Real> > &obj,
147  const Teuchos::RCP<SampleGenerator<Real> > &sampler,
148  const Teuchos::RCP<Vector<Real> > &vec,
149  const Teuchos::RCP<BoundConstraint<Real> > &bnd)
150  : OptimizationProblem<Real>(),
151  ORIGINAL_obj_(obj), ORIGINAL_vec_(vec), ORIGINAL_bnd_(bnd),
152  obj_(Teuchos::null), vec_(Teuchos::null), bnd_(Teuchos::null),
153  vsampler_(sampler), gsampler_(sampler), hsampler_(sampler),
154  setVector_(false) {
155  parlist_ = Teuchos::rcp(&parlist,false);
156  setObjective(obj);
157  setSolutionVector(vec);
158  setBoundConstraint(bnd);
159  }
160 
161  StochasticProblem(Teuchos::ParameterList &parlist,
162  const Teuchos::RCP<ParametrizedObjective<Real> > &obj,
163  const Teuchos::RCP<SampleGenerator<Real> > &vsampler,
164  const Teuchos::RCP<SampleGenerator<Real> > &gsampler,
165  const Teuchos::RCP<Vector<Real> > &vec,
166  const Teuchos::RCP<BoundConstraint<Real> > &bnd)
167  : OptimizationProblem<Real>(),
168  ORIGINAL_obj_(obj), ORIGINAL_vec_(vec), ORIGINAL_bnd_(bnd),
169  obj_(Teuchos::null), vec_(Teuchos::null), bnd_(Teuchos::null),
170  vsampler_(vsampler), gsampler_(gsampler), hsampler_(gsampler),
171  setVector_(false) {
172  parlist_ = Teuchos::rcp(&parlist,false);
173  setObjective(obj);
174  setSolutionVector(vec);
175  setBoundConstraint(bnd);
176  }
177 
178  StochasticProblem(Teuchos::ParameterList &parlist,
179  const Teuchos::RCP<ParametrizedObjective<Real> > &obj,
180  const Teuchos::RCP<SampleGenerator<Real> > &vsampler,
181  const Teuchos::RCP<SampleGenerator<Real> > &gsampler,
182  const Teuchos::RCP<SampleGenerator<Real> > &hsampler,
183  const Teuchos::RCP<Vector<Real> > &vec,
184  const Teuchos::RCP<BoundConstraint<Real> > &bnd)
185  : OptimizationProblem<Real>(),
186  ORIGINAL_obj_(obj), ORIGINAL_vec_(vec), ORIGINAL_bnd_(bnd),
187  obj_(Teuchos::null), vec_(Teuchos::null), bnd_(Teuchos::null),
188  vsampler_(vsampler), gsampler_(gsampler), hsampler_(hsampler),
189  setVector_(false) {
190  parlist_ = Teuchos::rcp(&parlist,false);
191  setObjective(obj);
192  setSolutionVector(vec);
193  setBoundConstraint(bnd);
194  }
195 
196  void setParameterList(Teuchos::ParameterList &parlist) {
197  parlist_ = Teuchos::rcp(&parlist,false);
198  if (ORIGINAL_obj_ != Teuchos::null) {
199  setObjective(ORIGINAL_obj_);
200  }
201  if (ORIGINAL_vec_ != Teuchos::null) {
202  setSolutionVector(ORIGINAL_vec_);
203  }
204  if (ORIGINAL_bnd_ != Teuchos::null) {
205  setBoundConstraint(ORIGINAL_bnd_);
206  }
207  }
208 
209  void setValueSampleGenerator(const Teuchos::RCP<SampleGenerator<Real> > &vsampler) {
210  vsampler_ = vsampler;
211  if ( gsampler_ == Teuchos::null ) {
212  gsampler_ = vsampler_;
213  }
214  if ( hsampler_ == Teuchos::null ) {
215  hsampler_ = gsampler_;
216  }
217  }
218 
219  void setGradientSampleGenerator(const Teuchos::RCP<SampleGenerator<Real> > &gsampler) {
220  gsampler_ = gsampler;
221  if ( hsampler_ == Teuchos::null ) {
222  hsampler_ = gsampler_;
223  }
224  }
225 
226  void setHessVecSampleGenerator(const Teuchos::RCP<SampleGenerator<Real> > &hsampler) {
227  hsampler_ = hsampler;
228  }
229 
230  void setObjective(const Teuchos::RCP<ParametrizedObjective<Real> > &obj) {
231  if ( parlist_ == Teuchos::null ) {
232  TEUCHOS_TEST_FOR_EXCEPTION(true, std::invalid_argument,
233  ">>> ERROR (ROL::StochasticProblem): parameter list not set!");
234  }
235  else {
236  ORIGINAL_obj_ = obj;
237  if ( vsampler_ == Teuchos::null ) {
238  TEUCHOS_TEST_FOR_EXCEPTION(true, std::invalid_argument,
239  ">>> ERROR (ROL::StochasticProblem): value sampler not set!");
240  }
241  else {
242  // Determine Stochastic Optimization Type
243  std::string type = parlist_->sublist("SOL").get("Stochastic Optimization Type","Risk Neutral");
244  if ( type == "Risk Neutral" ) {
245  bool storage = parlist_->sublist("SOL").get("Store Sampled Value and Gradient",true);
246  obj_ = Teuchos::rcp(new RiskNeutralObjective<Real>(obj,vsampler_,gsampler_,hsampler_,storage));
247  }
248  else if ( type == "Risk Averse" ) {
249  obj_ = Teuchos::rcp(new RiskAverseObjective<Real>(obj,*parlist_,vsampler_,gsampler_,hsampler_));
250  }
251  else if ( type == "BPOE" ) {
252  Real order = parlist_->sublist("SOL").sublist("BPOE").get("Moment Order",1.);
253  Real threshold = parlist_->sublist("SOL").sublist("BPOE").get("Threshold",0.);
254  obj_ = Teuchos::rcp(new BPOEObjective<Real>(obj,order,threshold,vsampler_,gsampler_,hsampler_));
255  }
256  else if ( type == "Mean Value" ) {
257  std::vector<Real> mean = computeSampleMean(vsampler_);
258  obj->setParameter(mean);
259  obj_ = obj;
260  }
261  else {
262  TEUCHOS_TEST_FOR_EXCEPTION(true,std::logic_error,
263  "Invalid stochastic optimization type" << type);
264  }
265  // Set OptimizationProblem data
267  }
268  }
269  }
270 
271  void setSolutionVector(const Teuchos::RCP<Vector<Real> > &vec) {
272  if ( parlist_ == Teuchos::null ) {
273  TEUCHOS_TEST_FOR_EXCEPTION(true, std::invalid_argument,
274  ">>> ERROR (ROL::StochasticProblem): parameter list not set!");
275  }
276  else {
277  ORIGINAL_vec_ = vec;
278  // Determine Stochastic Optimization Type
279  std::string type = parlist_->sublist("SOL").get("Stochastic Optimization Type","Risk Neutral");
280  if ( type == "Risk Neutral" || type == "Mean Value" ) {
281  vec_ = vec;
282  }
283  else if ( type == "Risk Averse" ) {
284  vec_ = Teuchos::rcp(new RiskVector<Real>(*parlist_,vec));
285  }
286  else if ( type == "BPOE" ) {
287  std::vector<Real> stat(1,1.);
288  vec_ = Teuchos::rcp(new RiskVector<Real>(vec,stat,true));
289  }
290  else {
291  TEUCHOS_TEST_FOR_EXCEPTION(true,std::logic_error,
292  "Invalid stochastic optimization type" << type);
293  }
294  // Set OptimizationProblem data
296  setVector_ = true;
297  }
298  }
299 
300  void setSolutionStatistic(const Real stat) {
301  if ( parlist_ == Teuchos::null ) {
302  TEUCHOS_TEST_FOR_EXCEPTION(true, std::invalid_argument,
303  ">>> ERROR (ROL::StochasticProblem): parameter list not set!");
304  }
305  else {
306  if ( setVector_ ) {
307  // Determine Stochastic Optimization Type
308  std::string type = parlist_->sublist("SOL").get("Stochastic Optimization Type","Risk Neutral");
309  if ( type == "Risk Averse" || type == "BPOE" ) {
310  RiskVector<Real> &x = Teuchos::dyn_cast<RiskVector<Real> >(*vec_);
311  x.setStatistic(stat);
312  }
313  // Set OptimizationProblem data
315  }
316  }
317  }
318 
319  void setBoundConstraint(const Teuchos::RCP<BoundConstraint<Real> > &bnd) {
320  if ( parlist_ == Teuchos::null ) {
321  TEUCHOS_TEST_FOR_EXCEPTION(true, std::invalid_argument,
322  ">>> ERROR (ROL::StochasticProblem): parameter list not set!");
323  }
324  else {
325  ORIGINAL_bnd_ = bnd;
326  // Determine Stochastic Optimization Type
327  std::string type = parlist_->sublist("SOL").get("Stochastic Optimization Type","Risk Neutral");
328  if ( type == "Risk Neutral" || type == "Mean Value" ) {
329  bnd_ = bnd;
330  }
331  else if ( type == "Risk Averse" ) {
332  std::string name = parlist_->sublist("SOL").sublist("Risk Measure").get("Name","CVaR");
333  if ( name == "KL Divergence" ) {
334  bnd_ = Teuchos::rcp(new RiskBoundConstraint<Real>("BPOE",bnd));
335  }
336  else {
337  bnd_ = Teuchos::rcp(new RiskBoundConstraint<Real>(*parlist_,bnd));
338  }
339  }
340  else if ( type == "BPOE" ) {
341  bnd_ = Teuchos::rcp(new RiskBoundConstraint<Real>("BPOE",bnd));
342  }
343  else {
344  TEUCHOS_TEST_FOR_EXCEPTION(true,std::logic_error,
345  "Invalid stochastic optimization type" << type);
346  }
347  // Set OptimizationProblem data
349  }
350  }
351 
352 // Real getSolutionStatistic(void) {
353 // try {
354 // return Teuchos::dyn_cast<const RiskVector<Real> >(
355 // Teuchos::dyn_cast<const Vector<Real> >(*vec_)).getStatistic();
356 // }
357 // catch (std::exception &e) {
358 // return 0.;
359 // }
360 // }
361 
362  Real getSolutionStatistic(void) {
363  if ( parlist_ == Teuchos::null ) {
364  TEUCHOS_TEST_FOR_EXCEPTION(true, std::invalid_argument,
365  ">>> ERROR (ROL::StochasticProblem): parameter list not set!");
366  }
367  else {
368  try {
369  const RiskVector<Real> x = Teuchos::dyn_cast<const RiskVector<Real> >(
370  Teuchos::dyn_cast<const Vector<Real> >(*vec_));
371  std::string type = parlist_->sublist("SOL").get("Stochastic Optimization Type","Risk Neutral");
372  Real val = 0.0;
373  if ( type == "Risk Averse" ) {
374  Teuchos::ParameterList &list
375  = parlist_->sublist("SOL").sublist("Risk Measure");
376  std::string risk = list.get("Name","CVaR");
377  if ( risk == "Mixed-Quantile Quadrangle" ) {
378  Teuchos::ParameterList &MQQlist = list.sublist("Mixed-Quantile Quadrangle");
379  Teuchos::Array<Real> coeff
380  = Teuchos::getArrayFromStringParameter<Real>(MQQlist,"Coefficient Array");
381  for (int i = 0; i < coeff.size(); i++) {
382  val += coeff[i]*x.getStatistic(i);
383  }
384  }
385  else if ( risk == "Quantile-Radius Quadrangle" ) {
386  val = 0.5*(x.getStatistic(0) + x.getStatistic(1));
387  }
388  else {
389  val = x.getStatistic();
390  }
391  }
392  else {
393  val = x.getStatistic();
394  }
395  return val;
396  }
397  catch (std::exception &e) {
398  return 0.;
399  }
400  }
401  }
402 
403  std::vector<std::vector<Real> > checkObjectiveGradient( const Vector<Real> &d,
404  const bool printToStream = true,
405  std::ostream & outStream = std::cout,
406  const int numSteps = ROL_NUM_CHECKDERIV_STEPS,
407  const int order = 1 ) {
408  Teuchos::RCP<Vector<Real> > dp = d.clone();
409  dp->set(d);
410  Teuchos::RCP<Vector<Real> > D = createVector(dp);
411  return OptimizationProblem<Real>::checkObjectiveGradient(*D,printToStream,outStream,numSteps,order);
412  }
413 
414  std::vector<std::vector<Real> > checkObjectiveHessVec( const Vector<Real> &v,
415  const bool printToStream = true,
416  std::ostream & outStream = std::cout,
417  const int numSteps = ROL_NUM_CHECKDERIV_STEPS,
418  const int order = 1 ) {
419  Teuchos::RCP<Vector<Real> > vp = v.clone();
420  vp->set(v);
421  Teuchos::RCP<Vector<Real> > V = createVector(vp);
422  return OptimizationProblem<Real>::checkObjectiveHessVec(*V,printToStream,outStream,numSteps,order);
423  }
424 
425 private:
426  std::vector<Real> computeSampleMean(Teuchos::RCP<SampleGenerator<Real> > &sampler) {
427  // Compute mean value of inputs and set parameter in objective
428  int dim = sampler->getMyPoint(0).size(), nsamp = sampler->numMySamples();
429  std::vector<Real> loc(dim,0.0), mean(dim,0.0), pt(dim,0.0);
430  Real wt = 0.0;
431  for (int i = 0; i < nsamp; i++) {
432  pt = sampler->getMyPoint(i);
433  wt = sampler->getMyWeight(i);
434  for (int j = 0; j < dim; j++) {
435  loc[j] += wt*pt[j];
436  }
437  }
438  sampler->sumAll(&loc[0],&mean[0],dim);
439  return mean;
440  }
441 
442  Teuchos::RCP<Vector<Real> > createVector(Teuchos::RCP<Vector<Real> > &vec) {
443  if ( parlist_ == Teuchos::null ) {
444  TEUCHOS_TEST_FOR_EXCEPTION(true, std::invalid_argument,
445  ">>> ERROR (ROL::StochasticProblem): parameter list not set!");
446  }
447  else {
448  // Determine Stochastic Optimization Type
449  std::string type = parlist_->sublist("SOL").get("Stochastic Optimization Type","Risk Neutral");
450  if ( type == "Risk Neutral" || type == "Mean Value" ) {
451  return vec;
452  }
453  else if ( type == "Risk Averse" ) {
454  return Teuchos::rcp(new RiskVector<Real>(*parlist_,vec));
455  }
456  else if ( type == "BPOE" ) {
457  std::vector<Real> stat(1,1.);
458  return Teuchos::rcp(new RiskVector<Real>(vec,stat,true));
459  }
460  else {
461  TEUCHOS_TEST_FOR_EXCEPTION(true,std::logic_error,
462  "Invalid stochastic optimization type" << type);
463  }
464  }
465  }
466 };
467 }
468 #endif
void setObjective(const Teuchos::RCP< ParametrizedObjective< Real > > &obj)
StochasticProblem(Teuchos::ParameterList &parlist, const Teuchos::RCP< ParametrizedObjective< Real > > &obj, const Teuchos::RCP< SampleGenerator< Real > > &vsampler, const Teuchos::RCP< SampleGenerator< Real > > &gsampler, const Teuchos::RCP< Vector< Real > > &vec)
virtual std::vector< std::vector< Real > > checkObjectiveGradient(const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
StochasticProblem(Teuchos::ParameterList &parlist, const Teuchos::RCP< ParametrizedObjective< Real > > &obj, const Teuchos::RCP< SampleGenerator< Real > > &sampler, const Teuchos::RCP< Vector< Real > > &vec)
std::vector< Real > computeSampleMean(Teuchos::RCP< SampleGenerator< Real > > &sampler)
Teuchos::RCP< Vector< Real > > createVector(Teuchos::RCP< Vector< Real > > &vec)
void setGradientSampleGenerator(const Teuchos::RCP< SampleGenerator< Real > > &gsampler)
const Real getStatistic(const int i=0) const
virtual Teuchos::RCP< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
Teuchos::RCP< BoundConstraint< Real > > bnd_
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:74
void setHessVecSampleGenerator(const Teuchos::RCP< SampleGenerator< Real > > &hsampler)
Teuchos::RCP< SampleGenerator< Real > > vsampler_
Teuchos::RCP< BoundConstraint< Real > > ORIGINAL_bnd_
void setObjective(const Teuchos::RCP< Objective< Real > > &obj)
std::vector< std::vector< Real > > checkObjectiveGradient(const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
void setSolutionVector(const Teuchos::RCP< Vector< Real > > &sol)
void setStatistic(const Real stat)
Teuchos::RCP< Vector< Real > > ORIGINAL_vec_
void setParameterList(Teuchos::ParameterList &parlist)
std::vector< std::vector< Real > > checkObjectiveHessVec(const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
StochasticProblem(Teuchos::ParameterList &parlist, const Teuchos::RCP< ParametrizedObjective< Real > > &obj, const Teuchos::RCP< SampleGenerator< Real > > &vsampler, const Teuchos::RCP< SampleGenerator< Real > > &gsampler, const Teuchos::RCP< SampleGenerator< Real > > &hsampler, const Teuchos::RCP< Vector< Real > > &vec)
Provides the interface to apply upper and lower bound constraints.
Teuchos::RCP< SampleGenerator< Real > > gsampler_
Teuchos::RCP< ParametrizedObjective< Real > > ORIGINAL_obj_
Teuchos::RCP< Vector< Real > > vec_
#define ROL_NUM_CHECKDERIV_STEPS
Number of steps for derivative checks.
Definition: ROL_Types.hpp:70
Teuchos::RCP< Teuchos::ParameterList > parlist_
StochasticProblem(Teuchos::ParameterList &parlist, const Teuchos::RCP< ParametrizedObjective< Real > > &obj, const Teuchos::RCP< SampleGenerator< Real > > &sampler, const Teuchos::RCP< Vector< Real > > &vec, const Teuchos::RCP< BoundConstraint< Real > > &bnd)
void setSolutionStatistic(const Real stat)
StochasticProblem(Teuchos::ParameterList &parlist, const Teuchos::RCP< ParametrizedObjective< Real > > &obj, const Teuchos::RCP< SampleGenerator< Real > > &vsampler, const Teuchos::RCP< SampleGenerator< Real > > &gsampler, const Teuchos::RCP< SampleGenerator< Real > > &hsampler, const Teuchos::RCP< Vector< Real > > &vec, const Teuchos::RCP< BoundConstraint< Real > > &bnd)
void setValueSampleGenerator(const Teuchos::RCP< SampleGenerator< Real > > &vsampler)
void setBoundConstraint(const Teuchos::RCP< BoundConstraint< Real > > &bnd)
void setBoundConstraint(const Teuchos::RCP< BoundConstraint< Real > > &bnd)
StochasticProblem(Teuchos::ParameterList &parlist)
StochasticProblem(Teuchos::ParameterList &parlist, const Teuchos::RCP< ParametrizedObjective< Real > > &obj, const Teuchos::RCP< SampleGenerator< Real > > &vsampler, const Teuchos::RCP< SampleGenerator< Real > > &gsampler, const Teuchos::RCP< Vector< Real > > &vec, const Teuchos::RCP< BoundConstraint< Real > > &bnd)
void setSolutionVector(const Teuchos::RCP< Vector< Real > > &vec)
virtual std::vector< std::vector< Real > > checkObjectiveHessVec(const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
Teuchos::RCP< Objective< Real > > obj_
Teuchos::RCP< SampleGenerator< Real > > hsampler_