#NEWLINE# @ classmethod #NEWLINE# def _reals_index( cls , reals , index ) : #NEWLINE# #INDENT# '\n        Map initial real root index to an index in a factor where\n        the root belongs.\n        ' #NEWLINE# i = 0 #NEWLINE# for ( j , ( _ , factor , k ) ) in enumerate ( reals ) : #NEWLINE# #INDENT# if ( index < ( i + k ) ) : #NEWLINE# #INDENT# ( poly , index ) = ( factor , 0 ) #NEWLINE# for ( _ , factor , _ ) in reals [ : j ] : #NEWLINE# #INDENT# if ( factor == poly ) : #NEWLINE# #INDENT# index += 1 #NEWLINE# #UNINDENT# #UNINDENT# return ( factor , index ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# i += k