[SPARK-9138] [MLLIB] fix Vectors.dense
[SPARK-9138] [MLLIB] fix Vectors.dense

Vectors.dense() should accept numbers directly, like the one in Scala. We already use it in doctests, it worked by luck.

cc mengxr jkbradley

Author: Davies Liu <davies@databricks.com>

Closes #7476 from davies/fix_vectors_dense and squashes the following commits:

e0fd292 [Davies Liu] fix Vectors.dense

publicRoman/spark,debugger87/spark,UndeadBaneGitHub/spark,markhamstra/spark,cin/spark,patrick-nicholson/spark,zzcclp/spark,yanboliang/spark,akopich/spark,adrian-ionescu/apache-spark,joseph-torres/spark,esi-mineset/spark,shubhamchopra/spark,setjet/spark,kiszk/spark,icexelloss/spark,rezasafi/spark,szhem/spark,maropu/spark,kevinyu98/spark,jiangxb1987/spark,gioenn/xSpark,zzcclp/spark,HyukjinKwon/spark,rednaxelafx/apache-spark,tejasapatil/spark,szhem/spark,brad-kaiser/spark,gengliangwang/spark,LantaoJin/spark,goldmedal/spark,wzhfy/spark,liutang123/spark,byakuinss/spark,actuaryzhang/spark,nilsgrabbert/spark,SnappyDataInc/spark,lvdongr/spark,debugger87/spark,JoshRosen/spark,holdenk/spark,BryanCutler/spark,gioenn/xSpark,ibm-research-ireland/sparkoscope,aokolnychyi/spark,SHASHANKB/spark,saturday-shi/spark,milliman/spark,ptkool/spark,mahak/spark,SHASHANKB/spark,aray/spark,pronix/spark,dbtsai/spark,huang1900/spark,aray/spark,dbtsai/spark,aray/spark,ericvandenbergfb/spark,sureshthalamati/spark,jkbradley/spark,panfengfeng/spark,sachintyagi22/spark,sahilTakiar/spark,maropu/spark,nlalevee/spark,aosagie/spark,xflin/spark,facaiy/spark,SnappyDataInc/spark,kevinyu98/spark,witgo/spark,patrick-nicholson/spark,spark-test/spark,WeichenXu123/spark,pronix/spark,akopich/spark,rekhajoshm/spark,kevinyu98/spark,zuotingbing/spark,MLnick/spark,minixalpha/spark,UndeadBaneGitHub/spark,chuckchen/spark,Aegeaner/spark,andrewor14/spark,adrian-ionescu/apache-spark,SnappyDataInc/spark,ron8hu/spark,publicRoman/spark,ron8hu/spark,guoxiaolongzte/spark,ahnqirage/spark,highfei2011/spark,maropu/spark,apache-spark-on-k8s/spark,maropu/spark,sachintyagi22/spark,stanzhai/spark,panfengfeng/spark,jianran/spark,xuanyuanking/spark,dbtsai/spark,stanzhai/spark,byakuinss/spark,kissmetrics/spark,ron8hu/spark,joseph-torres/spark,jianran/spark,cloud-fan/spark,lvdongr/spark,srowen/spark,huang1900/spark,ioana-delaney/spark,wangyum/spark,jianran/spark,guoxiaolongzte/spark,cloud-fan/spark,tengpeng/spark,dhruve/spark,esi-mineset/spark,shaneknapp/spark,narahari92/spark,zero323/spark,markhamstra/spark,zero323/spark,zhouyejoe/spark,aokolnychyi/spark,spark-test/spark,wzhfy/spark,mdespriee/spark,skonto/spark,tejasapatil/spark,lxsmnv/spark,haowu80s/spark,bravo-zhang/spark,bOOm-X/spark,bOOm-X/spark,spark-test/spark,pronix/spark,markhamstra/spark,mahak/spark,darionyaphet/spark,taroplus/spark,narahari92/spark,liyichao/spark,minixalpha/spark,WeichenXu123/spark,michalsenkyr/spark,rikima/spark,ptkool/spark,1haodian/spark,WeichenXu123/spark,metamx/spark,chuckchen/spark,goldmedal/spark,sachintyagi22/spark,akopich/spark,SHASHANKB/spark,gengliangwang/spark,wangyum/spark,LantaoJin/spark,zero323/spark,ConeyLiu/spark,setjet/spark,kissmetrics/spark,sureshthalamati/spark,michalsenkyr/spark,big-pegasus/spark,facaiy/spark,ueshin/apache-spark,yanboliang/spark,sahilTakiar/spark,zhouyejoe/spark,alunarbeach/spark,joseph-torres/spark,SHASHANKB/spark,publicRoman/spark,ericvandenbergfb/spark,zero323/spark,bdrillard/spark,ddna1021/spark,bravo-zhang/spark,gioenn/xSpark,actuaryzhang/spark,ueshin/apache-spark,liutang123/spark,map222/spark,LantaoJin/spark,1haodian/spark,cin/spark,hvanhovell/spark,JoshRosen/spark,jlopezmalla/spark,mike0sv/spark,kissmetrics/spark,narahari92/spark,bdrillard/spark,sachintyagi22/spark,aosagie/spark,jrshust/spark,someorz/spark,liutang123/spark,ajaysaini725/spark,gioenn/xSpark,bdrillard/spark,akopich/spark,ptkool/spark,taroplus/spark,ConeyLiu/spark,rekhajoshm/spark,ptkool/spark,markhamstra/spark,patrick-nicholson/spark,sureshthalamati/spark,hvanhovell/spark,bravo-zhang/spark,taroplus/spark,kimoonkim/spark,someorz/spark,wzhfy/spark,witgo/spark,minixalpha/spark,Panos-Bletsos/spark-cost-model-optimizer,kissmetrics/spark,facaiy/spark,zero323/spark,huang1900/spark,alunarbeach/spark,aokolnychyi/spark,brad-kaiser/spark,someorz/spark,poffuomo/spark,chuckchen/spark,tejasapatil/spark,poffuomo/spark,bdrillard/spark,dongjoon-hyun/spark,ueshin/apache-spark,guoxiaolongzte/spark,apache/spark,nilsgrabbert/spark,saltstar/spark,publicRoman/spark,vinodkc/spark,ericvandenbergfb/spark,szhem/spark,JoshRosen/spark,tengpeng/spark,jkbradley/spark,guoxiaolongzte/spark,hhbyyh/spark,maropu/spark,adrian-ionescu/apache-spark,jianran/spark,stanzhai/spark,xflin/spark,JerryLead/spark,janewangfb/spark,sureshthalamati/spark,jiangxb1987/spark,goldmedal/spark,icexelloss/spark,Panos-Bletsos/spark-cost-model-optimizer,BryanCutler/spark,esi-mineset/spark,patrick-nicholson/spark,shaneknapp/spark,rednaxelafx/apache-spark,xflin/spark,bravo-zhang/spark,saltstar/spark,kissmetrics/spark,dhruve/spark,brad-kaiser/spark,nchammas/spark,rekhajoshm/spark,minixalpha/spark,big-pegasus/spark,saltstar/spark,darionyaphet/spark,WeichenXu123/spark,publicRoman/spark,holdenk/spark,cin/spark,sahilTakiar/spark,shubhamchopra/spark,goldmedal/spark,icexelloss/spark,nilsgrabbert/spark,wangmiao1981/spark,ConeyLiu/spark,goldmedal/spark,UndeadBaneGitHub/spark,mzl9039/spark,milliman/spark,minixalpha/spark,rikima/spark,zzcclp/spark,Panos-Bletsos/spark-cost-model-optimizer,WindCanDie/spark,rednaxelafx/apache-spark,jlopezmalla/spark,WindCanDie/spark,Aegeaner/spark,alunarbeach/spark,Aegeaner/spark,icexelloss/spark,andrewor14/spark,someorz/spark,liutang123/spark,milliman/spark,Panos-Bletsos/spark-cost-model-optimizer,apache-spark-on-k8s/spark,UndeadBaneGitHub/spark,shuangshuangwang/spark,wzhfy/spark,milliman/spark,eyalfa/spark,bOOm-X/spark,taroplus/spark,kissmetrics/spark,huang1900/spark,yanboliang/spark,rekhajoshm/spark,mdespriee/spark,mzl9039/spark,tengpeng/spark,janewangfb/spark,ajaysaini725/spark,ericvandenbergfb/spark,techaddict/spark,ahnqirage/spark,mahak/spark,1haodian/spark,nilsgrabbert/spark,setjet/spark,wangyum/spark,liyichao/spark,WeichenXu123/spark,lvdongr/spark,kiszk/spark,ajaysaini725/spark,ibm-research-ireland/sparkoscope,techaddict/spark,shaneknapp/spark,caneGuy/spark,sachintyagi22/spark,narahari92/spark,SnappyDataInc/spark,ahnqirage/spark,gengliangwang/spark,HyukjinKwon/spark,highfei2011/spark,mdespriee/spark,hhbyyh/spark,srowen/spark,metamx/spark,byakuinss/spark,taroplus/spark,Panos-Bletsos/spark-cost-model-optimizer,ioana-delaney/spark,Aegeaner/spark,hhbyyh/spark,ioana-delaney/spark,pgandhi999/spark,adrian-ionescu/apache-spark,gengliangwang/spark,gengliangwang/spark,shaneknapp/spark,jrshust/spark,zhouyejoe/spark,ericvandenbergfb/spark,Panos-Bletsos/spark-cost-model-optimizer,ajaysaini725/spark,adrian-ionescu/apache-spark,akopich/spark,liutang123/spark,hhbyyh/spark,jkbradley/spark,UndeadBaneGitHub/spark,sahilTakiar/spark,JerryLead/spark,tejasapatil/spark,aosagie/spark,LantaoJin/spark,goldmedal/spark,narahari92/spark,dongjoon-hyun/spark,dongjoon-hyun/spark,1haodian/spark,byakuinss/spark,huang1900/spark,lvdongr/spark,srowen/spark,guoxiaolongzte/spark,ConeyLiu/spark,highfei2011/spark,mike0sv/spark,kiszk/spark,WindCanDie/spark,debugger87/spark,ahnqirage/spark,vinodkc/spark,big-pegasus/spark,bOOm-X/spark,minixalpha/spark,shuangshuangwang/spark,zero323/spark,joseph-torres/spark,nchammas/spark,rezasafi/spark,UndeadBaneGitHub/spark,joseph-torres/spark,caneGuy/spark,ron8hu/spark,ConeyLiu/spark,hvanhovell/spark,apache-spark-on-k8s/spark,patrick-nicholson/spark,brad-kaiser/spark,saturday-shi/spark,srowen/spark,someorz/spark,ddna1021/spark,yanboliang/spark,jrshust/spark,minixalpha/spark,spark-test/spark,yanboliang/spark,aokolnychyi/spark,pgandhi999/spark,jkbradley/spark,zzcclp/spark,ron8hu/spark,aosagie/spark,caneGuy/spark,michalsenkyr/spark,hhbyyh/spark,aokolnychyi/spark,WindCanDie/spark,JoshRosen/spark,cin/spark,michalsenkyr/spark,highfei2011/spark,UndeadBaneGitHub/spark,zuotingbing/spark,jiangxb1987/spark,aosagie/spark,eyalfa/spark,witgo/spark,markhamstra/spark,skonto/spark,poffuomo/spark,BryanCutler/spark,hhbyyh/spark,jlopezmalla/spark,apache/spark,saltstar/spark,dbtsai/spark,alunarbeach/spark,WeichenXu123/spark,tengpeng/spark,map222/spark,big-pegasus/spark,JerryLead/spark,SnappyDataInc/spark,ioana-delaney/spark,jkbradley/spark,SHASHANKB/spark,sahilTakiar/spark,sureshthalamati/spark,gengliangwang/spark,ahnqirage/spark,huang1900/spark,pgandhi999/spark,dbtsai/spark,zhouyejoe/spark,vinodkc/spark,cloud-fan/spark,ddna1021/spark,spark-test/spark,mike0sv/spark,nlalevee/spark,nilsgrabbert/spark,nchammas/spark,markhamstra/spark,debugger87/spark,liyichao/spark,ibm-research-ireland/sparkoscope,eyalfa/spark,darionyaphet/spark,HyukjinKwon/spark,mahak/spark,jiangxb1987/spark,MLnick/spark,byakuinss/spark,wzhfy/spark,nlalevee/spark,saturday-shi/spark,nlalevee/spark,ddna1021/spark,mdespriee/spark,zuotingbing/spark,alunarbeach/spark,lxsmnv/spark,loneknightpy/spark,stanzhai/spark,apache/spark,szhem/spark,JoshRosen/spark,map222/spark,chuckchen/spark,SHASHANKB/spark,cloud-fan/spark,ConeyLiu/spark,ahnqirage/spark,aray/spark,techaddict/spark,shuangshuangwang/spark,LantaoJin/spark,zhouyejoe/spark,skonto/spark,kimoonkim/spark,liyichao/spark,mzl9039/spark,loneknightpy/spark,sachintyagi22/spark,cloud-fan/spark,xuanyuanking/spark,sureshthalamati/spark,haowu80s/spark,panfengfeng/spark,witgo/spark,byakuinss/spark,JerryLead/spark,jlopezmalla/spark,yanboliang/spark,debugger87/spark,wangmiao1981/spark,lxsmnv/spark,adrian-ionescu/apache-spark,apache-spark-on-k8s/spark,HyukjinKwon/spark,andrewor14/spark,dongjoon-hyun/spark,kimoonkim/spark,bravo-zhang/spark,shuangshuangwang/spark,skonto/spark,rezasafi/spark,hvanhovell/spark,saturday-shi/spark,cloud-fan/spark,joseph-torres/spark,icexelloss/spark,ptkool/spark,shaneknapp/spark,liyichao/spark,dhruve/spark,map222/spark,holdenk/spark,wangyum/spark,kiszk/spark,pgandhi999/spark,xuanyuanking/spark,mdespriee/spark,pronix/spark,big-pegasus/spark,1haodian/spark,haowu80s/spark,saltstar/spark,poffuomo/spark,saltstar/spark,aray/spark,aray/spark,big-pegasus/spark,ajaysaini725/spark,ddna1021/spark,wangyum/spark,holdenk/spark,highfei2011/spark,facaiy/spark,liutang123/spark,BryanCutler/spark,actuaryzhang/spark,brad-kaiser/spark,xuanyuanking/spark,Aegeaner/spark,esi-mineset/spark,brad-kaiser/spark,mahak/spark,sureshthalamati/spark,rezasafi/spark,poffuomo/spark,mahak/spark,srowen/spark,JerryLead/spark,jrshust/spark,kevinyu98/spark,aosagie/spark,kiszk/spark,liyichao/spark,LantaoJin/spark,JerryLead/spark,setjet/spark,dongjoon-hyun/spark,mdespriee/spark,ddna1021/spark,maropu/spark,lvdongr/spark,sachintyagi22/spark,esi-mineset/spark,rekhajoshm/spark,icexelloss/spark,liutang123/spark,sahilTakiar/spark,akopich/spark,adrian-ionescu/apache-spark,rezasafi/spark,caneGuy/spark,panfengfeng/spark,jlopezmalla/spark,liyichao/spark,jkbradley/spark,JoshRosen/spark,highfei2011/spark,saturday-shi/spark,panfengfeng/spark,skonto/spark,akopich/spark,loneknightpy/spark,janewangfb/spark,zzcclp/spark,apache/spark,andrewor14/spark,rikima/spark,icexelloss/spark,ajaysaini725/spark,vinodkc/spark,ahnqirage/spark,ibm-research-ireland/sparkoscope,aray/spark,narahari92/spark,witgo/spark,actuaryzhang/spark,highfei2011/spark,ptkool/spark,Panos-Bletsos/spark-cost-model-optimizer,michalsenkyr/spark,zuotingbing/spark,zuotingbing/spark,spark-test/spark,zzcclp/spark,witgo/spark,actuaryzhang/spark,milliman/spark,jianran/spark,kissmetrics/spark,metamx/spark,map222/spark,nchammas/spark,shuangshuangwang/spark,pgandhi999/spark,ron8hu/spark,wzhfy/spark,dbtsai/spark,bdrillard/spark,loneknightpy/spark,techaddict/spark,narahari92/spark,MLnick/spark,shaneknapp/spark,pgandhi999/spark,dongjoon-hyun/spark,srowen/spark,wangmiao1981/spark,JoshRosen/spark,publicRoman/spark,saltstar/spark,kevinyu98/spark,rezasafi/spark,nchammas/spark,lvdongr/spark,bravo-zhang/spark,lvdongr/spark,gioenn/xSpark,facaiy/spark,ioana-delaney/spark,Aegeaner/spark,caneGuy/spark,byakuinss/spark,apache-spark-on-k8s/spark,kiszk/spark,bOOm-X/spark,haowu80s/spark,BryanCutler/spark,ueshin/apache-spark,ibm-research-ireland/sparkoscope,shaneknapp/spark,apache-spark-on-k8s/spark,andrewor14/spark,xuanyuanking/spark,cloud-fan/spark,ueshin/apache-spark,eyalfa/spark,debugger87/spark,shuangshuangwang/spark,1haodian/spark,zuotingbing/spark,jiangxb1987/spark,hhbyyh/spark,setjet/spark,skonto/spark,kevinyu98/spark,facaiy/spark,bOOm-X/spark,alunarbeach/spark,debugger87/spark,actuaryzhang/spark,sahilTakiar/spark,rikima/spark,shubhamchopra/spark,BryanCutler/spark,wzhfy/spark,pronix/spark,zhouyejoe/spark,janewangfb/spark,chuckchen/spark,setjet/spark,markhamstra/spark,bdrillard/spark,rikima/spark,rikima/spark,pgandhi999/spark,nilsgrabbert/spark,MLnick/spark,hvanhovell/spark,matthewfranglen/spark,szhem/spark,zzcclp/spark,xuanyuanking/spark,mzl9039/spark,hvanhovell/spark,wangmiao1981/spark,lxsmnv/spark,eyalfa/spark,pronix/spark,cin/spark,saturday-shi/spark,jrshust/spark,ericvandenbergfb/spark,tejasapatil/spark,alunarbeach/spark,panfengfeng/spark,loneknightpy/spark,maropu/spark,zuotingbing/spark,holdenk/spark,haowu80s/spark,shubhamchopra/spark,big-pegasus/spark,andrewor14/spark,rekhajoshm/spark,huang1900/spark,patrick-nicholson/spark,metamx/spark,dhruve/spark,dongjoon-hyun/spark,wangmiao1981/spark,spark-test/spark,poffuomo/spark,dhruve/spark,techaddict/spark,stanzhai/spark,wangyum/spark,mike0sv/spark,srowen/spark,MLnick/spark,zhouyejoe/spark,techaddict/spark,wangmiao1981/spark,HyukjinKwon/spark,loneknightpy/spark,techaddict/spark,nchammas/spark,lxsmnv/spark,map222/spark,lxsmnv/spark,metamx/spark,setjet/spark,holdenk/spark,jianran/spark,poffuomo/spark,ddna1021/spark,jlopezmalla/spark,map222/spark,BryanCutler/spark,jiangxb1987/spark,gengliangwang/spark,lxsmnv/spark,WindCanDie/spark,HyukjinKwon/spark,HyukjinKwon/spark,esi-mineset/spark,hvanhovell/spark,ueshin/apache-spark,WeichenXu123/spark,aokolnychyi/spark,stanzhai/spark,kimoonkim/spark,wangmiao1981/spark,WindCanDie/spark,brad-kaiser/spark,darionyaphet/spark,mzl9039/spark,aokolnychyi/spark,milliman/spark,dhruve/spark,holdenk/spark,ioana-delaney/spark,aosagie/spark,mahak/spark,esi-mineset/spark,nlalevee/spark,joseph-torres/spark,eyalfa/spark,rednaxelafx/apache-spark,janewangfb/spark,tengpeng/spark,someorz/spark,andrewor14/spark,vinodkc/spark,loneknightpy/spark,apache-spark-on-k8s/spark,apache/spark,darionyaphet/spark,guoxiaolongzte/spark,jkbradley/spark,jrshust/spark,bdrillard/spark,kimoonkim/spark,tengpeng/spark,darionyaphet/spark,cin/spark,rezasafi/spark,jlopezmalla/spark,MLnick/spark,xflin/spark,panfengfeng/spark,ConeyLiu/spark,kimoonkim/spark,janewangfb/spark,taroplus/spark,ueshin/apache-spark,LantaoJin/spark,MLnick/spark,michalsenkyr/spark,facaiy/spark,chuckchen/spark,gioenn/xSpark,jiangxb1987/spark,kiszk/spark,Aegeaner/spark,shubhamchopra/spark,xflin/spark,shubhamchopra/spark,publicRoman/spark,vinodkc/spark,shuangshuangwang/spark,wangyum/spark,zero323/spark,taroplus/spark,caneGuy/spark,mzl9039/spark,nlalevee/spark,1haodian/spark,rekhajoshm/spark,tejasapatil/spark,ibm-research-ireland/sparkoscope,tejasapatil/spark,actuaryzhang/spark,kimoonkim/spark,SHASHANKB/spark,ajaysaini725/spark,rednaxelafx/apache-spark,nlalevee/spark,ericvandenbergfb/spark,ron8hu/spark,chuckchen/spark,WindCanDie/spark,milliman/spark,jianran/spark,nilsgrabbert/spark,xflin/spark,apache/spark,rednaxelafx/apache-spark,jrshust/spark,ioana-delaney/spark,witgo/spark,yanboliang/spark,dhruve/spark,skonto/spark,xuanyuanking/spark,szhem/spark,haowu80s/spark,michalsenkyr/spark,rikima/spark,SnappyDataInc/spark,rednaxelafx/apache-spark,mike0sv/spark,patrick-nicholson/spark,bOOm-X/spark,xflin/spark,vinodkc/spark,someorz/spark,apache/spark,guoxiaolongzte/spark,mike0sv/spark,metamx/spark,stanzhai/spark,janewangfb/spark,goldmedal/spark,saturday-shi/spark,ptkool/spark,cin/spark,shubhamchopra/spark,SnappyDataInc/spark,nchammas/spark,gioenn/xSpark,darionyaphet/spark,eyalfa/spark,ibm-research-ireland/sparkoscope,caneGuy/spark,dbtsai/spark,bravo-zhang/spark,tengpeng/spark,JerryLead/spark,kevinyu98/spark,mzl9039/spark,metamx/spark,mdespriee/spark,mike0sv/spark,szhem/spark