mahout源码分析之DistributedLanczosSolver(三)Job2
Mahout版本:0.7,hadoop版本:1.0.4,jdk:1.7.0_25 64bit。
1. 前奏:
本篇接着上篇继续分析,分析LanczosSolver中的:Vector nextVector = isSymmetric ? corpus.times(currentVector) : corpus.timesSquared(currentVector);之后。前篇说到这个是建立了一个job任务,并且按照一定的算法求得了一个nextVector,那么接下来是?
0.01187710.0017762260.0021732280.014294310.0966174390.002638990.00268705000.0050126000.99511791可见,由于误差,excel中的数据直接变为0了(比较小的数值);接下来还是更新nextVector的:
-0.075668-0.08576847-0.08537146-0.0732503820.009072747-0.0849057-0.0848576-0.1-0.1-0.082532-0.1-0.10.90757322接着是:public EigenDecomposition(Matrix x, boolean isSymmetric) { n = x.columnSize(); d = new DenseVector(n); e = new DenseVector(n); v = new DenseMatrix(n, n); if (isSymmetric) { v.assign(x); // Tridiagonalize. tred2(); // Diagonalize. tql2(); } else { // Reduce to Hessenberg form. // Reduce Hessenberg to real Schur form. hqr2(orthes(x)); } }assign就是把x赋值给v,tred2和tql2是做什么的呢?额,吓我一跳,because 太他X长了,果然java不适合做矩阵处理。。。
分享,成长,快乐
转载请注明blog地址:http://blog.csdn.net/fansy1990