MUQ  0.4.3
SamplingAlgorithm.cpp
Go to the documentation of this file.
2 
3 using namespace muq::SamplingAlgorithms;
4 
5 SamplingAlgorithm::SamplingAlgorithm(std::shared_ptr<SampleCollection> const& samplesIn, std::shared_ptr<SampleCollection> const& QOIsIn) : samples(samplesIn), QOIs(QOIsIn) {}
6 
7 SamplingAlgorithm::SamplingAlgorithm(std::shared_ptr<SampleCollection> const& samplesIn) : SamplingAlgorithm(samplesIn, std::make_shared<SampleCollection>()) {}
8 
9 #if MUQ_HAS_PARCER
10 SamplingAlgorithm::SamplingAlgorithm(std::shared_ptr<SampleCollection> const& samplesIn, std::shared_ptr<parcer::Communicator> const& comm) : samples(samplesIn), comm(comm) {}
11 #endif
12 
13 std::shared_ptr<SampleCollection> SamplingAlgorithm::GetSamples() const { return samples; }
14 
15 std::shared_ptr<SampleCollection> SamplingAlgorithm::GetQOIs() const { return QOIs; }
16 
17 void SamplingAlgorithm::SetState(std::vector<Eigen::VectorXd> const& x0) {}
18 
19 std::shared_ptr<SampleCollection> SamplingAlgorithm::Run(std::vector<Eigen::VectorXd> const& x0) { return RunImpl(x0); };
20 
21 #if MUQ_HAS_PARCER
22 std::shared_ptr<parcer::Communicator> SamplingAlgorithm::GetCommunicator() const { return comm; }
23 #endif
A class to hold and analyze a collection of SamplingState objects.
virtual std::shared_ptr< SampleCollection > GetSamples() const
virtual void SetState(std::vector< Eigen::VectorXd > const &x0)
virtual std::shared_ptr< SampleCollection > RunImpl(std::vector< Eigen::VectorXd > const &x0)=0
std::shared_ptr< SampleCollection > QOIs
virtual std::shared_ptr< SampleCollection > GetQOIs() const
std::shared_ptr< parcer::Communicator > comm
std::shared_ptr< parcer::Communicator > GetCommunicator() const
virtual std::shared_ptr< SampleCollection > Run(std::vector< Eigen::VectorXd > const &x0=std::vector< Eigen::VectorXd >())
SamplingAlgorithm(std::shared_ptr< SampleCollection > const &samples)
std::shared_ptr< SampleCollection > samples