Changeset 722

Show
Ignore:
Timestamp:
03/03/10 10:53:42 (2 years ago)
Author:
pierre
Message:

Wrong commit, speed up was not complete...

Location:
trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/connectors.py

    r721 r722  
    534534        assert isinstance(space, Space) 
    535535        self.space = space 
    536  
    537          
    538     def connect(self, projection): 
    539         """Connect-up a Projection.""" 
    540         p = {} 
    541         for src in projection.pre.all(): 
    542             local = projection.post._mask_local.flatten() 
    543             d   = self.space.distances(src.position, projection.post.positions, post_mask=local) 
     536         
     537         
     538    def connect(self, projection): 
     539        """Connect-up a Projection.""" 
     540        p         = {} 
     541        local     = projection.post._mask_local.flatten() 
     542        positions = self.space.scale_factor*(projection.post.positions + self.space.offset) 
     543         
     544        for src in projection.pre.all():             
     545            d      = self.space.distances(src.position, positions, post_mask=local) 
    544546            p[src] = eval(self.d_expression).flatten() 
    545547            if p[src].dtype == 'bool': 
  • trunk/src/space.py

    r721 r722  
    6363        if len(B.shape) == 1: 
    6464            B = B.reshape(3, 1) 
    65         B = self.scale_factor*(B + self.offset) 
     65        # I'm not sure the following line should be here. Operations may be redundant and not very  
     66        # transparent from the user point of view. I moved it into the DistanceDependentProbability Connector 
     67        #B = self.scale_factor*(B + self.offset) 
    6668        d = numpy.zeros((A.shape[1], B.shape[1]), dtype=A.dtype) 
    6769        for axis in self.axes: