BUG: modified ClusterNode.pre_order() for non-root nodes.
BUG: modified ClusterNode.pre_order() for non-root nodes.

Fixes gh-2177 by replacing the boolean vectors with sets.

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