optgrad function

Optimal gradient directions