Changeset 397

Show
Ignore:
Timestamp:
06/26/08 13:49:29 (5 months ago)
Author:
pierre
Message:

Great improvement of the distance dependant distance. Speed up considerably the building time

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/common.py

    r396 r397  
    214214     
    215215    if not periodic_boundaries == None: 
    216         d = numpy.array(map(min, ((x_i, y_i) for (x_i, y_i) in zip(abs(d), periodic_boundaries-abs(d))))) 
     216        d = numpy.minimum(abs(d),periodic_boundaries-abs(d)) 
     217        #d = numpy.array(map(min, ((x_i, y_i) for (x_i, y_i) in zip(abs(d), periodic_boundaries-abs(d))))) 
    217218    if mask is not None: 
    218219        d = d[mask] 
     
    244245            dims  = diff2.shape 
    245246            diff2 = diff2.flatten() 
     247            #diff2 = numpy.minimum(diff2, periodic_boundaries[i]-diff2) 
    246248            diff2 = numpy.array(map(min, ((x_i, y_i) for (x_i, y_i) in zip(diff2, periodic_boundaries[i]-diff2)))) 
    247249            diff2 = diff2.reshape(dims) 
  • trunk/src/nest2/connectors.py

    r392 r397  
    137137                                         periodic_boundaries) 
    138138            for post in postsynaptic_neurons: 
     139                func = eval("lambda d: %s" %self.d_expression) 
     140                distances[0] = func(distances[0]) 
     141                #probabilities = map(func,distances[0]) 
     142                 
    139143                if self.allow_self_connections or pre != post:  
    140144                    # calculate the distance between the two cells : 
    141                     d = distances[0][idx_post] 
    142                     p = eval(self.d_expression) 
     145                    #d = distances[0][idx_post] 
     146                    #p = eval(self.d_expression) 
     147                    p = distances[0][idx_post] 
    143148                    if p >= 1 or (0 < p < 1 and rarr[j] < p): 
    144149                        target_list.append(post)