Changed the sign of the cost function for clarity.

We need the opposite sign to *minimize* the cost, but we can add that in
later.
Merge branch 'pos-def-constraint' of github.com:medthehatta/thesis-code into pos-def-constraint