deblais
Exact optimal transport between point clouds
Loading...
Searching...
No Matches
deblais::Certificate Struct Reference

Measured optimality of a plan, as returned by certify(). More...

#include <deblais/certificate.hpp>

Public Member Functions

bool optimal (double tol=1e-9) const
 Tells whether every measured error is below a tolerance.

Public Attributes

double primal = 0
 Primal value: sum of mass * |x - y|^p over the arcs of the plan.
double dual = 0
 Dual value: \(\sum_i a_i f_i + \sum_j b_j g_j\).
double gap = 0
 Duality gap |primal - dual| / primal.
double marginal_error = 0
 Largest |row or column sum - mass| / total mass. Infinite if an arc has a negative mass.
double dual_violation = 0
 Largest \(f_i + g_j - |x_i - y_j|^p\) over all the pairs, relative to the largest cost.

Detailed Description

Measured optimality of a plan, as returned by certify().

All the errors are relative: to the total mass for the marginals, to the cost for the gap, and to the largest cost of an arc for the dual violation.

Member Function Documentation

◆ optimal()

bool deblais::Certificate::optimal ( double tol = 1e-9) const
inline

Tells whether every measured error is below a tolerance.

Parameters
tolRelative tolerance.
Returns
True when the gap, the marginal error and, if it was measured, the dual violation are at most tol.

Member Data Documentation

◆ dual_violation

double deblais::Certificate::dual_violation = 0

Largest \(f_i + g_j - |x_i - y_j|^p\) over all the pairs, relative to the largest cost.

Non positive up to rounding for an optimal plan. NaN when the check of all the pairs was skipped (all_pairs = false in certify()).