class LUDecomposition implements AutoCloseable {

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

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

            for (int i = 0; i < m; ++i)
                cachedP.setX(i, (int)pivot.get(i), 1.0);
        }

        return cachedP;
    }

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

}