queso-0.53.0
InterpolationSurrogateBuilder.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008-2015 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef UQ_INTERPOLATION_SURROGATE_BUILDER_H
26 #define UQ_INTERPOLATION_SURROGATE_BUILDER_H
27 
28 #include <queso/SurrogateBuilderBase.h>
29 #include <queso/InterpolationSurrogateDataSet.h>
30 
31 namespace QUESO
32 {
33  class GslVector;
34  class GslMatrix;
35 
37 
42  template<class V = GslVector, class M = GslMatrix>
44  {
45  public:
46 
48 
51 
53 
55  void build_values();
56 
57  protected:
58 
60 
62  std::vector<int> m_njobs;
63 
65  void partition_work();
66 
68 
69  void set_work_bounds( unsigned int& n_begin, unsigned int& n_end ) const;
70 
72 
76  void sync_data( std::vector<unsigned int>& local_n,
77  std::vector<double>& local_values,
79 
81  void set_domain_vector( unsigned int n, V& domain_vector ) const;
82 
84  void compute_strides( std::vector<int>& strides ) const;
85 
87 
90  { return m_data.get_dataset(0); }
91 
92  private:
93 
95 
96  };
97 
98 } // end namespace QUESO
99 
100 #endif // UQ_INTERPOLATION_SURROGATE_BUILDER_H
void partition_work()
Partition the workload of model evaluations across the subenvironments.
void set_domain_vector(unsigned int n, V &domain_vector) const
Provide the spatial coordinates for the global index n.
void sync_data(std::vector< unsigned int > &local_n, std::vector< double > &local_values, InterpolationSurrogateData< V, M > &data)
Take the local values computed from each process and communicate.
const InterpolationSurrogateData< V, M > & get_default_data() const
Helper function to grab representative dataset from m_data.
InterpolationSurrogateDataSet< V, M > & m_data
Container class for multiple, consistent InterpolationSurrogateData objects.
void set_work_bounds(unsigned int &n_begin, unsigned int &n_end) const
Set the starting and ending global indices for the current subenvironment.
std::vector< int > m_njobs
Cache the amount of work for each subenvironment.
Base class for builders of surrogates.
void build_values()
Execute the user&#39;s model and populate m_values for the given n_points.
void compute_strides(std::vector< int > &strides) const
Helper function to compute strides needed for MPI_Gatherv.
Build interpolation-based surrogate.

Generated on Thu Jun 11 2015 13:52:33 for queso-0.53.0 by  doxygen 1.8.5