Skip to content

num::linear::laplacian

Defined in header <linear/graph/laplacian.hpp>

template <typename Weight = real, typename Index = idx>
spmat laplacian(const graph<Weight, Index> &g);  // (1)

template <std::size_t D, typename Weight, std::integral Index>
spmat laplacian(const structured_grid_graph<D, Weight, Index> &g);  // (2)

spmat laplacian(const structures::multigraph<real, idx> &g);  // (3)

(1) Undocumented.

(2) Construct the graph Laplacian of a grid without storing its edges: \(L = D - W\).

(3) Construct the Laplacian of a multigraph, summing parallel edges: \(L = D - W\).

Warning

Singular, since \(L \mathbf{1} = 0\): tag it assume_psd, not assume_spd.

Warning

Singular, since \(L \mathbf{1} = 0\): tag it assume_psd, not assume_spd.