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

            Assert.Throws <ArgumentOutOfRangeException>(() => terminationCriterion.IsMet(data));
        }
Example #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.");
        }
Example #3
0
        public void IsMetThrowsForMissingCmaEsData()
        {
            var terminationCriterion = new ConditionCov();

            Assert.Throws <ArgumentNullException>(() => terminationCriterion.IsMet(data: null));
        }