using System; namespace Science.Mathematics.LinearAlgebra { public class MarkovMatrix : Matrix { public MarkovMatrix(double[,] x) : base(x) { Check(); } public MarkovMatrix(Vector[] columnVector) : base(columnVector) { Check(); } private void Check() { for (int j = 0; j < sc; j++) { double sum = 0.0; for (int i = 0; i < sr; i++) sum += el[i, j]; if (sum != 1.0) try { throw new Science.Error(); } catch (Science.Error e) { e.Write("It is not Markov matrix."); } } } } }