#NEWLINE# def get_intersections( self , istart , iend ) : #NEWLINE# #INDENT# '\n        return the id of intervals intersecting with [istar,iend] at each of the discontinuity points\n        example:\n        say we have [1,3](index 0), [2,6](index 1), [4,7](index 2) as our interval sets.\n        calling get_intersections(2,5) will return\n        [[0,1],[0,1],[1,2]]\n        because at discontinuity point x=2, intervals with indices 0,1 intersect x=2,\n        at discontinuity point x=3, intervals with indices 0,1 intersect with x=3,\n        and at discontinuity point x=4, intervals with indices 1,2 intersect x=4.\n        @note: This is a special purpose intersection aimed at finding multi-dimentional intersection used later\n        @param istart: start of interval\n        @param iend: end of interval\n        @return: list of interval index lists\n        @note: this method should only be called after contain method is called and you make sure that\n        [istart,iend] is contained in the interval set\n        ' #NEWLINE# indices = [ ] #NEWLINE# self . intervals . sort ( ( lambda x , y : cmp ( x [ 0 ] , y [ 0 ] ) ) ) #NEWLINE# current_point = istart #NEWLINE# while True : #NEWLINE# #INDENT# actives = filter ( ( lambda x : ( ( x [ 0 ] <= current_point ) and ( x [ 1 ] >= current_point ) ) ) , self . intervals ) #NEWLINE# if ( len ( actives ) == 0 ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# indices . append ( map ( ( lambda x : x [ 2 ] ) , actives ) ) #NEWLINE# if ( current_point >= iend ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# current_point = min ( filter ( ( lambda x : ( x > current_point ) ) , self . points ) ) #NEWLINE# if ( current_point >= indices ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# return indices