csSqr = function csSqr(order, a, qr) {
    // a arrays
    var aptr = a._ptr;
    var asize = a._size; // columns

    var n = asize[1]; // vars

    var k; // symbolic analysis result

    var s = {}; // fill-reducing ordering

    s.q = csAmd(order, a); // validate results

    if (order && !s.q) {
      return null;
    } // QR symbolic analysis


    if (qr) {
      // apply permutations if needed
      var c = order ? csPermute(a, null, s.q, 0) : a; // etree of C'*C, where C=A(:,q)

      s.parent = csEtree(c, 1); // post order elimination tree

      var post = csPost(s.parent, n); // col counts chol(C'*C)

      s.cp = csCounts(c, s.parent, post, 1); // check we have everything needed to calculate number of nonzero elements

      if (c && s.parent && s.cp && _vcount(c, s)) {
        // calculate number of nonzero elements
        for (s.unz = 0, k = 0; k < n; k++) {
          s.unz += s.cp[k];
        }
      }
    } else {
      // for LU factorization only, guess nnz(L) and nnz(U)
      s.unz = 4 * aptr[n] + n;
      s.lnz = s.unz;
    } // return result S


    return s;
  }
Symbolic ordering and analysis for QR and LU decompositions.

@param {Number}  order           The ordering strategy (see csAmd for more details)
@param {Matrix}  a               The A matrix
@param {boolean} qr              Symbolic ordering and analysis for QR decomposition (true) or
                                 symbolic ordering and analysis for LU decomposition (false)

@return {Object}                 The Symbolic ordering and analysis for matrix A

Reference: http://faculty.cse.tamu.edu/davis/publications.html