public void QRDecomposition(T[][][] matrix, T[][][] res1, T[][][] res2) {
		T[][][] u = env.newTArray(matrix[0].length, matrix.length, 1);
		T[][][] e = env.newTArray(matrix[0].length, matrix.length, 1);
		T[][][] a = transpose(matrix);
		for (int i = 0; i < matrix[0].length; ++i) {
			u[i] = a[i];
			for (int j = 0; j < i; ++j) {
				u[i] = veclib.sub(u[i], veclib.projection(a[i], e[j]));
			}
			e[i] = veclib.normalize(u[i]);
		}
		T[][][] r = env.newTArray(matrix.length, matrix[0].length, 1);
		T[] zero = lib.publicValue(0);
		for (int i = 0; i < r.length; ++i) {
			for (int j = 0; j < r[0].length; ++j) {
				if (i <= j)
					r[i][j] = veclib.innerProduct(e[i], a[j]);
				else
					r[i][j] = zero;
			}
		}
		res1 = transpose(e);
		res2 = r;
	}