CMP++: Uncertainty Quantification & Bayesian Calibration
Loading...
Searching...
No Matches
wasserstein.h
Go to the documentation of this file.
1#ifndef WASSERSTEIN_H
2#define WASSERSTEIN_H
3
4#include <cmp_defines.h>
5
6#pragma once
7
8#include <vector>
9#include <random>
10#include <Eigen/Dense>
11
16namespace cmp {
17
42double wasserstein1D(Eigen::VectorXd &s1, Eigen::VectorXd &s2, double p);
43
66double slicedWassersteinDistance(const Eigen::MatrixXd &samples_1, const Eigen::MatrixXd &samples_2, double p, int slices, size_t seed = 42);
67
68} // namespace cmp
69
72#endif
Definition classifier.h:17
double slicedWassersteinDistance(const Eigen::MatrixXd &samples_1, const Eigen::MatrixXd &samples_2, double p, int slices, size_t seed=42)
Computes the sliced-Wasserstein distance of order p between two n-dimensional datasets.
Definition wasserstein.cpp:56
double wasserstein1D(Eigen::VectorXd &s1, Eigen::VectorXd &s2, double p)
Computes the 1D Wasserstein distance between two empirical distributions.
Definition wasserstein.cpp:9