public static DZcss cs_sqr(int order, DZcs A, boolean qr)
	{
		int n, k, post[] ;
		DZcss S ;
		boolean ok = true ;
		if (!CS_CSC(A)) return (null) ;			/* check inputs */
		n = A.n ;
		S = new DZcss() ;				/* allocate result S */
		S.q = cs_amd (order, A) ;			/* fill-reducing ordering */
		if (order > 0 && S.q == null) return (null) ;
		if (qr)						/* QR symbolic analysis */
		{
			DZcs C = order > 0 ? cs_permute (A, null, S.q, false) : A ;
			S.parent = cs_etree (C, true) ;		/* etree of C'*C, where C=A(:,q) */
			post = cs_post (S.parent, n) ;
			S.cp = cs_counts (C, S.parent, post, true) ;  /* col counts chol(C'*C) */
			ok = C != null && S.parent != null && S.cp != null && cs_vcount(C, S) ;
			if (ok) for (S.unz = 0, k = 0 ; k < n ; k++) S.unz += S.cp [k] ;
			ok = ok && S.lnz >= 0 && S.unz >= 0 ;  	/* int overflow guard */
			if (order > 0) C = null ;
		}
		else
		{
			S.unz = 4 * (A.p [n]) + n ;		/* for LU factorization only, */
			S.lnz = S.unz ;				/* guess nnz(L) and nnz(U) */
		}
		return (ok ? S : null) ;			/* return result S */
	}
public static DZcss cs_sqr ( int order , DZcs A , boolean qr ) { int n , k , post [ ] ; DZcss S ; boolean ok = true ; if ( ! CS_CSC ( A ) ) return ( null ) ; n = A . n ; S = new DZcss ( ) ; S . q = cs_amd ( order , A ) ; if ( order > 0 && S . q == null ) return ( null ) ; if ( qr ) { DZcs C = order > 0 ? cs_permute ( A , null , S . q , false ) : A ; S . parent = cs_etree ( C , true ) ; post = cs_post ( S . parent , n ) ; S . cp = cs_counts ( C , S . parent , post , true ) ; ok = C != null && S . parent != null && S . cp != null && cs_vcount ( C , S ) ; if ( ok ) for ( S . unz = 0 , k = 0 ; k < n ; k ++ ) S . unz += S . cp [ k ] ; ok = ok && S . lnz >= 0 && S . unz >= 0 ; if ( order > 0 ) C = null ; } else { S . unz = 4 * ( A . p [ n ] ) + n ; S . lnz = S . unz ; } return ( ok ? S : null ) ; }
Symbolic QR or LU ordering and analysis.

@param order
ordering method to use (0 to 3)
@param A
column-compressed matrix
@param qr
analyze for QR if true or LU if false
@return symbolic analysis for QR or LU, null on error