| Download
Project: Peter's Files
Views: 99Visibility: Unlisted (only visible to those who know the link)
Kernel: Python 3 (Ubuntu Linux)
In [1]:
In [2]:
In [3]:
In [4]:
In [5]:
In [6]:
Finding mu(Z_ 3 ^ 2 , { 2 , 1 }). Checking: |A|= 3 ... 5 :
3
4
'mu(Z_3^2, {2, 1}) = 4 found A = [(0, 1), (0, 2), (1, 0), (2, 0)]'
In [7]:
Finding μ(G(3, 3),{2,1}). Checking: |A|= 1 ... 9 :
((0, 0),)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-7-31df0b08ba8d> in <module>()
----> 1 mu_R_G((3,3),2,1)
<ipython-input-5-90aa8b974f0b> in mu_R_G(N, k, l)
44 for A in it.combinations(G,m): # A is a tuple of tuples
45 print(A)
---> 46 if intersectW(RG_sumset([k],A,N),(RG_sumset([l],A,N))).size == 0:
47 result = m #SpecialReturn(m,k,l,A,N,verbose)
48 break
<ipython-input-4-703a0cbee07d> in RG_sumset(H, A, N)
26 for i in it.combinations(A, h): # A is a tuple of tuples
27 SS = np.row_stack((SS, sum_of_elements_G(i,N)))
---> 28 return np.unique(SS[1:], axis =0)
29
30 def D(n):
/usr/local/lib/python3.6/dist-packages/numpy/lib/arraysetops.py in unique(ar, return_index, return_inverse, return_counts, axis)
243 # Must reshape to a contiguous 2D array for this to work...
244 orig_shape, orig_dtype = ar.shape, ar.dtype
--> 245 ar = ar.reshape(orig_shape[0], -1)
246 ar = np.ascontiguousarray(ar)
247 dtype = [('f{i}'.format(i=i), ar.dtype) for i in range(ar.shape[1])]
ValueError: cannot reshape array of size 0 into shape (0,newaxis)
In [0]:
In [0]:
In [0]:
In [0]: