def test_deffmat_first2(self): D = util.sparse_diffmat(4, 1, 0.5, order=2) self.assertTrue( np.all(D.todense() == np.array( [[-3, 4, -1, 0], [-1, 0, 1, 0], [0, -1, 0, 1], [0, -1, 4, -3]], dtype=np.float64))) return
def test_deffmat_first2(self): D = util.sparse_diffmat(4, 1, 0.5, order=2) self.assertTrue(np.all(D.todense() == np.array([[-3, 4, -1, 0], [-1, 0, 1, 0], [0, -1, 0, 1], [0, -1, 4, -3]], dtype=np.float64))) return
def test_diffmat_first(self): D = util.sparse_diffmat(4, 1, 1, order=2) self.assertTrue( np.all(D.todense() == np.array( [[-1.5, 2, -0.5, 0], [-0.5, 0, 0.5, 0], [0, -0.5, 0, 0.5], [0, -0.5, 2, -1.5]]))) return
def test_diffmat_first(self): D = util.sparse_diffmat(4, 1, 1, order=2) self.assertTrue(np.all(D.todense() == np.array([[-1.5, 2, -0.5, 0], [-0.5, 0, 0.5, 0], [0, -0.5, 0, 0.5], [0, -0.5, 2, -1.5]]))) return