ash_model.utils.matrices.incidence_matrix_by_time

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

Returns a dictionary of incidence matrices for each time step in the ASH object. The keys are the time steps and the values are the corresponding incidence 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 incidence matrix.

Return type:

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