示例#1
0
        public void IsMetThrowsForMissingCovarianceMatrix()
        {
            var terminationCriterion = new ConditionCov();
            var data = ConditionCovTest.CreateCmaEsData(covariances: null);

            Assert.Throws <ArgumentOutOfRangeException>(() => terminationCriterion.IsMet(data));
        }
示例#2
0
        public void IsMetReturnsFalseForMatrixWithMaxCondition()
        {
            var terminationCriterion   = new ConditionCov();
            var matrixWithMaxCondition = Matrix <double> .Build.DenseOfDiagonalArray(
                new[] { ConditionCov.MaxCondition * 10, 10 });

            Assert.False(
                terminationCriterion.IsMet(ConditionCovTest.CreateCmaEsData(matrixWithMaxCondition)),
                "Termination criterion should not have been met.");
        }