4

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?

Charles
  • 50,943
  • 13
  • 104
  • 142
olamundo
  • 23,991
  • 34
  • 108
  • 149

1 Answers1

3

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.

Chris Taylor
  • 46,912
  • 15
  • 110
  • 154