Change approach to Hessian computation: rather than telling Ipopt to use a dense Hessian, tell Ipopt to use lower triangular Hessian and then at each time copy the Hessian computed by the user in a dense Eigen matrix. Don't know why, but this reduces the number of iterations of the test problem from 22 to 8. Though, it is not clear to me why.