degree_matrix

compas.numerical.degree_matrix(adjacency, rtype='array')[source]

Creates a matrix representing vertex degrees.

Parameters
  • adjacency (list) – List of lists, vertex adjacency data.

  • rtype ({‘array’, ‘csc’, ‘csr’, ‘coo’, ‘list’}) – Format of the result.

Returns

array-like – Constructed degree matrix.