ROL
ROL::MonteCarloGenerator< Real > Class Template Reference

#include <ROL_MonteCarloGenerator.hpp>

Inheritance diagram for ROL::MonteCarloGenerator< Real >:

Public Member Functions

 MonteCarloGenerator (int nSamp, const std::vector< Ptr< Distribution< Real > > > &dist, const Ptr< BatchManager< Real > > &bman, bool use_SA=false, bool adaptive=false, int numNewSamps=0, int seed=123454321)
 MonteCarloGenerator (int nSamp, std::vector< std::vector< Real > > &bounds, const Ptr< BatchManager< Real > > &bman, bool use_SA=false, bool adaptive=false, int numNewSamps=0, int seed=123454321)
 MonteCarloGenerator (int nSamp, const std::vector< Real > &mean, const std::vector< Real > &std, const Ptr< BatchManager< Real > > &bman, bool use_SA=false, bool adaptive=false, int numNewSamps=0, int seed=123454321)
void update (const Vector< Real > &x) override
Real computeError (std::vector< Real > &vals) override
Real computeError (std::vector< Ptr< Vector< Real > > > &vals, const Vector< Real > &x) override
void refine (void) override
int numGlobalSamples (void) const override
Public Member Functions inherited from ROL::SampleGenerator< Real >
virtual ~SampleGenerator ()
 SampleGenerator (const ROL::Ptr< BatchManager< Real > > &bman)
 SampleGenerator (const SampleGenerator< Real > &sampler)
virtual int start (void)
virtual Real computeError (std::vector< ROL::Ptr< Vector< Real > > > &vals, const Vector< Real > &x)
virtual void setSamples (bool inConstructor=false)
virtual int numMySamples (void) const
virtual std::vector< Real > getMyPoint (const int i) const
virtual Real getMyWeight (const int i) const
int batchID (void) const
int numBatches (void) const
void sumAll (Real *input, Real *output, int dim) const
void sumAll (Vector< Real > &input, Vector< Real > &output) const
void broadcast (Real *input, int cnt, int root) const
void barrier (void) const
const ROL::Ptr< BatchManager< Real > > getBatchManager (void) const
void print (const std::string &filename="samples", const int prec=12) const

Private Member Functions

Real ierf (Real input) const
Real random (void) const
std::vector< std::vector< Real > > sample (int nSamp, bool store=true, bool refine=false)

Private Attributes

std::vector< std::vector< Real > > data_
const std::vector< Ptr< Distribution< Real > > > dist_
int nSamp_
const bool use_normal_
const bool use_SA_
const bool adaptive_
const int numNewSamps_
const bool useDist_
const int seed_
Real sum_val_
Real sum_val2_
Real sum_ng_
Real sum_ng2_

Additional Inherited Members

Protected Member Functions inherited from ROL::SampleGenerator< Real >
void setPoints (std::vector< std::vector< Real > > &p)
void setWeights (std::vector< Real > &w)

Detailed Description

template<typename Real>
class ROL::MonteCarloGenerator< Real >

Definition at line 19 of file ROL_MonteCarloGenerator.hpp.

Constructor & Destructor Documentation

◆ MonteCarloGenerator() [1/3]

template<typename Real>
ROL::MonteCarloGenerator< Real >::MonteCarloGenerator ( int nSamp,
const std::vector< Ptr< Distribution< Real > > > & dist,
const Ptr< BatchManager< Real > > & bman,
bool use_SA = false,
bool adaptive = false,
int numNewSamps = 0,
int seed = 123454321 )

◆ MonteCarloGenerator() [2/3]

template<typename Real>
ROL::MonteCarloGenerator< Real >::MonteCarloGenerator ( int nSamp,
std::vector< std::vector< Real > > & bounds,
const Ptr< BatchManager< Real > > & bman,
bool use_SA = false,
bool adaptive = false,
int numNewSamps = 0,
int seed = 123454321 )

◆ MonteCarloGenerator() [3/3]

template<typename Real>
ROL::MonteCarloGenerator< Real >::MonteCarloGenerator ( int nSamp,
const std::vector< Real > & mean,
const std::vector< Real > & std,
const Ptr< BatchManager< Real > > & bman,
bool use_SA = false,
bool adaptive = false,
int numNewSamps = 0,
int seed = 123454321 )

Member Function Documentation

◆ ierf()

template<typename Real>
Real ROL::MonteCarloGenerator< Real >::ierf ( Real input) const
private

Definition at line 16 of file ROL_MonteCarloGeneratorDef.hpp.

References ROL::ScalarTraits< Real >::pi(), and zero.

Referenced by sample().

◆ random()

template<typename Real>
Real ROL::MonteCarloGenerator< Real >::random ( void ) const
private

Definition at line 38 of file ROL_MonteCarloGeneratorDef.hpp.

◆ sample()

◆ update()

template<typename Real>
void ROL::MonteCarloGenerator< Real >::update ( const Vector< Real > & x)
overridevirtual

◆ computeError() [1/2]

template<typename Real>
Real ROL::MonteCarloGenerator< Real >::computeError ( std::vector< Real > & vals)
overridevirtual

◆ computeError() [2/2]

template<typename Real>
Real ROL::MonteCarloGenerator< Real >::computeError ( std::vector< Ptr< Vector< Real > > > & vals,
const Vector< Real > & x )
override

◆ refine()

◆ numGlobalSamples()

template<typename Real>
int ROL::MonteCarloGenerator< Real >::numGlobalSamples ( void ) const
overridevirtual

Reimplemented from ROL::SampleGenerator< Real >.

Definition at line 267 of file ROL_MonteCarloGeneratorDef.hpp.

References nSamp_.

Member Data Documentation

◆ data_

template<typename Real>
std::vector<std::vector<Real> > ROL::MonteCarloGenerator< Real >::data_
private

Definition at line 21 of file ROL_MonteCarloGenerator.hpp.

Referenced by MonteCarloGenerator(), MonteCarloGenerator(), and sample().

◆ dist_

template<typename Real>
const std::vector<Ptr<Distribution<Real> > > ROL::MonteCarloGenerator< Real >::dist_
private

Definition at line 22 of file ROL_MonteCarloGenerator.hpp.

Referenced by MonteCarloGenerator(), and sample().

◆ nSamp_

◆ use_normal_

template<typename Real>
const bool ROL::MonteCarloGenerator< Real >::use_normal_
private

◆ use_SA_

template<typename Real>
const bool ROL::MonteCarloGenerator< Real >::use_SA_
private

◆ adaptive_

template<typename Real>
const bool ROL::MonteCarloGenerator< Real >::adaptive_
private

◆ numNewSamps_

template<typename Real>
const int ROL::MonteCarloGenerator< Real >::numNewSamps_
private

◆ useDist_

template<typename Real>
const bool ROL::MonteCarloGenerator< Real >::useDist_
private

◆ seed_

template<typename Real>
const int ROL::MonteCarloGenerator< Real >::seed_
private

◆ sum_val_

template<typename Real>
Real ROL::MonteCarloGenerator< Real >::sum_val_
private

◆ sum_val2_

template<typename Real>
Real ROL::MonteCarloGenerator< Real >::sum_val2_
private

◆ sum_ng_

template<typename Real>
Real ROL::MonteCarloGenerator< Real >::sum_ng_
private

◆ sum_ng2_

template<typename Real>
Real ROL::MonteCarloGenerator< Real >::sum_ng2_
private

The documentation for this class was generated from the following files: