Accord.Tests.Math.GoldfarbIdnaniTest.GoldfarbIdnaniParseGlobalizationTest C# (CSharp) Method

GoldfarbIdnaniParseGlobalizationTest() private method

private GoldfarbIdnaniParseGlobalizationTest ( ) : void
return void
        public void GoldfarbIdnaniParseGlobalizationTest()
        {
            var fr = CultureInfo.GetCultureInfo("fr-FR");

            Assert.AreEqual(",", fr.NumberFormat.NumberDecimalSeparator);

            String strObjective = 0.5.ToString(fr)
                + "x² +" + 0.2.ToString(fr) + "y² +"
                + 0.3.ToString(fr) + "xy";

            String[] strConstraints = 
            { 
                0.01.ToString(fr) + "x" + " + " + 
                0.02.ToString(fr) + "y - " + 
                0.03.ToString(fr) + " = 0", 
                "x + y = 100" 
            };

            QuadraticObjectiveFunction function = new QuadraticObjectiveFunction(strObjective, fr);
            LinearConstraintCollection cst = new LinearConstraintCollection();
            foreach (var tmpCst in strConstraints)
                cst.Add(new LinearConstraint(function, tmpCst, fr));

            var classSolver = new Accord.Math.Optimization.GoldfarbIdnani(function, cst);
            bool status = classSolver.Minimize();
            double result = classSolver.Value;

            Assert.IsTrue(status);
            Assert.AreEqual(15553.60, result, 1e-10);
        }