def getCovMatrix(self,x=None,z=None,mode=None):
        self.checkInputGetCovMatrix(x,z,mode)
        if not x is None:
            n, D = x.shape
        if not z is None:
            nn, D = z.shape
        ell = np.exp(self.hyp[0])            # characteristic length scale
        sf2 = np.exp(2.*self.hyp[1])         # signal variance
        v   = self.para[0]                   # degree (v = 0,1,2 or 3 only)
        if np.abs(np.round(v)-v) < 1e-8:     # remove numerical error from format of parameter
            v = int(round(v))
        assert(int(v) in range(4))           # Only allowed degrees: 0,1,2 or 3
        v = int(v)
        j = np.floor(0.5*D) + v + 1
        if mode == 'self_test':              # self covariances for the test cases
            nn,D = z.shape
            A = np.zeros((nn,1))
        elif mode == 'train':                # compute covariance matix for dataset x
            A = np.sqrt( spdist.cdist(old_div(x,ell), old_div(x,ell), 'sqeuclidean') )
        elif mode == 'cross':                # compute covariance between data sets x and z
            A = np.sqrt( spdist.cdist(old_div(x,ell), old_div(z,ell), 'sqeuclidean') )
        A = sf2 * self.pp(A,j,v,self.func)
        return A
dataset/ETHPy150Open marionmari/pyGPs/pyGPs/Core/cov.py/PiecePoly.getCovMatrix/swapped operands of `-`