ash_model.utils.matrices.adjacency_matrix_by_time

ash_model.utils.matrices.adjacency_matrix_by_time(h, return_mapping=False)[source]

Returns a dictionary of adjacency matrices for each time step in the ASH object. The keys are the time steps and the values are the corresponding adjacency matrices.

Parameters:
  • h (ASH) – The ASH object to be converted.

  • return_mapping (bool) –

Returns:

A dictionary where keys are time steps and values are sparse matrices representing the adjacency matrix.

Return type:

Dict[int, scipy.sparse.csr_matrix] | Tuple[Dict[int, scipy.sparse.csr_matrix], Dict[int, int]]