11 #include "Hyperreduction.h"
17 #include "linalg/Matrix.h"
18 #include "utils/Utilities.h"
22 Hyperreduction::Hyperreduction(
const char* sampling_type)
24 auto iter = SamplingTypeMap.find(sampling_type);
25 CAROM_VERIFY(iter != std::end(SamplingTypeMap));
27 samplingType = iter->second;
30 void Hyperreduction::ComputeSamples(
const std::shared_ptr<Matrix> & f_basis,
31 int num_f_basis_vectors_used,
32 std::vector<int>& f_sampled_row,
33 std::vector<int>& f_sampled_rows_per_proc,
34 Matrix& f_basis_sampled_inv,
37 const int num_samples_req,
38 std::vector<int> *init_samples,
44 CAROM_VERIFY(num_samples_req == f_basis->numColumns());
46 num_f_basis_vectors_used,
48 f_sampled_rows_per_proc,
54 num_f_basis_vectors_used,
56 f_sampled_rows_per_proc,
64 num_f_basis_vectors_used,
66 f_sampled_rows_per_proc,
73 num_f_basis_vectors_used,
75 f_sampled_rows_per_proc,
83 CAROM_ERROR(
"Sampling type not supported");
void DEIM(const Matrix &f_basis, int num_f_basis_vectors_used, std::vector< int > &f_sampled_row, std::vector< int > &f_sampled_rows_per_proc, Matrix &f_basis_sampled_inv, int myid, int num_procs)
Computes the DEIM algorithm on the given basis.
void GNAT(const Matrix &f_basis, const int num_f_basis_vectors_used, std::vector< int > &f_sampled_row, std::vector< int > &f_sampled_rows_per_proc, Matrix &f_basis_sampled_inv, const int myid, const int num_procs, const int num_samples_req, std::vector< int > *init_samples)
Computes the GNAT algorithm on the given basis.
void S_OPT(const Matrix &f_basis, int num_f_basis_vectors_used, std::vector< int > &f_sampled_row, std::vector< int > &f_sampled_rows_per_proc, Matrix &f_basis_sampled_inv, const int myid, const int num_procs, const int num_samples_req, std::vector< int > *init_samples, bool qr_factorize)
Computes the S_OPT algorithm on the given basis.
void QDEIM(const Matrix &f_basis, int num_f_basis_vectors_used, std::vector< int > &f_sampled_row, std::vector< int > &f_sampled_rows_per_proc, Matrix &f_basis_sampled_inv, const int myid, const int num_procs, const int num_samples_req)
Computes the QDEIM algorithm on the given basis.