ROL
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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

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 
)
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 
)
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

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.

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

Definition at line 38 of file ROL_MonteCarloGeneratorDef.hpp.

template<typename Real >
std::vector< std::vector< Real > > ROL::MonteCarloGenerator< Real >::sample ( int  nSamp,
bool  store = true,
bool  refine = false 
)
private
template<typename Real >
void ROL::MonteCarloGenerator< Real >::update ( const Vector< Real > &  x)
overridevirtual

Reimplemented from ROL::SampleGenerator< Real >.

Definition at line 180 of file ROL_MonteCarloGeneratorDef.hpp.

References ROL::update().

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

Reimplemented from ROL::SampleGenerator< Real >.

Definition at line 190 of file ROL_MonteCarloGeneratorDef.hpp.

References zero.

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

Definition at line 219 of file ROL_MonteCarloGeneratorDef.hpp.

References zero.

template<typename Real >
void ROL::MonteCarloGenerator< Real >::refine ( void  )
overridevirtual

Reimplemented from ROL::SampleGenerator< Real >.

Definition at line 251 of file ROL_MonteCarloGeneratorDef.hpp.

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.

Member Data Documentation

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

Definition at line 22 of file ROL_MonteCarloGenerator.hpp.

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

Definition at line 25 of file ROL_MonteCarloGenerator.hpp.

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

Definition at line 26 of file ROL_MonteCarloGenerator.hpp.

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

Definition at line 27 of file ROL_MonteCarloGenerator.hpp.

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

Definition at line 28 of file ROL_MonteCarloGenerator.hpp.

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

Definition at line 29 of file ROL_MonteCarloGenerator.hpp.

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

Definition at line 30 of file ROL_MonteCarloGenerator.hpp.

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

Definition at line 32 of file ROL_MonteCarloGenerator.hpp.

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

Definition at line 33 of file ROL_MonteCarloGenerator.hpp.

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

Definition at line 34 of file ROL_MonteCarloGenerator.hpp.

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

Definition at line 35 of file ROL_MonteCarloGenerator.hpp.


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