cr.sparse.lop.diagonal

cr.sparse.lop.diagonal(d, axis=0)[source]

Returns a linear operator which mimics multiplication by a diagonal matrix

Parameters
  • d (jax.numpy.ndarray) – A vector (1D array) of diagonal entries

  • axis (int) – For multi-dimensional array input, the axis along which the linear operator will be applied

Returns

A linear operator wrapping the diagonal matrix multiplication

Return type

Operator