Ejemplo n.º 1
0
 def test_cen_diff4_zero_slope(self):
     np.testing.assert_array_equal(
         FiniteDiff.cen_diff4(self.ones, self.arange), self.zeros_trunc4)
     np.testing.assert_array_equal(
         FiniteDiff.cen_diff4(self.zeros, self.arange), self.zeros_trunc4)
     np.testing.assert_array_equal(FiniteDiff.cen_diff4(self.zeros, 1.),
                                   self.zeros_trunc4)
Ejemplo n.º 2
0
 def test_fwd_diff2_zero_slope(self):
     np.testing.assert_array_equal(
         FiniteDiff.fwd_diff2(self.ones, self.arange), self.zeros_trunc2)
     np.testing.assert_array_equal(
         FiniteDiff.fwd_diff2(self.zeros, self.arange), self.zeros_trunc2)
     np.testing.assert_array_equal(FiniteDiff.fwd_diff2(self.zeros, 1.),
                                   self.zeros_trunc2)
Ejemplo n.º 3
0
 def test_cen_diff4_zero_slope(self):
     np.testing.assert_array_equal(FiniteDiff.cen_diff4(self.ones,
                                                        self.arange),
                                   self.zeros_trunc4)
     np.testing.assert_array_equal(FiniteDiff.cen_diff4(self.zeros,
                                                        self.arange),
                                   self.zeros_trunc4)
     np.testing.assert_array_equal(FiniteDiff.cen_diff4(self.zeros, 1.),
                                   self.zeros_trunc4)
Ejemplo n.º 4
0
 def test_fwd_diff2_zero_slope(self):
     np.testing.assert_array_equal(FiniteDiff.fwd_diff2(self.ones,
                                                        self.arange),
                                   self.zeros_trunc2)
     np.testing.assert_array_equal(FiniteDiff.fwd_diff2(self.zeros,
                                                        self.arange),
                                   self.zeros_trunc2)
     np.testing.assert_array_equal(FiniteDiff.fwd_diff2(self.zeros, 1.),
                                   self.zeros_trunc2)
Ejemplo n.º 5
0
 def test_cen_diff4_constant_slope(self):
     np.testing.assert_array_equal(FiniteDiff.cen_diff4(self.arange, 1.),
                                   self.ones_trunc4)
     np.testing.assert_array_equal(FiniteDiff.cen_diff4(self.arange*-2.5,
                                                        1.),
                                   self.ones_trunc4*-2.5)
Ejemplo n.º 6
0
 def test_fwd_diff2_constant_slope(self):
     np.testing.assert_array_equal(FiniteDiff.fwd_diff2(self.arange, 1.),
                                   self.ones_trunc2)
     np.testing.assert_array_equal(FiniteDiff.fwd_diff2(self.arange*-2.5, 1.),
                                   self.ones_trunc2*-2.5)
Ejemplo n.º 7
0
 def test_cen_diff4_constant_slope(self):
     np.testing.assert_array_equal(FiniteDiff.cen_diff4(self.arange, 1.),
                                   self.ones_trunc4)
     np.testing.assert_array_equal(
         FiniteDiff.cen_diff4(self.arange * -2.5, 1.),
         self.ones_trunc4 * -2.5)
Ejemplo n.º 8
0
 def test_fwd_diff2_constant_slope(self):
     np.testing.assert_array_equal(FiniteDiff.fwd_diff2(self.arange, 1.),
                                   self.ones_trunc2)
     np.testing.assert_array_equal(
         FiniteDiff.fwd_diff2(self.arange * -2.5, 1.),
         self.ones_trunc2 * -2.5)