$$C_{ij} = \|x_i - y_j\|^2$$ Peyre & Cuturi (2019), Sec. 2.4.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Otcostsq(V, V)
#> $estimate
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,] 0 1 4 9 16 25 36 49
#> [2,] 1 0 1 4 9 16 25 36
#> [3,] 4 1 0 1 4 9 16 25
#> [4,] 9 4 1 0 1 4 9 16
#> [5,] 16 9 4 1 0 1 4 9
#> [6,] 25 16 9 4 1 0 1 4
#> [7,] 36 25 16 9 4 1 0 1
#> [8,] 49 36 25 16 9 4 1 0
#>
#> $nrow
#> [1] 8
#>
#> $ncol
#> [1] 8
#>
#> $total
#> [1] 672
#>
#> $method
#> [1] "Squared-Euclidean ground cost -- Peyre & Cuturi (2019) Sec. 2.4"
#>
