I just wanted to share some trouble I had trying to create a pmt uniform c32 vector in python, what I found as the fix, and hope to get some insight as to why things are this way.
THIS CREATES A VECTOR, BUT NOT A UNIFORM OR C32 VECTOR:
testv = pmt.to_pmt([complex(1.0), complex(-1.0)]*50)
pmt.is_vector(testv) # True
pmt.is_uniform_vector(testv) # False
pmt.is_c32vector(testv) # False
THIS FAILS:
testv1 = pmt.make_c32vector(100, [complex(1.0), complex(-1.0)]*50)
THIS SUCCEEDS, but is a PITA:
testv1 = pmt.make_c32vector(100, complex(-1.0))
for i in range(pmt.length(testv)):
if i%2 == 0:
pmt.c32vector_set(testv, i, complex(1.0))
THIS IS THE CORRECT WAY TO DO IT:
testv2 = pmt.init_c32vector(100, [complex(1.0), complex(-1.0)]*50)