public void GoldfarbIdnaniParseGlobalizationTest2()
{
String strObjective = 0.5.ToString(CultureInfo.InvariantCulture)
+ "x² +" + 0.2.ToString(CultureInfo.InvariantCulture) + "y² +"
+ 0.3.ToString(CultureInfo.InvariantCulture) + "xy";
String[] strConstraints =
{
0.01.ToString(CultureInfo.InvariantCulture) + "x" + " + " +
0.02.ToString(CultureInfo.InvariantCulture) + "y - " +
0.03.ToString(CultureInfo.InvariantCulture) + " = 0",
"x + y = 100"
};
QuadraticObjectiveFunction function = new QuadraticObjectiveFunction(strObjective);
LinearConstraintCollection cst = new LinearConstraintCollection();
foreach (var tmpCst in strConstraints)
cst.Add(new LinearConstraint(function, tmpCst));
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);
}