projected gradient descent algorithm