/**
         * <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
         * overfloaw and underflow.
         * </p>
         * <p>
         * Q = I - &gamma;uu<sup>T</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)
        {
            double[] u = dataQR[j];

            // find the largest value in this column
            // this is used to normalize the column and mitigate overflow/underflow
            double max = QrHelperFunctions_ZDRM.findMax(u, j, numRows - j);

            if (max == 0.0)
            {
                gamma = 0;
                error = true;
            }
            else
            {
                // computes tau and gamma, and normalizes u by max
                gamma = QrHelperFunctions_ZDRM.computeTauGammaAndDivide(j, numRows, u, max, tau);

                // divide u by u_0
//            double u_0 = u[j] + tau;
                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);

                tau.real      *= max;
                tau.imaginary *= max;

                u[j * 2]     = -tau.real;
                u[j * 2 + 1] = -tau.imaginary;
            }

            gammas[j] = gamma;
        }
        /**
         * <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)
        {
            int startQR = j * numRows;
            int endQR   = startQR + numRows;

            startQR += j;

            double max = QrHelperFunctions_ZDRM.findMax(QR.data, startQR, numRows - j);

            if (max == 0.0)
            {
                gamma = 0;
                error = true;
            }
            else
            {
                // computes tau and normalizes u by max
                gamma = QrHelperFunctions_ZDRM.computeTauGammaAndDivide(startQR, endQR, QR.data, max, tau);

                // divide u by u_0
                double realU0 = QR.data[startQR * 2] + tau.real;
                double imagU0 = QR.data[startQR * 2 + 1] + tau.imaginary;

                QrHelperFunctions_ZDRM.divideElements(startQR + 1, endQR, QR.data, 0, realU0, imagU0);

                tau.real      *= max;
                tau.imaginary *= max;

                QR.data[startQR * 2]     = -tau.real;
                QR.data[startQR * 2 + 1] = -tau.imaginary;
            }

            gammas[j] = gamma;
        }