This code implemented the learning algorithm from the paper "Distance metric learning, with application to clustering with side-information [Eric P. Xing]". Except from the original materials, there are some construction details inclueding more info to clarify the derivertion of formula in the paper and more experiment result from the metric.
The pic above is the objective funcion using artifical data for the case when A is diagonal. We can see the function is convex.