class LUDecomposition implements AutoCloseable {

    public Matrix getU() {
        if ((cachedU == null) && !singular) {
            final int m = pivot.size();

            cachedU = like(matrix);
            cachedU.assign(0.0);

            for (int i = 0; i < m; ++i)
                for (int j = i; j < m; ++j)
                    cachedU.setX(i, j, lu.getX(i, j));
        }

        return cachedU;
    }

    public  LUDecomposition(Matrix matrix);
    public  LUDecomposition(Matrix matrix, double singularityThreshold);

}