from MPFFuns import circulant, MPF from Utils.generators import generate_anticirculant_rand_word_mat from Utils.words_matrices_utils import pwords max_W = generate_anticirculant_rand_word_mat(3, [20, 20, 20]) X = circulant([20, 20, 20]) Y = circulant([20, 20, 20]) res = MPF(X, max_W, Y) pwords(res)
Wo(0, 8, 1, 0)], [Wo(0, 18, 8, 0), Wo(1, 0, 4, 0), Wo(0, 7, 0, 0), Wo(0, 19, 28, 0)], [Wo(1, 20, 25, 1), Wo(0, 18, 11, 0), Wo(0, 16, 25, 0), Wo(1, 17, 6, 0)], [Wo(1, 22, 14, 0), Wo(0, 13, 22, 0), Wo(0, 24, 15, 1), Wo(1, 14, 18, 0)]] print("Original matrix's delta = >") plambda(W) X = circulant([8, 8, 8, 8]) Y = circulant([8, 8, 8, 8]) #random.seed(20) W = generate_anticirculant_rand_word_mat(4, [6, 2, -2, -6], 50) pwords(W) X = circulant([2, 5, 7, 8]) Y = circulant([3, 7, 4, 2]) res = MPF(X, W, Y) print("Deltas -> ") plambda(res)
def get_sigma_mat(words): res = [[word.get_miu() for word in row] for row in words] return res # In[229]: N = 4 random.seed(42) W = generate_anticirculant_rand_word_mat(4, [6, 7, -1, -3], 50) #W = generate_random_block_matrix(4) print("Original matrix W => ") pwords(W) print() deltaW = get_delta_mat(W) pwords(W) deltaW = np.array(get_delta_mat(W)) #deltaW = np.random.randint(10, size=(4, 4)) # # X = circulant([1, 0, 0, 0]) # Y = circulant([22, 22, 21, 25]) # # # X = circulant([1, 2, 3, 3])