Example #1
0
    def test_band_e_bm_common(self, its=50):
        for it in range(its):
            size = random.choice([0, 1, randint(0, 10), randint(0, 100)])
            num_bms = randint(5)
            mat_bms = [ gen_BandMat(size) for _ in range(num_bms) ]
            if num_bms > 0:
                l = max([ mat_bm.l for mat_bm in mat_bms ])
                u = max([ mat_bm.u for mat_bm in mat_bms ])

            mat_rects = bm.band_e_bm_common(*mat_bms)
            for mat_bm, mat_rect in zip(mat_bms, mat_rects):
                assert_allclose(mat_rect, bm.band_e_bm(l, u, mat_bm))
Example #2
0
    def test_band_e_bm_common(self, its=50):
        for it in range(its):
            size = random.choice([0, 1, randint(0, 10), randint(0, 100)])
            num_bms = randint(5)
            mat_bms = [gen_BandMat(size) for _ in range(num_bms)]
            if num_bms > 0:
                l = max([mat_bm.l for mat_bm in mat_bms])
                u = max([mat_bm.u for mat_bm in mat_bms])

            mat_rects = bm.band_e_bm_common(*mat_bms)
            for mat_bm, mat_rect in zip(mat_bms, mat_rects):
                assert_allclose(mat_rect, bm.band_e_bm(l, u, mat_bm))
Example #3
0
    def test_band_e_bm(self, its=50):
        for it in range(its):
            size = random.choice([0, 1, randint(0, 10), randint(0, 100)])
            mat_bm = gen_BandMat(size)
            l = random.choice([0, 1, randint(0, 10)])
            u = random.choice([0, 1, randint(0, 10)])

            mat_rect = bm.band_e_bm(l, u, mat_bm)

            mat_rect_good = fl.band_e(l, u, mat_bm.full())
            assert_allequal(mat_rect, mat_rect_good)
            assert not np.may_share_memory(mat_rect, mat_bm.data)
Example #4
0
    def test_band_e_bm(self, its=50):
        for it in range(its):
            size = random.choice([0, 1, randint(0, 10), randint(0, 100)])
            mat_bm = gen_BandMat(size)
            l = random.choice([0, 1, randint(0, 10)])
            u = random.choice([0, 1, randint(0, 10)])

            mat_rect = bm.band_e_bm(l, u, mat_bm)

            mat_rect_good = fl.band_e(l, u, mat_bm.full())
            assert_allequal(mat_rect, mat_rect_good)
            assert not np.may_share_memory(mat_rect, mat_bm.data)