#NEWLINE# def test_derivative_simple( self ) : #NEWLINE# #INDENT# np . random . seed ( 1234 ) #NEWLINE# c = np . array ( [ [ 4 , 3 , 2 , 1 ] ] ) . T #NEWLINE# dc = np . array ( [ [ ( 3 * 4 ) , ( 2 * 3 ) , 2 ] ] ) . T #NEWLINE# ddc = np . array ( [ [ ( ( 2 * 3 ) * 4 ) , ( ( 1 * 2 ) * 3 ) ] ] ) . T #NEWLINE# x = np . array ( [ 0 , 1 ] ) #NEWLINE# pp = PPoly ( c , x ) #NEWLINE# dpp = PPoly ( dc , x ) #NEWLINE# ddpp = PPoly ( ddc , x ) #NEWLINE# assert_allclose ( pp . derivative ( ) . c , ddc . c ) #NEWLINE# assert_allclose ( pp . derivative ( 2 ) . c , ddpp . c )