def getVr(self,node, rd): list_m = self.graph.node[node]['vector'] sum_result = vector.initZeros(len(self.graph.nodes())) for i in range(0,len(list_m)): if list_m[i].getRound() == rd: sum_result = vector.sum(sum_result,list_m[i].getV()) #compute alpha share to send return sum_result
def computeS(self,pos): list_m = self.graph.node[pos]['vector'] x = self.graph.node[self.graph.nodes()[pos]]['initVal'] list_sum = vector.initZeros(len(self.graph.nodes())) for i in range(0,len(list_m)): list_a = list_m[i] list_a = vector.mul(list_a.getV(),x) list_sum = vector.sum(list_sum,list_a.getV()) #compute alpha share to send list_sum = vector.mul(list_sum,self.alpha) return list_sum