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<Objective<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  : OptimizationProblem<Real>(),
87  parlist_(Teuchos::null),
88  ORIGINAL_obj_(Teuchos::null), ORIGINAL_vec_(Teuchos::null), ORIGINAL_bnd_(Teuchos::null),
89  obj_(Teuchos::null), vec_(Teuchos::null), bnd_(Teuchos::null),
90  vsampler_(Teuchos::null), gsampler_(Teuchos::null), hsampler_(Teuchos::null),
91  setVector_(false) {}
92 
93  StochasticProblem(Teuchos::ParameterList &parlist)
94  : OptimizationProblem<Real>(),
95  ORIGINAL_obj_(Teuchos::null), ORIGINAL_vec_(Teuchos::null), ORIGINAL_bnd_(Teuchos::null),
96  obj_(Teuchos::null), vec_(Teuchos::null), bnd_(Teuchos::null),
97  vsampler_(Teuchos::null), gsampler_(Teuchos::null), hsampler_(Teuchos::null),
98  setVector_(false) {
99  parlist_ = Teuchos::rcpFromRef(parlist);
100  }
101 
102  StochasticProblem(Teuchos::ParameterList &parlist,
103  const Teuchos::RCP<Objective<Real> > &obj,
104  const Teuchos::RCP<SampleGenerator<Real> > &sampler,
105  const Teuchos::RCP<Vector<Real> > &vec)
106  : OptimizationProblem<Real>(),
107  ORIGINAL_obj_(obj), ORIGINAL_vec_(vec), ORIGINAL_bnd_(Teuchos::null),
108  obj_(Teuchos::null), vec_(Teuchos::null), bnd_(Teuchos::null),
109  vsampler_(sampler), gsampler_(sampler), hsampler_(sampler),
110  setVector_(false) {
111  parlist_ = Teuchos::rcpFromRef(parlist);
112  setObjective(obj);
113  setSolutionVector(vec);
114  setBoundConstraint(Teuchos::null);
115  }
116 
117  StochasticProblem(Teuchos::ParameterList &parlist,
118  const Teuchos::RCP<Objective<Real> > &obj,
119  const Teuchos::RCP<SampleGenerator<Real> > &vsampler,
120  const Teuchos::RCP<SampleGenerator<Real> > &gsampler,
121  const Teuchos::RCP<Vector<Real> > &vec)
122  : OptimizationProblem<Real>(),
123  ORIGINAL_obj_(obj), ORIGINAL_vec_(vec), ORIGINAL_bnd_(Teuchos::null),
124  obj_(Teuchos::null), vec_(Teuchos::null), bnd_(Teuchos::null),
125  vsampler_(vsampler), gsampler_(gsampler), hsampler_(gsampler),
126  setVector_(false) {
127  parlist_ = Teuchos::rcpFromRef(parlist);
128  setObjective(obj);
129  setSolutionVector(vec);
130  setBoundConstraint(Teuchos::null);
131  }
132 
133  StochasticProblem(Teuchos::ParameterList &parlist,
134  const Teuchos::RCP<Objective<Real> > &obj,
135  const Teuchos::RCP<SampleGenerator<Real> > &vsampler,
136  const Teuchos::RCP<SampleGenerator<Real> > &gsampler,
137  const Teuchos::RCP<SampleGenerator<Real> > &hsampler,
138  const Teuchos::RCP<Vector<Real> > &vec)
139  : OptimizationProblem<Real>(),
140  ORIGINAL_obj_(obj), ORIGINAL_vec_(vec), ORIGINAL_bnd_(Teuchos::null),
141  obj_(Teuchos::null), vec_(Teuchos::null), bnd_(Teuchos::null),
142  vsampler_(vsampler), gsampler_(gsampler), hsampler_(hsampler),
143  setVector_(false) {
144  parlist_ = Teuchos::rcpFromRef(parlist);
145  setObjective(obj);
146  setSolutionVector(vec);
147  setBoundConstraint(Teuchos::null);
148  }
149 
150  StochasticProblem(Teuchos::ParameterList &parlist,
151  const Teuchos::RCP<Objective<Real> > &obj,
152  const Teuchos::RCP<SampleGenerator<Real> > &sampler,
153  const Teuchos::RCP<Vector<Real> > &vec,
154  const Teuchos::RCP<BoundConstraint<Real> > &bnd)
155  : OptimizationProblem<Real>(),
156  ORIGINAL_obj_(obj), ORIGINAL_vec_(vec), ORIGINAL_bnd_(bnd),
157  obj_(Teuchos::null), vec_(Teuchos::null), bnd_(Teuchos::null),
158  vsampler_(sampler), gsampler_(sampler), hsampler_(sampler),
159  setVector_(false) {
160  parlist_ = Teuchos::rcpFromRef(parlist);
161  setObjective(obj);
162  setSolutionVector(vec);
163  setBoundConstraint(bnd);
164  }
165 
166  StochasticProblem(Teuchos::ParameterList &parlist,
167  const Teuchos::RCP<Objective<Real> > &obj,
168  const Teuchos::RCP<SampleGenerator<Real> > &vsampler,
169  const Teuchos::RCP<SampleGenerator<Real> > &gsampler,
170  const Teuchos::RCP<Vector<Real> > &vec,
171  const Teuchos::RCP<BoundConstraint<Real> > &bnd)
172  : OptimizationProblem<Real>(),
173  ORIGINAL_obj_(obj), ORIGINAL_vec_(vec), ORIGINAL_bnd_(bnd),
174  obj_(Teuchos::null), vec_(Teuchos::null), bnd_(Teuchos::null),
175  vsampler_(vsampler), gsampler_(gsampler), hsampler_(gsampler),
176  setVector_(false) {
177  parlist_ = Teuchos::rcpFromRef(parlist);
178  setObjective(obj);
179  setSolutionVector(vec);
180  setBoundConstraint(bnd);
181  }
182 
183  StochasticProblem(Teuchos::ParameterList &parlist,
184  const Teuchos::RCP<Objective<Real> > &obj,
185  const Teuchos::RCP<SampleGenerator<Real> > &vsampler,
186  const Teuchos::RCP<SampleGenerator<Real> > &gsampler,
187  const Teuchos::RCP<SampleGenerator<Real> > &hsampler,
188  const Teuchos::RCP<Vector<Real> > &vec,
189  const Teuchos::RCP<BoundConstraint<Real> > &bnd)
190  : OptimizationProblem<Real>(),
191  ORIGINAL_obj_(obj), ORIGINAL_vec_(vec), ORIGINAL_bnd_(bnd),
192  obj_(Teuchos::null), vec_(Teuchos::null), bnd_(Teuchos::null),
193  vsampler_(vsampler), gsampler_(gsampler), hsampler_(hsampler),
194  setVector_(false) {
195  parlist_ = Teuchos::rcpFromRef(parlist);
196  setObjective(obj);
197  setSolutionVector(vec);
198  setBoundConstraint(bnd);
199  }
200 
201  void setParameterList(Teuchos::ParameterList &parlist) {
202  parlist_ = Teuchos::rcpFromRef(parlist);
203  if (ORIGINAL_obj_ != Teuchos::null) {
205  }
206  if (ORIGINAL_vec_ != Teuchos::null) {
208  }
209  if (ORIGINAL_bnd_ != Teuchos::null) {
211  }
212  }
213 
214  void setValueSampleGenerator(const Teuchos::RCP<SampleGenerator<Real> > &vsampler) {
215  vsampler_ = vsampler;
216  if ( gsampler_ == Teuchos::null ) {
218  }
219  if ( hsampler_ == Teuchos::null ) {
221  }
222  }
223 
224  void setGradientSampleGenerator(const Teuchos::RCP<SampleGenerator<Real> > &gsampler) {
225  gsampler_ = gsampler;
226  if ( hsampler_ == Teuchos::null ) {
228  }
229  }
230 
231  void setHessVecSampleGenerator(const Teuchos::RCP<SampleGenerator<Real> > &hsampler) {
232  hsampler_ = hsampler;
233  }
234 
235  void setObjective(const Teuchos::RCP<Objective<Real> > &obj) {
236  if ( parlist_ == Teuchos::null ) {
237  TEUCHOS_TEST_FOR_EXCEPTION(true, std::invalid_argument,
238  ">>> ERROR (ROL::StochasticProblem): parameter list not set!");
239  }
240  else {
241  ORIGINAL_obj_ = obj;
242  if ( vsampler_ == Teuchos::null ) {
243  TEUCHOS_TEST_FOR_EXCEPTION(true, std::invalid_argument,
244  ">>> ERROR (ROL::StochasticProblem): value sampler not set!");
245  }
246  else {
247  // Determine Stochastic Optimization Type
248  std::string type = parlist_->sublist("SOL").get("Stochastic Optimization Type","Risk Neutral");
249  if ( type == "Risk Neutral" ) {
250  bool storage = parlist_->sublist("SOL").get("Store Sampled Value and Gradient",true);
251  obj_ = Teuchos::rcp(new RiskNeutralObjective<Real>(obj,vsampler_,gsampler_,hsampler_,storage));
252  }
253  else if ( type == "Risk Averse" ) {
255  }
256  else if ( type == "BPOE" ) {
257  Real order = parlist_->sublist("SOL").sublist("BPOE").get("Moment Order",1.);
258  Real threshold = parlist_->sublist("SOL").sublist("BPOE").get("Threshold",0.);
259  obj_ = Teuchos::rcp(new BPOEObjective<Real>(obj,order,threshold,vsampler_,gsampler_,hsampler_));
260  }
261  else if ( type == "Mean Value" ) {
262  std::vector<Real> mean = computeSampleMean(vsampler_);
263  obj->setParameter(mean);
264  obj_ = obj;
265  }
266  else {
267  TEUCHOS_TEST_FOR_EXCEPTION(true,std::logic_error,
268  "Invalid stochastic optimization type" << type);
269  }
270  // Set OptimizationProblem data
272  }
273  }
274  }
275 
276  void setSolutionVector(const Teuchos::RCP<Vector<Real> > &vec) {
277  if ( parlist_ == Teuchos::null ) {
278  TEUCHOS_TEST_FOR_EXCEPTION(true, std::invalid_argument,
279  ">>> ERROR (ROL::StochasticProblem): parameter list not set!");
280  }
281  else {
282  ORIGINAL_vec_ = vec;
283  // Determine Stochastic Optimization Type
284  std::string type = parlist_->sublist("SOL").get("Stochastic Optimization Type","Risk Neutral");
285  if ( type == "Risk Neutral" || type == "Mean Value" ) {
286  vec_ = vec;
287  }
288  else if ( type == "Risk Averse" ) {
289  vec_ = Teuchos::rcp(new RiskVector<Real>(*parlist_,vec));
290  }
291  else if ( type == "BPOE" ) {
292  std::vector<Real> stat(1,1);
293  vec_ = Teuchos::rcp(new RiskVector<Real>(vec,stat,true));
294  }
295  else {
296  TEUCHOS_TEST_FOR_EXCEPTION(true,std::logic_error,
297  "Invalid stochastic optimization type" << type);
298  }
299  // Set OptimizationProblem data
301  setVector_ = true;
302  }
303  }
304 
305  void setSolutionStatistic(const Real stat) {
306  if ( parlist_ == Teuchos::null ) {
307  TEUCHOS_TEST_FOR_EXCEPTION(true, std::invalid_argument,
308  ">>> ERROR (ROL::StochasticProblem): parameter list not set!");
309  }
310  else {
311  if ( setVector_ ) {
312  // Determine Stochastic Optimization Type
313  std::string type = parlist_->sublist("SOL").get("Stochastic Optimization Type","Risk Neutral");
314  if ( type == "Risk Averse" || type == "BPOE" ) {
315  RiskVector<Real> &x = Teuchos::dyn_cast<RiskVector<Real> >(*vec_);
316  x.setStatistic(stat);
317  }
318  // Set OptimizationProblem data
320  }
321  }
322  }
323 
324  void setBoundConstraint(const Teuchos::RCP<BoundConstraint<Real> > &bnd) {
325  if ( parlist_ == Teuchos::null ) {
326  TEUCHOS_TEST_FOR_EXCEPTION(true, std::invalid_argument,
327  ">>> ERROR (ROL::StochasticProblem): parameter list not set!");
328  }
329  else {
330  ORIGINAL_bnd_ = bnd;
331  // Determine Stochastic Optimization Type
332  std::string type = parlist_->sublist("SOL").get("Stochastic Optimization Type","Risk Neutral");
333  if ( type == "Risk Neutral" || type == "Mean Value" ) {
334  bnd_ = bnd;
335  }
336  else if ( type == "Risk Averse" || type == "BPOE" ) {
337  bnd_ = Teuchos::rcp(new RiskBoundConstraint<Real>(*parlist_,bnd));
338  }
339  else {
340  TEUCHOS_TEST_FOR_EXCEPTION(true,std::logic_error,
341  "Invalid stochastic optimization type" << type);
342  }
343  // Set OptimizationProblem data
345  }
346  }
347 
348 // Real getSolutionStatistic(void) {
349 // try {
350 // return Teuchos::dyn_cast<const RiskVector<Real> >(
351 // Teuchos::dyn_cast<const Vector<Real> >(*vec_)).getStatistic(0);
352 // }
353 // catch (std::exception &e) {
354 // return 0.;
355 // }
356 // }
357 
358  Real getSolutionStatistic(void) {
359  if ( parlist_ == Teuchos::null ) {
360  TEUCHOS_TEST_FOR_EXCEPTION(true, std::invalid_argument,
361  ">>> ERROR (ROL::StochasticProblem): parameter list not set!");
362  }
363  else {
364  try {
365  const RiskVector<Real> x = Teuchos::dyn_cast<const RiskVector<Real> >(
366  Teuchos::dyn_cast<const Vector<Real> >(*vec_));
367  std::string type = parlist_->sublist("SOL").get("Stochastic Optimization Type","Risk Neutral");
368  Real val(0);
369  if ( type == "Risk Averse" ) {
370  Teuchos::ParameterList &list
371  = parlist_->sublist("SOL").sublist("Risk Measure");
372  std::string risk = list.get("Name","CVaR");
373  if ( risk == "Mixed-Quantile Quadrangle" ) {
374  Teuchos::ParameterList &MQQlist = list.sublist("Mixed-Quantile Quadrangle");
375  Teuchos::Array<Real> coeff
376  = Teuchos::getArrayFromStringParameter<Real>(MQQlist,"Coefficient Array");
377  for (int i = 0; i < coeff.size(); i++) {
378  val += coeff[i]*x.getStatistic(i);
379  }
380  }
381  else if ( risk == "Super Quantile Quadrangle" ) {
383  val = sqq.computeStatistic(*vec_);
384  }
385  else if ( risk == "Chebyshev-Kusuoka" ) {
387  val = static_cast<SpectralRisk<Real> >(sqq).computeStatistic(*vec_);
388  }
389  else if ( risk == "Spectral Risk" ) {
391  val = sqq.computeStatistic(*vec_);
392  }
393  else if ( risk == "Quantile-Radius Quadrangle" ) {
394  Real half(0.5);
395  val = half*(x.getStatistic(0) + x.getStatistic(1));
396  }
397  else {
398  val = x.getStatistic(0);
399  }
400  }
401  else {
402  val = x.getStatistic(0);
403  }
404  return val;
405  }
406  catch (std::exception &e) {
407  return 0;
408  }
409  }
410  }
411 
412  std::vector<std::vector<Real> > checkObjectiveGradient( const Vector<Real> &d,
413  const bool printToStream = true,
414  std::ostream & outStream = std::cout,
415  const int numSteps = ROL_NUM_CHECKDERIV_STEPS,
416  const int order = 1 ) {
417  Teuchos::RCP<Vector<Real> > dp = d.clone();
418  dp->set(d);
419  Real stat(5.1264386);
420  Teuchos::RCP<Vector<Real> > D = createVector(dp,stat);
421  return OptimizationProblem<Real>::checkObjectiveGradient(*D,printToStream,outStream,numSteps,order);
422  }
423 
424  std::vector<std::vector<Real> > checkObjectiveHessVec( const Vector<Real> &v,
425  const bool printToStream = true,
426  std::ostream & outStream = std::cout,
427  const int numSteps = ROL_NUM_CHECKDERIV_STEPS,
428  const int order = 1 ) {
429  Teuchos::RCP<Vector<Real> > vp = v.clone();
430  vp->set(v);
431  Real stat(3.223468906);
432  Teuchos::RCP<Vector<Real> > V = createVector(vp,stat);
433  return OptimizationProblem<Real>::checkObjectiveHessVec(*V,printToStream,outStream,numSteps,order);
434  }
435 
436 private:
437  std::vector<Real> computeSampleMean(Teuchos::RCP<SampleGenerator<Real> > &sampler) {
438  // Compute mean value of inputs and set parameter in objective
439  int dim = sampler->getMyPoint(0).size(), nsamp = sampler->numMySamples();
440  std::vector<Real> loc(dim), mean(dim), pt(dim);
441  Real wt(0);
442  for (int i = 0; i < nsamp; i++) {
443  pt = sampler->getMyPoint(i);
444  wt = sampler->getMyWeight(i);
445  for (int j = 0; j < dim; j++) {
446  loc[j] += wt*pt[j];
447  }
448  }
449  sampler->sumAll(&loc[0],&mean[0],dim);
450  return mean;
451  }
452 
453  Teuchos::RCP<Vector<Real> > createVector(Teuchos::RCP<Vector<Real> > &vec, Real stat = 1) {
454  if ( parlist_ == Teuchos::null ) {
455  TEUCHOS_TEST_FOR_EXCEPTION(true, std::invalid_argument,
456  ">>> ERROR (ROL::StochasticProblem): parameter list not set!");
457  }
458  else {
459  // Determine Stochastic Optimization Type
460  std::string type = parlist_->sublist("SOL").get("Stochastic Optimization Type","Risk Neutral");
461  if ( type == "Risk Neutral" || type == "Mean Value" ) {
462  return vec;
463  }
464  else if ( type == "Risk Averse" ) {
465  return Teuchos::rcp(new RiskVector<Real>(*parlist_,vec,stat));
466  }
467  else if ( type == "BPOE" ) {
468  std::vector<Real> statistic(1,stat);
469  return Teuchos::rcp(new RiskVector<Real>(vec,statistic,true));
470  }
471  else {
472  TEUCHOS_TEST_FOR_EXCEPTION(true,std::logic_error,
473  "Invalid stochastic optimization type" << type);
474  }
475  }
476  }
477 };
478 }
479 #endif
Provides the interface to evaluate objective functions.
StochasticProblem(Teuchos::ParameterList &parlist, const Teuchos::RCP< Objective< 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)
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)
std::vector< Real > computeSampleMean(Teuchos::RCP< SampleGenerator< Real > > &sampler)
void setGradientSampleGenerator(const Teuchos::RCP< SampleGenerator< Real > > &gsampler)
virtual Teuchos::RCP< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
Real computeStatistic(const Vector< Real > &x) const
StochasticProblem(Teuchos::ParameterList &parlist, const Teuchos::RCP< Objective< 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)
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)
StochasticProblem(Teuchos::ParameterList &parlist, const Teuchos::RCP< Objective< Real > > &obj, const Teuchos::RCP< SampleGenerator< Real > > &sampler, const Teuchos::RCP< Vector< Real > > &vec)
Teuchos::RCP< SampleGenerator< Real > > vsampler_
StochasticProblem(Teuchos::ParameterList &parlist, const Teuchos::RCP< Objective< Real > > &obj, const Teuchos::RCP< SampleGenerator< Real > > &sampler, const Teuchos::RCP< Vector< Real > > &vec, const Teuchos::RCP< BoundConstraint< Real > > &bnd)
void setObjective(const Teuchos::RCP< Objective< Real > > &obj)
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)
Provides an interface for the risk measure associated with the super quantile quadrangle.
Provides an interface for spectral risk measures.
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< Objective< 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)
Provides the interface to apply upper and lower bound constraints.
Teuchos::RCP< SampleGenerator< Real > > gsampler_
Teuchos::RCP< Vector< Real > > vec_
#define ROL_NUM_CHECKDERIV_STEPS
Number of steps for derivative checks.
Definition: ROL_Types.hpp:73
Teuchos::RCP< Objective< Real > > ORIGINAL_obj_
Teuchos::RCP< Teuchos::ParameterList > parlist_
Teuchos::RCP< const StdVector< Real > > getStatistic(void) const
void setSolutionStatistic(const Real stat)
Teuchos::RCP< Vector< Real > > createVector(Teuchos::RCP< Vector< Real > > &vec, Real stat=1)
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)
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_
StochasticProblem(Teuchos::ParameterList &parlist, const Teuchos::RCP< Objective< Real > > &obj, const Teuchos::RCP< SampleGenerator< Real > > &vsampler, const Teuchos::RCP< SampleGenerator< Real > > &gsampler, const Teuchos::RCP< Vector< Real > > &vec)
Provides an interface for the Chebyshev-Kusuoka risk measure.
Teuchos::RCP< SampleGenerator< Real > > hsampler_