SemiDiscreteOT 1.0
Semi-Discrete Optimal Transport Library
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ExactSot Class Reference

Class to handle exact semi-discrete optimal transport using Geogram. More...

#include <ExactSot.h>

Public Member Functions

 ExactSot ()
 Constructor.
 
 ~ExactSot ()
 Destructor.
 
 ExactSot (const ExactSot &)=delete
 
ExactSotoperator= (const ExactSot &)=delete
 
bool set_source_mesh (const std::string &filename)
 Set source mesh from file.
 
bool set_target_points (const std::string &filename, const std::string &io_coding)
 Set target points from file.
 
void set_parameters (unsigned int max_iterations=1000, double epsilon=0.01)
 Set parameters for the solver.
 
bool run ()
 Run the exact SOT computation.
 
std::vector< double > get_potential () const
 Get computed potential.
 
std::vector< dealii::Point< 3 > > get_target_points () const
 Get target points.
 
bool save_results (const std::string &potential_file, const std::string &points_file, const std::string &io_coding="txt") const
 Save computation results to files.
 

Private Member Functions

bool load_volume_mesh (const std::string &filename, GEO::Mesh &mesh)
 

Private Attributes

std::unique_ptr< GEO::Mesh > source_mesh
 
GEO::vector< double > potential
 
std::vector< dealii::Point< 3 > > target_points
 
unsigned int max_iterations_
 
double epsilon_
 

Detailed Description

Class to handle exact semi-discrete optimal transport using Geogram.

This class provides a clean interface to compute exact semi-discrete optimal transport between a source mesh and target points using the Geogram library.

Definition at line 39 of file ExactSot.h.

Constructor & Destructor Documentation

◆ ExactSot() [1/2]

ExactSot::ExactSot ( )

Constructor.

Definition at line 4 of file ExactSot.cc.

◆ ~ExactSot()

ExactSot::~ExactSot ( )
default

Destructor.

◆ ExactSot() [2/2]

ExactSot::ExactSot ( const ExactSot )
delete

Member Function Documentation

◆ operator=()

ExactSot & ExactSot::operator= ( const ExactSot )
delete

◆ set_source_mesh()

bool ExactSot::set_source_mesh ( const std::string &  filename)

Set source mesh from file.

Parameters
filenamePath to the source mesh file
Returns
true if successful, false otherwise

Definition at line 79 of file ExactSot.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_target_points()

bool ExactSot::set_target_points ( const std::string &  filename,
const std::string &  io_coding 
)

Set target points from file.

Parameters
filenamePath to the target points file
Returns
true if successful, false otherwise

Definition at line 83 of file ExactSot.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_parameters()

void ExactSot::set_parameters ( unsigned int  max_iterations = 1000,
double  epsilon = 0.01 
)

Set parameters for the solver.

Parameters
max_iterationsMaximum number of iterations
epsilonConvergence tolerance

Definition at line 87 of file ExactSot.cc.

Here is the caller graph for this function:

◆ run()

bool ExactSot::run ( )

Run the exact SOT computation.

Returns
true if successful, false otherwise

Definition at line 93 of file ExactSot.cc.

Here is the caller graph for this function:

◆ get_potential()

std::vector< double > ExactSot::get_potential ( ) const

Get computed potential.

Returns
Vector of computed optimal transport potential values

Definition at line 153 of file ExactSot.cc.

◆ get_target_points()

std::vector< dealii::Point< 3 > > ExactSot::get_target_points ( ) const

Get target points.

Returns
Vector of target points

Definition at line 157 of file ExactSot.cc.

◆ save_results()

bool ExactSot::save_results ( const std::string &  potential_file,
const std::string &  points_file,
const std::string &  io_coding = "txt" 
) const

Save computation results to files.

Parameters
potential_filePath to save potential values
points_filePath to save target points
io_codingCoding format for file I/O
Returns
True if successful, false otherwise

Definition at line 161 of file ExactSot.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_volume_mesh()

bool ExactSot::load_volume_mesh ( const std::string &  filename,
GEO::Mesh &  mesh 
)
private

Definition at line 52 of file ExactSot.cc.

Here is the caller graph for this function:

Member Data Documentation

◆ source_mesh

std::unique_ptr<GEO::Mesh> ExactSot::source_mesh
private

Definition at line 111 of file ExactSot.h.

◆ potential

GEO::vector<double> ExactSot::potential
private

Definition at line 112 of file ExactSot.h.

◆ target_points

std::vector<dealii::Point<3> > ExactSot::target_points
private

Definition at line 113 of file ExactSot.h.

◆ max_iterations_

unsigned int ExactSot::max_iterations_
private

Definition at line 116 of file ExactSot.h.

◆ epsilon_

double ExactSot::epsilon_
private

Definition at line 117 of file ExactSot.h.


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