code: function qrJs() {
                  var m = this.rows();
                  var n = this.cols();
                  var Q = Matrix$b.I(m);
                  var A = this;
                  
                  for(var k = 1; k < Math.min(m, n); k++) {
              	var ak = A.slice(k, 0, k, k).col(1);
              	var oneZero = [1];
              	
              	while(oneZero.length <=  m - k)
              	    oneZero.push(0);
              	
              	oneZero = $V(oneZero);
              	var vk = ak.add(oneZero.x(ak.norm() * Math.sign(ak.e(1))));
              	var Vk = $M(vk);
              	var Hk = Matrix$b.I(m - k + 1).subtract(Vk.x(2).x(Vk.transpose()).div(Vk.transpose().x(Vk).e(1, 1)));
              	var Qk = identSize(Hk, m, n, k);
              	A = Qk.x(A);
              	// slow way to compute Q
              	Q = Q.x(Qk);
                  }
                  
                  return {Q: Q, R: A};
              }
docs: QR decomposition in pure javascript