libROM  v1.0
Data-driven physical simulation library
VectorInterpolator.h
1 
11 // Description: Computes the VectorInterpolator algorithm on the given snapshot matrix.
12 
13 #ifndef included_VectorInterpolator_h
14 #define included_VectorInterpolator_h
15 
16 #include "Interpolator.h"
17 #include <memory>
18 #include <vector>
19 #include <string>
20 
21 namespace CAROM {
22 
23 class Matrix;
24 class Vector;
25 
34 {
35 public:
36 
58  VectorInterpolator(const std::vector<Vector> & parameter_points,
59  const std::vector<std::shared_ptr<Matrix>> & rotation_matrices,
60  const std::vector<std::shared_ptr<Vector>> & reduced_vectors,
61  int ref_point,
62  std::string rbf = "G",
63  std::string interp_method = "LS",
64  double closest_rbf_val = 0.9,
65  bool compute_gradients = false);
66 
72  std::shared_ptr<Vector> interpolate(const Vector & point);
73 
78  std::vector<std::shared_ptr<Vector>> getGradient() {
79  return d_interpolation_gradient;
80  }
81 
82 private:
83 
88 
93  const VectorInterpolator& other);
94 
99  operator = (
100  const VectorInterpolator& rhs);
101 
106  void obtainLambda();
107 
115  std::unique_ptr<Vector> obtainLogInterpolatedVector(std::vector<double>& rbf);
116 
120  std::vector<std::shared_ptr<Vector>> d_rotated_reduced_vectors;
121 
125  std::vector<std::shared_ptr<Vector>> d_gammas;
126 
131  std::vector<std::shared_ptr<Vector>> d_interpolation_gradient;
132 };
133 
134 std::unique_ptr<Vector> obtainInterpolatedVector(
135  const std::vector<std::shared_ptr<Vector>> & data,
136  const Matrix & f_T, std::string interp_method,
137  std::vector<double>& rbf);
138 std::unique_ptr<Matrix> solveLinearSystem(
139  const std::vector<Vector> & parameter_points,
140  const std::vector<std::shared_ptr<Vector>> & data,
141  const std::string & interp_method,
142  const std::string & rbf, double epsilon);
143 }
144 
145 #endif
std::shared_ptr< Vector > interpolate(const Vector &point)
Obtain the interpolated reduced vector of the unsampled parameter point.
std::vector< std::shared_ptr< Vector > > getGradient()
Returns the interpolated matrix's gradient.