def send(self): smsg = DecodedMsg() smsg.set_counter(self.counter) smsg.set_perform_svd(self.perform_svd) if self.perform_svd: smsg.set_A(self.A[self.perform_svd-1]) self.mif.sendMsg(self.source, 0xFFFF, smsg.get_amType(), 0, smsg)
def initialSend(self): #print 'initial send' smsg1 = DecodedMsg() smsg1.set_crow(255) smsg1.set_V_coeff(self.data[(2, 4, 6), :]) #only send the nonzero side information (j<A in tinyos code)? self.mif.sendMsg(self.source, 0xFFFF, smsg1.get_amType(), 0, smsg1)
def send(self): smsg = DecodedMsg() smsg.set_counter(self.counter) smsg.set_perform_svd(self.perform_svd) if self.perform_svd: smsg.set_A(self.A[self.perform_svd - 1]) self.mif.sendMsg(self.source, 0xFFFF, smsg.get_amType(), 0, smsg)
def initialSend(self): #print 'initial send' smsg1 = DecodedMsg() smsg1.set_crow(255) smsg1.set_V_coeff(self.data[(2,4,6),:]) #only send the nonzero side information (j<A in tinyos code)? self.mif.sendMsg(self.source, 0xFFFF, smsg1.get_amType(), 0, smsg1)
def send(self): smsg = DecodedMsg() #this line here needs to be changed to just be random coefficients. blah = np.random.randn(1, self.N) smsg.set_V_coeff(blah[0, :]) #smsg.set_V_coeff(self.A[self.current_row]) smsg.set_crow(self.current_row) smsg.set_data([1]) self.mif.sendMsg(self.source, 0xFFFF, smsg.get_amType(), 0, smsg)
def send(self): smsg = DecodedMsg() #this line here needs to be changed to just be random coefficients. blah = np.random.randn(1,self.N) smsg.set_V_coeff(blah[0,:]) #smsg.set_V_coeff(self.A[self.current_row]) smsg.set_crow(self.current_row) smsg.set_data([1]) self.mif.sendMsg(self.source, 0xFFFF, smsg.get_amType(), 0, smsg)
def send(self): smsg = DecodedMsg() #print 'type of A is ', type(self.A) print 'cr ', self.A[self.current_row] #print 'type of cr ', type(self.A[self.current_row]) #random coefficients instead #rndRow = np.random.randn(1,self.N) #print 'random row is', rndRow[0,:] #print self.rndV #self.rndV = np.bmat([[self.rndV], [rndRow]]) #print 'matrix of random rows is' #print self.rndV #smsg.set_V_coeff(rndRow[0,:]) #also change data symbols #self.rndSym = np.dot(rndRow[0,:],self.data) #smsg.set_data(self.rndSym) smsg.set_V_coeff(self.A[self.current_row]) smsg.set_data(self.sym[self.current_row]) #use current row each time? #print type(self.A[0,0]) smsg.set_crow(self.current_row) self.mif.sendMsg(self.source, 0xFFFF, smsg.get_amType(), 0, smsg)
def send(self): smsg = DecodedMsg() smsg.set_V_coeff(self.A[self.current_row]) smsg.set_crow(self.current_row) smsg.set_data(self.sym[self.current_row]) #use current row each time? self.mif.sendMsg(self.source, 0xFFFF, smsg.get_amType(), 0, smsg)
def send(self): smsg = DecodedMsg() smsg.set_counter(self.counter) smsg.set_current_row(self.current_row) smsg.set_V_row(self.A[self.current_row]) self.mif.sendMsg(self.source, 0xFFFF, smsg.get_amType(), 0, smsg)