SemiDiscreteOT 1.0
Semi-Discrete Optimal Transport Library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
OptimalTransportPlanSpace::ModalStrategy< spacedim > Class Template Reference

Modal strategy for map approximation. More...

#include <OptimalTransportPlan.h>

Inheritance diagram for OptimalTransportPlanSpace::ModalStrategy< spacedim >:
Inheritance graph
[legend]
Collaboration diagram for OptimalTransportPlanSpace::ModalStrategy< spacedim >:
Collaboration graph
[legend]

Public Member Functions

void compute_map (const std::function< double(const Point< spacedim > &, const Point< spacedim > &)> distance_function, const std::vector< Point< spacedim > > &source_points, const std::vector< double > &source_density, const std::vector< Point< spacedim > > &target_points, const std::vector< double > &target_density, const Vector< double > &potential, const double regularization_param, const double truncation_radius) override
 Computes the transport map.
 
void save_results (const std::string &output_dir) const override
 Saves the results to a file.
 
- Public Member Functions inherited from OptimalTransportPlanSpace::MapApproximationStrategy< spacedim >
virtual ~MapApproximationStrategy ()=default
 

Additional Inherited Members

- Protected Attributes inherited from OptimalTransportPlanSpace::MapApproximationStrategy< spacedim >
std::vector< Point< spacedim > > source_points
 The source points.
 
std::vector< Point< spacedim > > mapped_points
 The mapped points.
 
std::vector< double > transport_density
 The transported density.
 

Detailed Description

template<int spacedim>
class OptimalTransportPlanSpace::ModalStrategy< spacedim >

Modal strategy for map approximation.

Maps each source point to the target point that maximizes: score = potential[j] - 0.5*||x-y||^2 + regularization_param * log(target_density[j])

Template Parameters
spacedimThe dimension of the space the mesh is embedded in.

Definition at line 194 of file OptimalTransportPlan.h.

Member Function Documentation

◆ compute_map()

template<int spacedim>
void OptimalTransportPlanSpace::ModalStrategy< spacedim >::compute_map ( const std::function< double(const Point< spacedim > &, const Point< spacedim > &)>  distance_function,
const std::vector< Point< spacedim > > &  source_points,
const std::vector< double > &  source_density,
const std::vector< Point< spacedim > > &  target_points,
const std::vector< double > &  target_density,
const Vector< double > &  potential,
const double  regularization_param,
const double  truncation_radius 
)
overridevirtual

Computes the transport map.

Parameters
distance_functionThe distance function.
source_pointsThe source points.
source_densityThe source density.
target_pointsThe target points.
target_densityThe target density.
potentialThe optimal transport potential.
regularization_paramThe regularization parameter.
truncation_radiusThe truncation radius.

Implements OptimalTransportPlanSpace::MapApproximationStrategy< spacedim >.

Definition at line 100 of file OptimalTransportPlan.cc.

◆ save_results()

template<int spacedim>
void OptimalTransportPlanSpace::ModalStrategy< spacedim >::save_results ( const std::string &  output_dir) const
overridevirtual

Saves the results to a file.

Parameters
output_dirThe directory to save the results to.

Implements OptimalTransportPlanSpace::MapApproximationStrategy< spacedim >.

Definition at line 192 of file OptimalTransportPlan.cc.

Here is the call graph for this function:

The documentation for this class was generated from the following files: