* partial pivoting threshold (1 for partial pivoting)
* @return numeric LU factorization, null on error
*/
public static Scsn cs_lu(Scs A, Scss S, float tol) {
Scs L, U;
Scsn N;
float pivot, Lx[], Ux[], x[], a, t;
int Lp[], Li[], Up[], Ui[], pinv[], xi[], q[], n, ipiv, k, top, p, i, col, lnz, unz;
if (!Scs_util.CS_CSC(A) || S == null)
return (null); /* check inputs */
n = A.n;
q = S.q;
lnz = S.lnz;
unz = S.unz;
x = new float[n]; /* get float workspace */
xi = new int[2 * n]; /* get int workspace */
N = new Scsn(); /* allocate result */
N.L = L = Scs_util.cs_spalloc(n, n, lnz, true, false); /* allocate result L */
N.U = U = Scs_util.cs_spalloc(n, n, unz, true, false); /* allocate result U */
N.pinv = pinv = new int[n]; /* allocate result pinv */
Lp = L.p;
Up = U.p;