#NEWLINE# def compute_dr_wrt( self , wrt ) : #NEWLINE# #INDENT# if ( wrt not in [ self . v , self . rt , self . t , self . f , self . c , self . k ] ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# j = self . r_and_derivatives [ 1 ] #NEWLINE# if ( wrt is self . rt ) : #NEWLINE# #INDENT# return j [ : , : 3 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( wrt is self . t ) : #NEWLINE# #INDENT# return j [ : , 3 : 6 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( wrt is self . f ) : #NEWLINE# #INDENT# return j [ : , 6 : 8 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( wrt is self . c ) : #NEWLINE# #INDENT# return j [ : , 8 : 10 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( wrt is self . k ) : #NEWLINE# #INDENT# return j [ : , 10 : ( 10 + self . k . size ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( wrt is self . v ) : #NEWLINE# #INDENT# rot = cv2 . Rodrigues ( self . rt . r ) [ 0 ] #NEWLINE# data = np . asarray ( j [ : , 3 : 6 ] . dot ( rot ) , order = 'C' ) . ravel ( ) #NEWLINE# IS = np . repeat ( np . arange ( ( ( self . v . r . size * 2 ) / 3 ) ) , 3 ) #NEWLINE# JS = np . asarray ( np . repeat ( np . arange ( self . v . r . size ) . reshape ( ( ( - 1 ) , 3 ) ) , 2 , axis = 0 ) , order = 'C' ) . ravel ( ) #NEWLINE# result = sp . csc_matrix ( ( data , ( IS , JS ) ) ) #NEWLINE# return result