public ContinuousDistributionN(double[] mean, double[,] covariance) { Dimension = mean.Length; Mean = mean; Covariance = covariance; Inverse = MatrixMxN.Inverse(covariance); Determinant = MatrixMxN.Determinant(covariance); }
public void Determinant3x3() { double[,] matrix = new double[, ] { { 0, 1, 3 }, { 1, 2, 0 }, { 0, 3, 4 } }; Assert.AreEqual(5.0, MatrixMxN.Determinant(matrix)); }
public void Determinant4x4() { double[,] matrix = new double[, ] { { 2, 3, 3, 1 }, { 0, 4, 3, -3 }, { 2, -1, -1, -3 }, { 0, -4, -3, 2 } }; Assert.AreEqual(8.0, MatrixMxN.Determinant(matrix)); }