1 #ifndef __NEAREST_NEIGHBORS__ 2 #define __NEAREST_NEIGHBORS__ 4 #include <eigen/Eigen/Dense> 5 #include <deal.II/lac/la_parallel_vector.h> 6 #include "min_max_scaler.h" 9 namespace ProperOrthogonalDecomposition {
10 using Eigen::MatrixXd;
11 using Eigen::VectorXd;
12 using Eigen::RowVectorXd;
22 void update_snapshots(
const MatrixXd& snapshot_parameters, dealii::LinearAlgebra::distributed::Vector<double> snapshot);
31 dealii::LinearAlgebra::distributed::Vector<double> nearestNeighborMidpointSolution(
const RowVectorXd& point);
43 std::vector<dealii::LinearAlgebra::distributed::Vector<double>>
snapshots;
MinMaxScaler scaler
Scaler.
NearestNeighbors()
Constructor.
void update_snapshots(const MatrixXd &snapshot_parameters, dealii::LinearAlgebra::distributed::Vector< double > snapshot)
Add snapshot.
MatrixXd snapshot_params
Snapshot parameters.
Files for the baseline physics.
MatrixXd scaled_snapshot_params
Scaled snapshot parameters.
std::vector< dealii::LinearAlgebra::distributed::Vector< double > > snapshots
Vector containing all snapshots.
MatrixXd kPairwiseNearestNeighborsMidpoint()
Find midpoint of all snapshot locations.
MatrixXd kNearestNeighborsMidpoint(const RowVectorXd &point)
Given a point, returns midpoint between point and k nearest snapshots, where k is 1+num_parameters...
Scale data between 0 and 1.