Accord.Tests.Interop.Math.LbfgsbComparisonTest.compute C# (CSharp) Method

compute() private static method

private static compute ( List problems, LbfgsbComparer cmp ) : void
problems List
cmp LbfgsbComparer
return void
        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);
            }
        }