MixedSVAR._fixed_cells#

static MixedSVAR._fixed_cells(pattern, size, label)[source]#

The declared restrictions of one pattern, as (row, column, value).

Parameters:
  • pattern (ArrayLike | None) – The (size, size) pattern, or None for no restrictions.

  • size (int) – System dimension.

  • label (str) – Which pattern this is, for error messages.

Return type:

tuple[tuple[int, int, float], ...]

Returns:

The fixed cells in row-major order.

Raises:

SpecificationError – If the pattern has the wrong shape or contains an infinity.

Example

>>> import numpy as np
>>> MixedSVAR._fixed_cells(None, 2, "impact")
()
>>> MixedSVAR._fixed_cells([[np.nan, 0.0], [1.5, np.nan]], 2, "impact")
((0, 1, 0.0), (1, 0, 1.5))