graphicle.matrix.cut_adj(matrix: ndarray[Any, dtype[float64]], cut: float, mode: 'max' | 'min' = 'max', self_loop: bool = False, weighted: bool = False) ndarray[Any, dtype[float64]][source]

Produce a directed adjacency matrix with outward edges towards the neighbours within a cut range, determined from the input affinity matrix.

The cut represents the limiting value of the affinity matrix for elements to form edges in the adjacency matrix.

New in version 0.1.0.

Parameters:
matrix : ndarray[float64]

Particle affinities.

cut : float

Value beyond which affinities are not sufficient to form edges.

mode : {'max', 'min'}

Sets whether affinities should be above or below cut. ‘max’ implies matrix < cut, ‘min’ implies matrix > cut. Default is ‘max’.

self_loop : bool

If False will remove self-edges. Default is False.

weighted : bool

If True edges weighted by affinity, if False edge is binary. Default is False.

Returns:

adj – Adjacency matrix representing particle connectivity.

Return type:

ndarray[bool_] or ndarray[float64]

Notes

If weighted is False, the returned adjacency matrix will be boolean.


Last update: Jun 27, 2025