libROM  v1.0
Data-driven physical simulation library
MatrixInterpolator.h
1 
11 // Description: Computes the MatrixInterpolator algorithm on the given snapshot matrix.
12 
13 #ifndef included_MatrixInterpolator_h
14 #define included_MatrixInterpolator_h
15 
16 #include "Interpolator.h"
17 #include <vector>
18 #include <string>
19 
20 namespace CAROM {
21 
22 class Matrix;
23 class Vector;
24 
35 {
36 public:
37 
63  MatrixInterpolator(const std::vector<Vector> & parameter_points,
64  const std::vector<std::shared_ptr<Matrix>> & rotation_matrices,
65  const std::vector<std::shared_ptr<Matrix>> & reduced_matrices,
66  int ref_point,
67  std::string matrix_type,
68  std::string rbf = "G",
69  std::string interp_method = "LS",
70  double closest_rbf_val = 0.9,
71  bool compute_gradients = false);
72 
79  std::shared_ptr<Matrix> interpolate(const Vector & point,
80  bool orthogonalize = false);
81 
86  std::vector<std::shared_ptr<Matrix>> getGradient() {
87  return d_interpolation_gradient;
88  }
89 
90 private:
91 
96 
101  const MatrixInterpolator& other);
102 
107  operator = (
108  const MatrixInterpolator& rhs);
109 
114  void obtainLambda();
115 
122  std::unique_ptr<Matrix> obtainLogInterpolatedMatrix(std::vector<double>& rbf);
123 
130  std::shared_ptr<Matrix> interpolateSPDMatrix(const Vector & point);
131 
138  std::shared_ptr<Matrix> interpolateNonSingularMatrix(const Vector & point);
139 
146  std::shared_ptr<Matrix> interpolateMatrix(const Vector & point);
147 
151  std::string d_matrix_type;
152 
156  std::vector<std::shared_ptr<Matrix>> d_rotated_reduced_matrices;
157 
161  std::vector<std::shared_ptr<Matrix>> d_gammas;
162 
166  std::shared_ptr<Matrix> d_x_half_power;
167 
172  std::vector<std::shared_ptr<Matrix>> d_interpolation_gradient;
173 };
174 
175 }
176 
177 #endif
std::vector< std::shared_ptr< Matrix > > getGradient()
Returns the interpolated matrix's gradient.
std::shared_ptr< Matrix > interpolate(const Vector &point, bool orthogonalize=false)
Obtain the interpolated reduced matrix of the unsampled parameter point.