@@ -115,8 +115,9 @@ function emd2(μ, ν, C, optimizer; map=nothing)
115115 # check dimensions
116116 size (C) == (length (μ), length (ν)) ||
117117 error (" cost matrix `C` must be of size `(length(μ), length(ν))`" )
118- size (map) == size (C) ||
119- error (" optimal transport map `map` and cost matrix `C` must be of the same size" )
118+ size (map) == size (C) || error (
119+ " optimal transport map `map` and cost matrix `C` must be of the same size" ,
120+ )
120121 map
121122 end
122123 return dot (γ, C)
@@ -225,8 +226,9 @@ function sinkhorn2(μ, ν, C, ε; map=nothing, kwargs...)
225226 # check dimensions
226227 size (C) == (length (μ), length (ν)) ||
227228 error (" cost matrix `C` must be of size `(length(μ), length(ν))`" )
228- size (map) == size (C) ||
229- error (" optimal transport map `map` and cost matrix `C` must be of the same size" )
229+ size (map) == size (C) || error (
230+ " optimal transport map `map` and cost matrix `C` must be of the same size" ,
231+ )
230232 map
231233 end
232234 return dot (γ, C)
@@ -328,8 +330,9 @@ function sinkhorn_unbalanced2(μ, ν, C, λ1, λ2, ε; map=nothing, kwargs...)
328330 # check dimensions
329331 size (C) == (length (μ), length (ν)) ||
330332 error (" cost matrix `C` must be of size `(length(μ), length(ν))`" )
331- size (map) == size (C) ||
332- error (" optimal transport map `map` and cost matrix `C` must be of the same size" )
333+ size (map) == size (C) || error (
334+ " optimal transport map `map` and cost matrix `C` must be of the same size" ,
335+ )
333336 map
334337 end
335338 return dot (γ, C)
0 commit comments