Use numpy directly for matrix multiply.
Use numpy directly for matrix multiply.

Using matrix multiply to compute XtX and XtY yields a 5-20x speedup depending on problem size.

For example - the following takes 19s locally after this change vs. 5m21s before the change. (16x speedup).
bin/pyspark examples/src/main/python/als.py local[8] 1000 1000 50 10 10

Author: Evan Sparks <evan.sparks@gmail.com>

Closes #687 from etrain/patch-1 and squashes the following commits:

e094dbc [Evan Sparks] Touching only diaganols on update.
d1ab9b6 [Evan Sparks] Use numpy directly for matrix multiply.

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