예제 #1
0
        def test_case(size=10, shift=1, complex=False, useApache=False):
            v = Vec(10, complex)
            if (useApache):
                v.makeApache()

            v.ones()
            v.rand()

            temp = v.getList()

            shift = 3
            op = Shift(shift)
            op.eval(v)

            for index, val in enumerate(v.getList()):
                if index < shift:
                    self.assertEqual(val.real, 0)
                    if complex:
                        self.assertEqual(val.imag, 0)
                else:
                    self.assertEqual(val.real, temp[index - shift].real)
                    if complex:
                        self.assertEqual(val.imag, temp[index - shift].imag)
예제 #2
0
 def testDx(self):
     v = Vec(1000, False)
     v = v.rand()