c++ implementation of the LBFGS optimization algorithm