Expected() public method

public Expected ( Specification problem ) : Info[]
problem Specification
return Info[]
コード例 #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);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #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);
            }
        }
コード例 #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);
            }
        }
コード例 #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);
            }
        }