def compute_functional_and_gradients(self):
    if self.skip_flag:
        return (0, flex.double(self.n))
    a = self.x
    residual = (((self.datay - ((a[0] * self.datax) * self.datax)) - (a[1] * self.datax)) - a[2])
    f = ((0.5 * residual) * residual)
    g = flex.double(self.n)
    dR_da = ((- self.datax) * self.datax)
    dR_db = (- self.datax)
    dR_dc = (- 1.0)
    g[0] = (residual * dR_da)
    g[1] = (residual * dR_db)
    g[2] = (residual * dR_dc)
    return (f, g)
def compute_functional_and_gradients(self):
    if self.skip_flag:
        return (0, flex.double(self.n))
    a = self.x
    residual = (((self.datay - ((a[0] * self.datax) * self.datax)) - (a[1] * self.datax)) - a[2])
    f = ((0.5 * residual) * residual)
    g = flex.double(self.n)
    dR_da = ((- self.datax) * self.datax)
    dR_db = (- self.datax)
    dR_dc = (- 1.0)
    g[0] = (residual * dR_da)
    g[1] = (residual * dR_db)
    g[2] = (residual * dR_dc)
    return (f, g)