@staticmethod
def _min_norm_element_from2(v1v1, v1v2, v2v2):
    '\n        Analytical solution for min_{c} |cx_1 + (1-c)x_2|_2^2\n        d is the distance (objective) optimzed\n        v1v1 = <x1,x1>\n        v1v2 = <x1,x2>\n        v2v2 = <x2,x2>\n        '
    if (v1v2 >= v1v1):
        gamma = 0.999
        cost = v1v1
        return (gamma, cost)
    if (v1v2 >= v2v2):
        gamma = 0.001
        cost = v2v2
        return (gamma, cost)
    gamma = ((- 1.0) * ((v1v2 - v2v2) / ((v1v1 + v2v2) - (2 * v1v2))))
    cost = (v2v2 + (gamma * (v1v2 - v2v2)))
    return (gamma, cost)
Analytical solution for min_{c} |cx_1 + (1-c)x_2|_2^2
d is the distance (objective) optimzed
v1v1 = <x1,x1>
v1v2 = <x1,x2>
v2v2 = <x2,x2>
@staticmethod
def _min_norm_element_from2(v1v1, v1v2, v2v2):
    '\n        Analytical solution for min_{c} |cx_1 + (1-c)x_2|_2^2\n        d is the distance (objective) optimzed\n        v1v1 = <x1,x1>\n        v1v2 = <x1,x2>\n        v2v2 = <x2,x2>\n        '
    if (v1v2 >= v1v1):
        gamma = 0.999
        cost = v1v1
        return (gamma, cost)
    if (v1v2 >= v2v2):
        gamma = 0.001
        cost = v2v2
        return (gamma, cost)
    gamma = ((- 1.0) * ((v1v2 - v2v2) / ((v1v1 + v2v2) - (2 * v1v2))))
    cost = (v2v2 + (gamma * (v1v2 - v2v2)))
    return (gamma, cost)