ROL
|
#include <ROL_MonteCarloGenerator.hpp>
Public Member Functions | |
MonteCarloGenerator (const int nSamp, const std::vector< ROL::Ptr< Distribution< Real > > > &dist, const ROL::Ptr< BatchManager< Real > > &bman, const bool use_SA=false, const bool adaptive=false, const int numNewSamps=0, const int seed=123454321) | |
MonteCarloGenerator (const int nSamp, std::vector< std::vector< Real > > &bounds, const ROL::Ptr< BatchManager< Real > > &bman, const bool use_SA=false, const bool adaptive=false, const int numNewSamps=0, const int seed=123454321) | |
MonteCarloGenerator (const int nSamp, const std::vector< Real > &mean, const std::vector< Real > &std, const ROL::Ptr< BatchManager< Real > > &bman, const bool use_SA=false, const bool adaptive=false, const int numNewSamps=0, const int seed=123454321) | |
void | update (const Vector< Real > &x) |
Real | computeError (std::vector< Real > &vals) |
Real | computeError (std::vector< ROL::Ptr< Vector< Real > > > &vals, const Vector< Real > &x) |
void | refine (void) |
int | numGlobalSamples (void) const |
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 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) |
void | sample (void) |
Private Attributes | |
int | nSamp_ |
const bool | use_normal_ |
const bool | use_SA_ |
const bool | adaptive_ |
const int | numNewSamps_ |
std::vector< std::vector< Real > > | data_ |
Real | sum_val_ |
Real | sum_val2_ |
Real | sum_ng_ |
Real | sum_ng2_ |
const bool | useDist_ |
const std::vector< ROL::Ptr < Distribution< Real > > > | dist_ |
const int | seed_ |
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) |
Definition at line 53 of file ROL_MonteCarloGenerator.hpp.
|
inline |
Definition at line 159 of file ROL_MonteCarloGenerator.hpp.
References ROL::MonteCarloGenerator< Real >::nSamp_, ROL::SampleGenerator< Real >::numBatches(), and ROL::MonteCarloGenerator< Real >::sample().
|
inline |
Definition at line 185 of file ROL_MonteCarloGenerator.hpp.
References ROL::MonteCarloGenerator< Real >::data_, dim, ROL::MonteCarloGenerator< Real >::nSamp_, ROL::SampleGenerator< Real >::numBatches(), and ROL::MonteCarloGenerator< Real >::sample().
|
inline |
Definition at line 222 of file ROL_MonteCarloGenerator.hpp.
References ROL::MonteCarloGenerator< Real >::data_, dim, ROL::MonteCarloGenerator< Real >::nSamp_, ROL::SampleGenerator< Real >::numBatches(), and ROL::MonteCarloGenerator< Real >::sample().
|
inlineprivate |
Definition at line 72 of file ROL_MonteCarloGenerator.hpp.
References ROL::ScalarTraits< Real >::pi(), and zero.
Referenced by ROL::MonteCarloGenerator< Real >::sample().
|
inlineprivate |
Definition at line 94 of file ROL_MonteCarloGenerator.hpp.
Referenced by ROL::MonteCarloGenerator< Real >::sample().
|
inlineprivate |
Definition at line 98 of file ROL_MonteCarloGenerator.hpp.
References ROL::SampleGenerator< Real >::batchID(), ROL::SampleGenerator< Real >::broadcast(), ROL::MonteCarloGenerator< Real >::data_, dim, ROL::MonteCarloGenerator< Real >::dist_, ROL::MonteCarloGenerator< Real >::ierf(), ROL::SampleGenerator< Real >::numBatches(), ROL::MonteCarloGenerator< Real >::random(), ROL::MonteCarloGenerator< Real >::seed_, ROL::SampleGenerator< Real >::setPoints(), ROL::SampleGenerator< Real >::setWeights(), ROL::MonteCarloGenerator< Real >::use_normal_, ROL::MonteCarloGenerator< Real >::useDist_, and zero.
|
inlineprivate |
Definition at line 154 of file ROL_MonteCarloGenerator.hpp.
References ROL::MonteCarloGenerator< Real >::nSamp_.
Referenced by ROL::MonteCarloGenerator< Real >::MonteCarloGenerator(), ROL::MonteCarloGenerator< Real >::refine(), and ROL::MonteCarloGenerator< Real >::update().
|
inlinevirtual |
Reimplemented from ROL::SampleGenerator< Real >.
Definition at line 256 of file ROL_MonteCarloGenerator.hpp.
References ROL::MonteCarloGenerator< Real >::sample(), ROL::MonteCarloGenerator< Real >::sum_ng_, ROL::MonteCarloGenerator< Real >::sum_val2_, ROL::MonteCarloGenerator< Real >::sum_val_, ROL::SampleGenerator< Real >::update(), ROL::MonteCarloGenerator< Real >::use_SA_, and zero.
|
inlinevirtual |
Reimplemented from ROL::SampleGenerator< Real >.
Definition at line 268 of file ROL_MonteCarloGenerator.hpp.
References ROL::MonteCarloGenerator< Real >::adaptive_, ROL::MonteCarloGenerator< Real >::nSamp_, ROL::MonteCarloGenerator< Real >::sum_val2_, ROL::MonteCarloGenerator< Real >::sum_val_, ROL::SampleGenerator< Real >::sumAll(), ROL::MonteCarloGenerator< Real >::use_SA_, and zero.
|
inlinevirtual |
Reimplemented from ROL::SampleGenerator< Real >.
Definition at line 295 of file ROL_MonteCarloGenerator.hpp.
References ROL::MonteCarloGenerator< Real >::adaptive_, ROL::MonteCarloGenerator< Real >::nSamp_, ROL::MonteCarloGenerator< Real >::sum_ng2_, ROL::MonteCarloGenerator< Real >::sum_ng_, ROL::SampleGenerator< Real >::sumAll(), ROL::MonteCarloGenerator< Real >::use_SA_, and zero.
|
inlinevirtual |
Reimplemented from ROL::SampleGenerator< Real >.
Definition at line 324 of file ROL_MonteCarloGenerator.hpp.
References ROL::MonteCarloGenerator< Real >::adaptive_, ROL::MonteCarloGenerator< Real >::data_, ROL::SampleGenerator< Real >::getMyPoint(), ROL::MonteCarloGenerator< Real >::nSamp_, ROL::MonteCarloGenerator< Real >::numNewSamps_, ROL::SampleGenerator< Real >::refine(), ROL::MonteCarloGenerator< Real >::sample(), ROL::SampleGenerator< Real >::setPoints(), ROL::SampleGenerator< Real >::setWeights(), ROL::MonteCarloGenerator< Real >::use_SA_, and zero.
|
inlinevirtual |
Reimplemented from ROL::SampleGenerator< Real >.
Definition at line 343 of file ROL_MonteCarloGenerator.hpp.
References ROL::MonteCarloGenerator< Real >::nSamp_.
|
private |
Definition at line 55 of file ROL_MonteCarloGenerator.hpp.
Referenced by ROL::MonteCarloGenerator< Real >::computeError(), ROL::MonteCarloGenerator< Real >::MonteCarloGenerator(), ROL::MonteCarloGenerator< Real >::numGlobalSamples(), ROL::MonteCarloGenerator< Real >::refine(), and ROL::MonteCarloGenerator< Real >::sample().
|
private |
Definition at line 56 of file ROL_MonteCarloGenerator.hpp.
Referenced by ROL::MonteCarloGenerator< Real >::sample().
|
private |
Definition at line 57 of file ROL_MonteCarloGenerator.hpp.
Referenced by ROL::MonteCarloGenerator< Real >::computeError(), ROL::MonteCarloGenerator< Real >::refine(), and ROL::MonteCarloGenerator< Real >::update().
|
private |
Definition at line 58 of file ROL_MonteCarloGenerator.hpp.
Referenced by ROL::MonteCarloGenerator< Real >::computeError(), and ROL::MonteCarloGenerator< Real >::refine().
|
private |
Definition at line 59 of file ROL_MonteCarloGenerator.hpp.
Referenced by ROL::MonteCarloGenerator< Real >::refine().
|
private |
Definition at line 60 of file ROL_MonteCarloGenerator.hpp.
Referenced by ROL::MonteCarloGenerator< Real >::MonteCarloGenerator(), ROL::MonteCarloGenerator< Real >::refine(), and ROL::MonteCarloGenerator< Real >::sample().
|
private |
Definition at line 62 of file ROL_MonteCarloGenerator.hpp.
Referenced by ROL::MonteCarloGenerator< Real >::computeError(), and ROL::MonteCarloGenerator< Real >::update().
|
private |
Definition at line 63 of file ROL_MonteCarloGenerator.hpp.
Referenced by ROL::MonteCarloGenerator< Real >::computeError(), and ROL::MonteCarloGenerator< Real >::update().
|
private |
Definition at line 64 of file ROL_MonteCarloGenerator.hpp.
Referenced by ROL::MonteCarloGenerator< Real >::computeError(), and ROL::MonteCarloGenerator< Real >::update().
|
private |
Definition at line 65 of file ROL_MonteCarloGenerator.hpp.
Referenced by ROL::MonteCarloGenerator< Real >::computeError().
|
private |
Definition at line 67 of file ROL_MonteCarloGenerator.hpp.
Referenced by ROL::MonteCarloGenerator< Real >::sample().
|
private |
Definition at line 68 of file ROL_MonteCarloGenerator.hpp.
Referenced by ROL::MonteCarloGenerator< Real >::sample().
|
private |
Definition at line 70 of file ROL_MonteCarloGenerator.hpp.
Referenced by ROL::MonteCarloGenerator< Real >::sample().