Added gradient calculation to LMMVector1 type.  Much faster optimization.