def DotProduct_DML(feat, M, query=None, is_sparse=False, is_trans=False):
    """ DotProduct distance with DML.
    """
    if query is None:
        query = feat
    return -query.dot(M).dot(feat.T)
