Regularized Distance Metric Learning:Theory and Algorithm