function _createTargetMatrix(order, a, m, n, dense) {
    // compute A'
    var at = transpose(a); // check order = 1, matrix must be square

    if (order === 1 && n === m) {
      // C = A + A'
      return add(a, at);
    } // check order = 2, drop dense columns from M'


    if (order === 2) {
      // transpose arrays
      var tindex = at._index;
      var tptr = at._ptr; // new column index

      var p2 = 0; // loop A' columns (rows)

      for (var j = 0; j < m; j++) {
        // column j of AT starts here
        var p = tptr[j]; // new column j starts here

        tptr[j] = p2; // skip dense col j

        if (tptr[j + 1] - p > dense) {
          continue;
        } // map rows in column j of A


        for (var p1 = tptr[j + 1]; p < p1; p++) {
          tindex[p2++] = tindex[p];
        }
      } // finalize AT


      tptr[m] = p2; // recreate A from new transpose matrix

      a = transpose(at); // use A' * A

      return multiply(at, a);
    } // use A' * A, square or rectangular matrix


    return multiply(at, a);
  }
Creates the matrix that will be used by the approximate minimum degree ordering algorithm. The function accepts the matrix M as input and returns a permutation
vector P. The amd algorithm operates on a symmetrix matrix, so one of three symmetric matrices is formed.

Order: 0
  A natural ordering P=null matrix is returned.

Order: 1
  Matrix must be square. This is appropriate for a Cholesky or LU factorization.
  P = M + M'

Order: 2
  Dense columns from M' are dropped, M recreated from M'. This is appropriatefor LU factorization of unsymmetric matrices.
  P = M' * M

Order: 3
  This is best used for QR factorization or LU factorization is matrix M has no dense rows. A dense row is a row with more than 10*sqr(columns) entries.
  P = M' * M