Throw error in PolynomialProgram when the user wants to call methods like 'addCost', 'addNonlinearConstraint'