BUG: optimize: fix negative curvature search direction in _minimize_newtoncg
BUG: optimize: fix negative curvature search direction in _minimize_newtoncg

When the CG iteration fails on first iteration, the algorithm should
pick the steepest descent direction pk = - c grad(f) with c > 0. There
was a sign error here which made the choice to be pk = + c grad(f),
which caused the line search to always fail.

pnedunuri/scipy,aman-iitj/scipy,mtrbean/scipy,zaxliu/scipy,fernand/scipy,fernand/scipy,piyush0609/scipy,gef756/scipy,sonnyhu/scipy,nvoron23/scipy,larsmans/scipy,argriffing/scipy,apbard/scipy,Kamp9/scipy,juliantaylor/scipy,Gillu13/scipy,arokem/scipy,Srisai85/scipy,e-q/scipy,kleskjr/scipy,lukauskas/scipy,gertingold/scipy,witcxc/scipy,gfyoung/scipy,nonhermitian/scipy,hainm/scipy,rmcgibbo/scipy,Stefan-Endres/scipy,jseabold/scipy,Stefan-Endres/scipy,FRidh/scipy,aman-iitj/scipy,anntzer/scipy,dominicelse/scipy,gdooper/scipy,pschella/scipy,jseabold/scipy,vanpact/scipy,behzadnouri/scipy,mortonjt/scipy,cpaulik/scipy,kleskjr/scipy,minhlongdo/scipy,andyfaff/scipy,gertingold/scipy,anielsen001/scipy,WarrenWeckesser/scipy,ndchorley/scipy,vanpact/scipy,pbrod/scipy,pizzathief/scipy,maciejkula/scipy,matthew-brett/scipy,pnedunuri/scipy,jor-/scipy,scipy/scipy,matthewalbani/scipy,piyush0609/scipy,sauliusl/scipy,Eric89GXL/scipy,endolith/scipy,pyramania/scipy,ales-erjavec/scipy,jakevdp/scipy,mortada/scipy,ortylp/scipy,pbrod/scipy,Newman101/scipy,mortonjt/scipy,ChanderG/scipy,apbard/scipy,niknow/scipy,mhogg/scipy,fernand/scipy,zxsted/scipy,mtrbean/scipy,maciejkula/scipy,futurulus/scipy,mingwpy/scipy,dch312/scipy,lhilt/scipy,hainm/scipy,giorgiop/scipy,jsilter/scipy,newemailjdm/scipy,nmayorov/scipy,piyush0609/scipy,newemailjdm/scipy,jjhelmus/scipy,jakevdp/scipy,endolith/scipy,anielsen001/scipy,sonnyhu/scipy,mgaitan/scipy,aarchiba/scipy,sauliusl/scipy,arokem/scipy,mdhaber/scipy,mdhaber/scipy,Eric89GXL/scipy,surhudm/scipy,FRidh/scipy,jonycgn/scipy,giorgiop/scipy,befelix/scipy,felipebetancur/scipy,tylerjereddy/scipy,woodscn/scipy,chatcannon/scipy,haudren/scipy,aman-iitj/scipy,haudren/scipy,mortonjt/scipy,pschella/scipy,mortonjt/scipy,petebachant/scipy,cpaulik/scipy,njwilson23/scipy,kalvdans/scipy,rgommers/scipy,vigna/scipy,Shaswat27/scipy,niknow/scipy,mtrbean/scipy,e-q/scipy,mikebenfield/scipy,mdhaber/scipy,andim/scipy,nonhermitian/scipy,surhudm/scipy,rmcgibbo/scipy,pschella/scipy,minhlongdo/scipy,person142/scipy,nvoron23/scipy,mortada/scipy,petebachant/scipy,jor-/scipy,kalvdans/scipy,josephcslater/scipy,futurulus/scipy,zaxliu/scipy,ales-erjavec/scipy,sriki18/scipy,ilayn/scipy,pyramania/scipy,maciejkula/scipy,behzadnouri/scipy,jamestwebber/scipy,dch312/scipy,maniteja123/scipy,vhaasteren/scipy,WarrenWeckesser/scipy,WarrenWeckesser/scipy,nmayorov/scipy,WillieMaddox/scipy,nmayorov/scipy,newemailjdm/scipy,FRidh/scipy,pnedunuri/scipy,mdhaber/scipy,perimosocordiae/scipy,chatcannon/scipy,andyfaff/scipy,perimosocordiae/scipy,ilayn/scipy,aman-iitj/scipy,e-q/scipy,ogrisel/scipy,jonycgn/scipy,zaxliu/scipy,vberaudi/scipy,jamestwebber/scipy,pbrod/scipy,Newman101/scipy,FRidh/scipy,jonycgn/scipy,ales-erjavec/scipy,vhaasteren/scipy,haudren/scipy,anntzer/scipy,andyfaff/scipy,hainm/scipy,aeklant/scipy,rmcgibbo/scipy,cpaulik/scipy,maniteja123/scipy,jamestwebber/scipy,vberaudi/scipy,sriki18/scipy,mingwpy/scipy,felipebetancur/scipy,lhilt/scipy,andim/scipy,fredrikw/scipy,piyush0609/scipy,Shaswat27/scipy,kalvdans/scipy,lhilt/scipy,lhilt/scipy,nvoron23/scipy,perimosocordiae/scipy,ilayn/scipy,behzadnouri/scipy,mgaitan/scipy,anielsen001/scipy,zerothi/scipy,anielsen001/scipy,jamestwebber/scipy,mdhaber/scipy,gef756/scipy,sriki18/scipy,bkendzior/scipy,ilayn/scipy,anntzer/scipy,FRidh/scipy,richardotis/scipy,vigna/scipy,trankmichael/scipy,WillieMaddox/scipy,jseabold/scipy,pbrod/scipy,felipebetancur/scipy,Gillu13/scipy,aman-iitj/scipy,matthew-brett/scipy,zxsted/scipy,sriki18/scipy,dominicelse/scipy,gef756/scipy,josephcslater/scipy,fernand/scipy,mtrbean/scipy,mtrbean/scipy,jjhelmus/scipy,larsmans/scipy,vberaudi/scipy,niknow/scipy,petebachant/scipy,aarchiba/scipy,jor-/scipy,jsilter/scipy,efiring/scipy,mgaitan/scipy,piyush0609/scipy,vberaudi/scipy,dch312/scipy,cpaulik/scipy,zerothi/scipy,njwilson23/scipy,jamestwebber/scipy,Kamp9/scipy,raoulbq/scipy,endolith/scipy,perimosocordiae/scipy,sriki18/scipy,bkendzior/scipy,jsilter/scipy,vanpact/scipy,rgommers/scipy,tylerjereddy/scipy,minhlongdo/scipy,ales-erjavec/scipy,nvoron23/scipy,vigna/scipy,bkendzior/scipy,jonycgn/scipy,mgaitan/scipy,lukauskas/scipy,woodscn/scipy,vigna/scipy,hainm/scipy,kleskjr/scipy,ogrisel/scipy,arokem/scipy,efiring/scipy,Srisai85/scipy,mhogg/scipy,njwilson23/scipy,Eric89GXL/scipy,WillieMaddox/scipy,WillieMaddox/scipy,futurulus/scipy,lhilt/scipy,Shaswat27/scipy,piyush0609/scipy,larsmans/scipy,ChanderG/scipy,rmcgibbo/scipy,mortada/scipy,pyramania/scipy,giorgiop/scipy,vhaasteren/scipy,gertingold/scipy,jor-/scipy,newemailjdm/scipy,giorgiop/scipy,gfyoung/scipy,chatcannon/scipy,zaxliu/scipy,sauliusl/scipy,ndchorley/scipy,sauliusl/scipy,anielsen001/scipy,WillieMaddox/scipy,josephcslater/scipy,dominicelse/scipy,tylerjereddy/scipy,larsmans/scipy,ales-erjavec/scipy,person142/scipy,ogrisel/scipy,maniteja123/scipy,bkendzior/scipy,niknow/scipy,njwilson23/scipy,ilayn/scipy,andim/scipy,Shaswat27/scipy,surhudm/scipy,trankmichael/scipy,matthew-brett/scipy,jakevdp/scipy,Stefan-Endres/scipy,person142/scipy,rmcgibbo/scipy,mingwpy/scipy,surhudm/scipy,mtrbean/scipy,efiring/scipy,witcxc/scipy,arokem/scipy,maciejkula/scipy,futurulus/scipy,apbard/scipy,aeklant/scipy,ogrisel/scipy,newemailjdm/scipy,jakevdp/scipy,matthewalbani/scipy,ChanderG/scipy,e-q/scipy,larsmans/scipy,trankmichael/scipy,gfyoung/scipy,fernand/scipy,chatcannon/scipy,Gillu13/scipy,jseabold/scipy,ales-erjavec/scipy,vberaudi/scipy,ortylp/scipy,pbrod/scipy,bkendzior/scipy,lukauskas/scipy,pizzathief/scipy,zxsted/scipy,aeklant/scipy,Dapid/scipy,WarrenWeckesser/scipy,mingwpy/scipy,rgommers/scipy,aarchiba/scipy,maniteja123/scipy,minhlongdo/scipy,cpaulik/scipy,scipy/scipy,kalvdans/scipy,gef756/scipy,juliantaylor/scipy,pizzathief/scipy,ortylp/scipy,richardotis/scipy,gdooper/scipy,maniteja123/scipy,WarrenWeckesser/scipy,gef756/scipy,Stefan-Endres/scipy,andyfaff/scipy,pnedunuri/scipy,vanpact/scipy,witcxc/scipy,sonnyhu/scipy,fredrikw/scipy,zerothi/scipy,efiring/scipy,andim/scipy,FRidh/scipy,pnedunuri/scipy,Kamp9/scipy,zerothi/scipy,rgommers/scipy,jjhelmus/scipy,person142/scipy,larsmans/scipy,fredrikw/scipy,mortada/scipy,kleskjr/scipy,woodscn/scipy,sauliusl/scipy,Kamp9/scipy,josephcslater/scipy,vberaudi/scipy,giorgiop/scipy,cpaulik/scipy,zaxliu/scipy,aarchiba/scipy,kleskjr/scipy,grlee77/scipy,mortada/scipy,mgaitan/scipy,jjhelmus/scipy,endolith/scipy,juliantaylor/scipy,Stefan-Endres/scipy,jsilter/scipy,gfyoung/scipy,aman-iitj/scipy,behzadnouri/scipy,ogrisel/scipy,petebachant/scipy,raoulbq/scipy,minhlongdo/scipy,apbard/scipy,trankmichael/scipy,fredrikw/scipy,mhogg/scipy,grlee77/scipy,gdooper/scipy,pizzathief/scipy,jseabold/scipy,Gillu13/scipy,nvoron23/scipy,jsilter/scipy,lukauskas/scipy,arokem/scipy,pyramania/scipy,nmayorov/scipy,surhudm/scipy,minhlongdo/scipy,raoulbq/scipy,petebachant/scipy,ortylp/scipy,maniteja123/scipy,aeklant/scipy,vigna/scipy,jakevdp/scipy,matthewalbani/scipy,sonnyhu/scipy,mhogg/scipy,ChanderG/scipy,sonnyhu/scipy,nonhermitian/scipy,nmayorov/scipy,perimosocordiae/scipy,Srisai85/scipy,argriffing/scipy,jjhelmus/scipy,kalvdans/scipy,jonycgn/scipy,Shaswat27/scipy,raoulbq/scipy,Eric89GXL/scipy,argriffing/scipy,ChanderG/scipy,ndchorley/scipy,ortylp/scipy,maciejkula/scipy,richardotis/scipy,Newman101/scipy,chatcannon/scipy,nonhermitian/scipy,trankmichael/scipy,pizzathief/scipy,Dapid/scipy,hainm/scipy,mikebenfield/scipy,ndchorley/scipy,rmcgibbo/scipy,Stefan-Endres/scipy,witcxc/scipy,matthewalbani/scipy,zerothi/scipy,argriffing/scipy,argriffing/scipy,Srisai85/scipy,grlee77/scipy,haudren/scipy,befelix/scipy,gdooper/scipy,trankmichael/scipy,dominicelse/scipy,WarrenWeckesser/scipy,woodscn/scipy,matthew-brett/scipy,zxsted/scipy,fredrikw/scipy,sauliusl/scipy,scipy/scipy,giorgiop/scipy,woodscn/scipy,Dapid/scipy,anntzer/scipy,andim/scipy,haudren/scipy,hainm/scipy,Newman101/scipy,grlee77/scipy,Dapid/scipy,dominicelse/scipy,Gillu13/scipy,mortada/scipy,tylerjereddy/scipy,pschella/scipy,grlee77/scipy,sriki18/scipy,Newman101/scipy,vanpact/scipy,anielsen001/scipy,niknow/scipy,sonnyhu/scipy,gef756/scipy,efiring/scipy,raoulbq/scipy,mikebenfield/scipy,aarchiba/scipy,mgaitan/scipy,josephcslater/scipy,zxsted/scipy,futurulus/scipy,behzadnouri/scipy,pnedunuri/scipy,apbard/scipy,lukauskas/scipy,befelix/scipy,endolith/scipy,Shaswat27/scipy,scipy/scipy,behzadnouri/scipy,gdooper/scipy,andim/scipy,mikebenfield/scipy,chatcannon/scipy,anntzer/scipy,aeklant/scipy,jor-/scipy,futurulus/scipy,anntzer/scipy,ilayn/scipy,lukauskas/scipy,surhudm/scipy,person142/scipy,befelix/scipy,endolith/scipy,gertingold/scipy,perimosocordiae/scipy,befelix/scipy,njwilson23/scipy,zerothi/scipy,juliantaylor/scipy,tylerjereddy/scipy,efiring/scipy,e-q/scipy,mhogg/scipy,gfyoung/scipy,Srisai85/scipy,zaxliu/scipy,Eric89GXL/scipy,matthew-brett/scipy,andyfaff/scipy,niknow/scipy,fernand/scipy,richardotis/scipy,nvoron23/scipy,argriffing/scipy,mortonjt/scipy,felipebetancur/scipy,Dapid/scipy,witcxc/scipy,Kamp9/scipy,gertingold/scipy,Dapid/scipy,mingwpy/scipy,pschella/scipy,mhogg/scipy,zxsted/scipy,nonhermitian/scipy,pbrod/scipy,vhaasteren/scipy,ChanderG/scipy,dch312/scipy,mingwpy/scipy,kleskjr/scipy,vanpact/scipy,ndchorley/scipy,pyramania/scipy,WillieMaddox/scipy,jseabold/scipy,raoulbq/scipy,Kamp9/scipy,newemailjdm/scipy,njwilson23/scipy,ortylp/scipy,andyfaff/scipy,scipy/scipy,rgommers/scipy,juliantaylor/scipy,mdhaber/scipy,mortonjt/scipy,richardotis/scipy,mikebenfield/scipy,vhaasteren/scipy,jonycgn/scipy,vhaasteren/scipy,petebachant/scipy,Srisai85/scipy,felipebetancur/scipy,Newman101/scipy,felipebetancur/scipy,scipy/scipy,haudren/scipy,dch312/scipy,Eric89GXL/scipy,matthewalbani/scipy,woodscn/scipy,Gillu13/scipy,richardotis/scipy,fredrikw/scipy,ndchorley/scipy