count_constant_components_2D#

cuqi.utilities.count_constant_components_2D(x, threshold=0.01, lower=-inf, upper=inf)#

Returns the number of piecewise constant components in a two-dimensional array

Parameters:
  • x (np.ndarray) – 2D Array to count components of.

  • threshold (float) – Strict theshold on when the difference of neighbouring values is considered zero.

  • lower (float) – Piecewise constant components below this value are not counted.

  • upper (float) – Piecewise constant components above this value are not counted.