/**
         * <p>
         * Computes the householder vector "u" for the first column of submatrix j.  Note this is
         * a specialized householder for this problem.  There is some protection against
         * overflow and underflow.
         * </p>
         * <p>
         * Q = I - &gamma;uu<sup>H</sup>
         * </p>
         * <p>
         * This function finds the values of 'u' and '&gamma;'.
         * </p>
         *
         * @param j Which submatrix to work off of.
         */
        protected void householder(int j)
        {
            // find the element with the largest absolute value in the column and make a copy
            double max = QrHelperFunctions_ZDRM.extractColumnAndMax(QR, j, numRows, j, u, 0);

            if (max <= 0.0)
            {
                gammas[j] = 0;
                error     = true;
            }
            else
            {
                double gamma = QrHelperFunctions_ZDRM.computeTauGammaAndDivide(j, numRows, u, max, tau);
                gammas[j] = gamma;

                // divide u by u_0
                double real_u_0 = u[j * 2] + tau.real;
                double imag_u_0 = u[j * 2 + 1] + tau.imaginary;
                QrHelperFunctions_ZDRM.divideElements(j + 1, numRows, u, 0, real_u_0, imag_u_0);

                // write the reflector into the lower left column of the matrix
                for (int i = j + 1; i < numRows; i++)
                {
                    dataQR[(i * numCols + j) * 2]     = u[i * 2];
                    dataQR[(i * numCols + j) * 2 + 1] = u[i * 2 + 1];
                }

                u[j * 2]     = 1;
                u[j * 2 + 1] = 0;

                QrHelperFunctions_ZDRM.rank1UpdateMultR(QR, u, 0, gamma, j + 1, j, numRows, v);

                // since the first element in the householder vector is known to be 1
                // store the full upper hessenberg
                if (j < numCols)
                {
                    dataQR[(j * numCols + j) * 2]     = -tau.real * max;
                    dataQR[(j * numCols + j) * 2 + 1] = -tau.imaginary * max;
                }
            }
        }