count_constant_components_1D#
- cuqi.utilities.count_constant_components_1D(x, threshold=0.01, lower=-inf, upper=inf)#
Returns the number of piecewise constant components in a one-dimensional array
- Parameters:
x (np.ndarray) – 1D 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.