ash_model.utils.matrices.incidence_matrix¶
- ash_model.utils.matrices.incidence_matrix(h, start=None, end=None, return_mapping=False)[source]¶
Returns the incidence matrix of the ASH object. The incidence matrix is a sparse matrix where rows represent nodes and columns represent hyperedges. The value is 1 if the node belongs to the hyperedge, 0 otherwise.
- Parameters:
- Returns:
A sparse matrix representing the binary incidence matrix of the ASH.
- Return type:
scipy.sparse.csr_matrix | Tuple[scipy.sparse.csr_matrix, Dict[int, int], Dict[str, int]]