Added gradient function and tests
Merge branch 'master' of https://github.com/dplucenio/optimization-teapm