matlab: quadprog complaining functional is not symmetrical when it is

3.2k views Asked by At

When I am running quadprog with a given functional F matlab outputs:

Warning: Your Hessian is not symmetric.
Resetting H=(H+H')/2. 

However, checking the difference between the functional and it's transpose:

>> max(max(abs(F-F')))

ans =

   (1,1)     7.1054e-015

Shows that they are in fact the same. Does quadprog output this warning even if the functional is close to being symmetrical by a machine error?

1

There are 1 answers

0
Chris Taylor On BEST ANSWER

The test used for presence of antisymmetry in the quadprog source is

norm(H-H',inf) > eps

i.e. it checks if the infinity norm is greater than machine epsilon. Since

7.1054e-15 > eps = 2.22e-16

your Hessian shows up as non-symmetric.