#NEWLINE# def test_armijo_terminate_1( self ) : #NEWLINE# #INDENT# count = [ 0 ] #NEWLINE# def phi( s ) : #NEWLINE# #INDENT# count [ 0 ] += 1 #NEWLINE# return ( ( - s ) + ( 0.01 * ( s ** 2 ) ) ) #NEWLINE# #UNINDENT# ( s , phi1 ) = ls . scalar_search_armijo ( phi , phi ( 0 ) , ( - 1 ) , alpha0 = 1 ) #NEWLINE# assert_equal ( s , 1 ) #NEWLINE# assert_equal ( count [ 0 ] , 2 ) #NEWLINE# assert_armijo ( s , phi )