egttools.numerical.linear_operator.make_residual_operator

make_residual_operator(operator)[source]

Wrap a PairwiseComparisonTransitionOperator as a scipy LinearOperator for (I - P^T).

The returned LinearOperator A satisfies: - A @ x computes y = (I - P^T) x (matvec)

Useful for iterative linear solvers (GMRES, LGMRES) that seek π with (I - P^T) π = 0. Because the system is singular, a normalization constraint must be added externally (e.g. replace one equation with Σ π_i = 1).

Parameters:

operator (PairwiseComparisonTransitionOperator) – Fully constructed C++ transition operator.

Returns:

Shape (n, n) operator where n = operator.size.

Return type:

scipy.sparse.linalg.LinearOperator