Actual() public method

public Actual ( Specification problem ) : Accord.Math.Optimization.OptimizationProgressEventArgs[]
problem Specification
return Accord.Math.Optimization.OptimizationProgressEventArgs[]
Ejemplo n.º 1
0
        public void DefaultBatchTest()
        {
            foreach (var problem in problems)
            {
                LbfgsbComparer cmp = new LbfgsbComparer();

                var expected = cmp.Expected(problem);
                var actual   = cmp.Actual(problem);

                check(actual, expected);
            }
        }
        public void DefaultBatchTest()
        {
            foreach (var problem in problems)
            {
                LbfgsbComparer cmp = new LbfgsbComparer();

                Info[] expected = cmp.Expected(problem);
                OptimizationProgressEventArgs[] actual = cmp.Actual(problem);

                check(actual, expected);
            }
        }
Ejemplo n.º 3
0
        private static void compute(List <Specification> problems, LbfgsbComparer cmp)
        {
            foreach (var problem in problems)
            {
                string actualStr   = String.Empty;
                string expectedStr = String.Empty;

                cmp.l = null;
                cmp.u = null;

                OptimizationProgressEventArgs[] actual = null;

                try { actual = cmp.Actual(problem); }
                catch (Exception ex)
                {
                    actualStr = ex.Data["Code"] as string;
                    if (actualStr == null)
                    {
                        throw;
                    }
                }

                var expected = cmp.Expected(problem);
                expectedStr = cmp.NativeCode;

                if (actualStr == String.Empty)
                {
                    actualStr = cmp.ActualMessage;
                }

                Assert.AreEqual(expectedStr, actualStr);


                check(actual, expected);
            }
        }
Ejemplo n.º 4
0
        public void DefaultBatchTest()
        {
            foreach (var problem in problems)
            {
                LbfgsbComparer cmp = new LbfgsbComparer();

                var expected = cmp.Expected(problem);
                var actual = cmp.Actual(problem);

                check(actual, expected);
            }
        }
Ejemplo n.º 5
0
        private static void compute(List<Specification> problems, LbfgsbComparer cmp)
        {
            foreach (var problem in problems)
            {
                string actualStr = String.Empty;
                string expectedStr = String.Empty;

                cmp.l = null;
                cmp.u = null;

                OptimizationProgressEventArgs[] actual = null;

                try { actual = cmp.Actual(problem); }
                catch (Exception ex)
                {
                    actualStr = ex.Data["Code"] as string;
                    if (actualStr == null)
                        throw;
                }

                var expected = cmp.Expected(problem);
                expectedStr = cmp.NativeCode;

                if (actualStr == String.Empty)
                    actualStr = cmp.ActualMessage;

                Assert.AreEqual(expectedStr, actualStr);


                check(actual, expected);
            }
        }