cr.sparse.lop.heaviside

cr.sparse.lop.heaviside(n, axis=0, normalized=True)[source]

Returns a linear operator implements the Heaviside step function

Parameters
  • n (int) – Dimension of the model space

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

  • normalized – If False, then simple cumsum, otherwise, apply on weighted x

Returns

A Heaviside linear operator

Return type

Operator

Heaviside function is also known as the step function. In discrete domain, it is implemented as a cumulative sum operation.

An n x n Heaviside matrix has ones below and on the diagonal and zeros elsewhere.