Sparse Levenberg-Marquardt based non-linear least squares optimizer and bundle adjustment implementation