With the Apache common math library I get back a primitive double array.
RealMatrix pInverse = new LUDecomposition(p).getSolver().getInverse();
double[][] temp = pInverse.getData();
I need to convert temp to a Double[][]
Double[][] inverse = new Double[][]temp;