public void GoldfarbIdnaniConstructorTest1()
{
double[,] D = Matrix.Identity(3);
double[] d = { 0, 5, 0 };
double[,] A =
{
{ -4, -3, 0 },
{ 2, 1, 0 },
{ 0, -2, 1 },
};
double[] b = { -8, 2, 0 };
List<LinearConstraint> constraints = new List<LinearConstraint>();
constraints.Add(new LinearConstraint(-4, -3, +0) { Value = -8 });
constraints.Add(new LinearConstraint(+2, +1, +0) { Value = +2 });
constraints.Add(new LinearConstraint(+0, -2, +1) { Value = +0 });
QuadraticObjectiveFunction f = new QuadraticObjectiveFunction("2x² + y - z + 2");
GoldfarbIdnani target = new GoldfarbIdnani(f, constraints);
Assert.IsTrue(A.IsEqual(target.ConstraintMatrix));
Assert.IsTrue(b.IsEqual(target.ConstraintValues));
}