function _coerceArr (arr) {
    // row matrix
    if (arr.length === 1) return arr[0]

    // column matrix
    if (arr.length > 1 && Array.isArray(arr[0])) {
      if (arr.every(el => Array.isArray(el) && el.length === 1)) return flatten(arr)
    }

    return arr
  }
Coerce row and column 2-dim arrays to 1-dim array