Function : diff_yy - To compute second order differentiation along y axis.
505919
public double[][] diff_yy(double matyy[][]) {
        mat3 = new double[width][height];
        double mat1, mat2;
        for (int i = 0; i < width; i++) {
            for (int j = 0; j < height; j++) {
                if (i == 0) {
                    mat1 = matyy[i][j];
                    mat2 = matyy[i + 1][j];
                } else if (i == width - 1) {
                    mat1 = matyy[i - 1][j];
                    mat2 = matyy[i][j];
                } else {
                    mat1 = matyy[i - 1][j];
                    mat2 = matyy[i + 1][j];
                }
                mat3[i][j] = (mat1 + mat2 - 2 * matyy[i][j]);
            }
        }
        return mat3;

    }
1350247
def ystep(self):
        """

        AXU = self.AX + self.U
        self.block_sep0(self.Y)[:] = sp.prox_l1(
            self.block_sep0(AXU), (self.lmbda/self.rho) * self.Wl1)
        self.block_sep1(self.Y)[:] = sp.prox_l2(
            self.block_sep1(AXU), self.mu/self.rho, axis=(self.cri.axisC, -1))
557007
def diff2(self, i, j):
        

        old_val = copy(self[j])

        if not self.stochastic_indices[i][
                0] in self.stochastic_indices[j][0].moral_neighbors:
            return 0.

        def diff_for_diff(val):
            self[j] = val
            return self.diff(i)

        d = derivative(
            func=diff_for_diff,
            x0=old_val,
            dx=self.eps[j],
            n=1,
            order=self.diff_order)

        self[j] = old_val
        return d
70118
def diffpow(self, x, rot=0):
        """"""
        N = len(x)
        if rot:
            x = rotate(x)
        return sum(np.abs(x)**(2. + 4.*np.arange(N) / (N - 1.)))**0.5
317955
def ystep(self):
        """

        self.Y = np.asarray(sp.prox_l1(self.AX + self.U,
                                       (self.lmbda / self.rho) * self.wl1),
                            dtype=self.dtype)
        super(BPDN, self).ystep()
128380
def gradient(self, P, Q, Y, i):
        """"""

        return 4 * sum([
            (P[i, j] - Q[i, j]) * (Y[i] - Y[j]) * (1 + np.linalg.norm(Y[i] - Y[j]) ** 2) ** -1 \
            for j in range(Y.shape[0])
        ])
348209
function diff( x, y, scale ) {
	var f;
	var s;
	if ( x !== x || y !== y ) {
		return NaN;
	}
	if (
		x === PINF ||
		x === NINF ||
		y === PINF ||
		y === NINF
	) {
		if ( x === y ) {
			return NaN;
		}
		return PINF;
	}
	// If the absolute difference is `0`, then so is the relative difference:
	if ( x === y ) {
		return 0.0;
	}
	if ( isFunction( scale ) ) {
		f = scale;
	} else {
		if ( scale === void 0 ) {
			scale = 'max-abs';
		}
		f = SCALE[ scale ];
		if ( f === void 0 ) {
			throw new Error( 'invalid input argument. Unrecognized/unsupported scale function. Value: `' + scale + '`.' );
		}
	}
	s = f( x, y );
	if ( s === 0 ) {
		// Bail. No possible return value which works for all possible scale functions...
		return NaN;
	}
	return abs( (x - y) / s );
}
1239929
def sumdiffsquared(x, y):
    
    sds = 0
    for i in range(len(x)):
        sds = sds + (x[i] - y[i]) ** 2
    return sds
523696
def ystep(self):
        
        """

        AXU = self.AX + self.U
        Y0 = (self.rho*(self.block_sep0(AXU) - self.S)) / (self.W**2 +
                                                           self.rho)
        Y1 = self.Pcn(self.block_sep1(AXU))
        self.Y = self.block_cat(Y0, Y1)
426514
def yn(n, x, context=None):
    
    return _apply_function_in_current_context(
        BigFloat,
        mpfr.mpfr_yn,
        (n, BigFloat._implicit_convert(x)),
        context,
    )
747232
def _deriv_hypot(x, y):
    """"""
    r = np.hypot(x, y)
    df_dx = x / r
    df_dy = y / r
    return np.hstack([df_dx, df_dy])
275877
def first_order_gradient(arr, axis=0):
  '''
  
  '''
  grad_arr = difference(arr, n=1, axis=axis)
  return np.insert(grad_arr, grad_arr.shape[axis], 0, axis=axis)
477679
def ystep(self):
        
        """

        self.Y = sp.proj_l1(self.AX + self.U, self.gamma,
                            axis=self.cri.axisN + (self.cri.axisC,
                                                   self.cri.axisM))
        super(ConvBPDNProjL1, self).ystep()
79907
def _diff(d1,d2):
    '''
        
    '''
    d = {}
    ds = _diff_internal(d1,d2)
    for key in ds['vdiff']:
        d[key] = d1[key]
    for key in ds['kdiff']:
        d[key] = d1[key]
    return(d)
1330578
def pairwise_diff(values):
    ""
    return numpy.array([x - y for x, y in pairwise(values)])
238305
def derivative(self, z, x, y, fase):
        """"""
        return deriv_G(self, z, x, y, fase)
1321869
def diff(self, i, order=1):
        

        old_val = copy(self[i])
        d = derivative(
            func=self.func_for_diff,
            x0=old_val,
            dx=self.eps[i],
            n=order,
            args=[i],
            order=self.diff_order)
        self[i] = old_val
        return d