Replace Matrix class with LUDecomposition from Apache Commons