bandhic.band_hic_matrix.set_diag#

band_hic_matrix.set_diag(k, values)[source]#

Set values in the k-th diagonal of the matrix.

Parameters:
  • k (int) – The diagonal index to set.

  • values (array-like) – The values to set in the diagonal.

Raises:

ValueError – If k is out of range or values length mismatch.

Return type:

None

Examples

>>> import bandhic as bh
>>> mat = bh.zeros((4,4), diag_num=3)
>>> mat.set_diag(1, [9,9,9])
>>> mat.diag(1)
array([9., 9., 9.])