MCPcopy Create free account
hub / github.com/PythonOT/POT / laplacian

Function laplacian

ot/utils.py:52–56  ·  view source on GitHub ↗

r"""Compute Laplacian matrix

(x)

Source from the content-addressed store, hash-verified

50
51
52def laplacian(x):
53 r"""Compute Laplacian matrix"""
54 nx = get_backend(x)
55 L = nx.diag(nx.sum(x, axis=0)) - x
56 return L
57
58
59def list_to_array(*lst, nx=None):

Callers 1

emd_laplaceFunction · 0.85

Calls 3

get_backendFunction · 0.85
diagMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected