cr.nimble.add_to_diagonal

cr.nimble.add_to_diagonal(A, value)[source]

Add a specific value to the diagonal elements

Parameters
  • A (jax.numpy.ndarray) – A 2D matrix

  • value (float) – A value to be added to the diagonal elements

Returns

Matrix with updated diagonal

Return type

(jax.numpy.ndarray)