update the lbfgs optimizer

@karlnapf 
Please merge this first.
I will send additional two PRs for dual likelihoods and dual KL method respectively once this is merged.

just seeing this, could you update the error message to print the given number? Good for users