22template <
int dim,
int spacedim = dim>
41 const double absolute_threshold=1e-8,
42 const unsigned int max_iterations=100);
60 const std::vector<Point<spacedim>>& barycenters_next,
A class for performing Lloyd's algorithm for semi-discrete optimal transport.
void run_centroid_iteration(const unsigned int n_iter)
Runs a single iteration of the centroid computation.
void compute_step_norm(const std::vector< Point< spacedim > > &barycenters_next, const std::vector< Point< spacedim > > &barycenters_prev, double &l2_norm)
Computes the L2 norm of the step.
void run_sot_iteration(const unsigned int n_iter)
Runs a single iteration of the semi-discrete optimal transport solver.
void run_lloyd(const double absolute_threshold=1e-8, const unsigned int max_iterations=100)
Runs the Lloyd's algorithm with the given parameters.
Vector< double > potential
The optimal transport potential.
std::vector< Point< spacedim > > barycenters_prev
The barycenters of the power cells in the previous iteration.
std::vector< Point< spacedim > > barycenters
The barycenters of the power cells.
void run()
Runs the Lloyd's algorithm.
LloydParameterManager param_manager_lloyd
The parameter manager for the Lloyd's algorithm.
Main class for the semi-discrete optimal transport solver.
MPI_Comm mpi_communicator
The MPI communicator.