Currently, I try to solve the following linear system with the QP-BLEIC solver

AtA * x = AtB, subject to:

0<= x_i <= 1.0 and

sum(x_i) = 1.0;

In order to prove my implementation, I have a test case, that creates 100s of equations systems with AtA of size 2x2 to 4x4. In the final case AtA will never be bigger than 8x8. My initialization values are close to the final solution. To validate the result I compute x = AtA^(-1) AtB with Eigen. However, the results returned by Alglib are far from the initial and unconstrained solution. Following the examples provided with Alglib I set:

all n entries in bndl to 0.0

all n entries in bndu to 1.0

all n entries in scaling to 1.0

all n+1 entries in linear constraint (c) to 1.0

type of linear constraint is ct ="[0]"

with n being the size of vector x

I have tried default termination values as well as low error bounds (1e-10) and high maximum iterations (1000). In most cases, the rep variable return: inner/outeriterations=1 or 2; terminationtype=4 (success). Have I missed something?

Below one example:

Matrix AtA:

0.422638 0.430536 0.441594

0.430536 0.470939 0.437771

0.441594 0.437771 0.545798

Vector AtB:

0.460166 0.485326 0.499367

Starting Values:

0.782251 0.213387 0.00436184

AtA*x_(start):

0.424406 0.439189 0.441233

Solution AlgLib:

1 0 -6.27744e+66

Solution Eigen (unconstrained):

0.126134 0.627357 0.30969