summaryrefslogtreecommitdiff
path: root/geom_matching/wasserstein/include/wasserstein_pure_geom.hpp
diff options
context:
space:
mode:
authorArnur Nigmetov <a.nigmetov@gmail.com>2018-05-19 20:33:33 +0200
committerArnur Nigmetov <a.nigmetov@gmail.com>2018-05-19 20:33:33 +0200
commit9693f140d91e751aabe46b76b89c332c7f307e17 (patch)
tree0fc707a72eabe7496e79de4ddd46e9c945e16bf3 /geom_matching/wasserstein/include/wasserstein_pure_geom.hpp
parent75cf0745e95a37c8d65e7a283a11cd500ab6edc2 (diff)
Add inline qualifier to Wasserstein code.
To avoid linking problems.
Diffstat (limited to 'geom_matching/wasserstein/include/wasserstein_pure_geom.hpp')
-rw-r--r--geom_matching/wasserstein/include/wasserstein_pure_geom.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/geom_matching/wasserstein/include/wasserstein_pure_geom.hpp b/geom_matching/wasserstein/include/wasserstein_pure_geom.hpp
index 2a57599..13a94d5 100644
--- a/geom_matching/wasserstein/include/wasserstein_pure_geom.hpp
+++ b/geom_matching/wasserstein/include/wasserstein_pure_geom.hpp
@@ -30,7 +30,7 @@ namespace ws
using AuctionRunnerJacR = typename hera::ws::AuctionRunnerJac<Real, hera::ws::AuctionOracleKDTreePureGeom<Real>, hera::ws::dnn::DynamicPointVector<Real>>;
-double wasserstein_cost(const DynamicPointVector<double>& set_A, const DynamicPointVector<double>& set_B, const AuctionParams<double>& params)
+inline double wasserstein_cost(const DynamicPointVector<double>& set_A, const DynamicPointVector<double>& set_B, const AuctionParams<double>& params)
{
if (params.wasserstein_power < 1.0) {
throw std::runtime_error("Bad q in Wasserstein " + std::to_string(params.wasserstein_power));
@@ -75,7 +75,7 @@ double wasserstein_cost(const DynamicPointVector<double>& set_A, const DynamicPo
}
-double wasserstein_dist(const DynamicPointVector<double>& set_A, const DynamicPointVector<double>& set_B, const AuctionParams<double>& params)
+inline double wasserstein_dist(const DynamicPointVector<double>& set_A, const DynamicPointVector<double>& set_B, const AuctionParams<double>& params)
{
return std::pow(wasserstein_cost(set_A, set_B, params), 1.0 / params.wasserstein_power);
}