public DMatrixRMaj getT(DMatrixRMaj T)
        {
            // write the values to T
            if (lower)
            {
                T = UtilDecompositons_DDRM.checkZerosUT(T, n, n);
                for (int i = 0; i < n; i++)
                {
                    for (int j = 0; j <= i; j++)
                    {
                        T.unsafe_set(i, j, this.T.unsafe_get(i, j));
                    }
                }
            }
            else
            {
                T = UtilDecompositons_DDRM.checkZerosLT(T, n, n);
                for (int i = 0; i < n; i++)
                {
                    for (int j = i; j < n; j++)
                    {
                        T.unsafe_set(i, j, this.T.unsafe_get(i, j));
                    }
                }
            }

            return(T);
        }
        public DMatrixRMaj getLower(DMatrixRMaj lower)
        {
            int numRows = LU.numRows;
            int numCols = LU.numRows < LU.numCols ? LU.numRows : LU.numCols;

            lower = UtilDecompositons_DDRM.checkZerosUT(lower, numRows, numCols);

            for (int i = 0; i < numCols; i++)
            {
                lower.unsafe_set(i, i, 1.0);

                for (int j = 0; j < i; j++)
                {
                    lower.unsafe_set(i, j, LU.unsafe_get(i, j));
                }
            }

            if (numRows > numCols)
            {
                for (int i = numCols; i < numRows; i++)
                {
                    for (int j = 0; j < numCols; j++)
                    {
                        lower.unsafe_set(i, j, LU.unsafe_get(i, j));
                    }
                }
            }
            return(lower);
        }