Matrix-Geometric Solutions in Stochastic Models: An Algorithmic Approach