added a generalized lp inference interface