= np.zeros((2, 2), dtype=np.int)print("1:" + str(submatrix))>>>2:[[1 2] # since submatrix[0,0] didn't change to 0, elements must have been[:2,:2] = x[:2, :2] # perform same a
all possible 8x8 submatrices # extract 8x8 submatrixfrom the matrix # do some work on the submatrixfoo(submatrix)
问题是:上面的代码可以很好地工作到n=30x30矩阵(大约有500万个可能
.|我需要最快的方法(用伪码)来填充第三个矩阵 for each row in submatrixpos= argmax(expectations(row,start_submatrix(col):end_submatrix(col)))
result(row,col= 0; submatrix_to_process < number_columns_results;