function deepMap (array, callback, skipZeros) {
  if (!skipZeros) {
    if (isMatrix(array)) {
      return array.map(x => callback(x), false, true)
    } else {
      return arrayDeepMap(array, callback, true)
    }
  }
  const skipZerosCallback = (x) => x === 0 ? x : callback(x)
  if (isMatrix(array)) {
    return array.map(x => skipZerosCallback(x), false, true)
  } else {
    return arrayDeepMap(array, skipZerosCallback, true)
  }
}
Execute the callback function element wise for each element in array and any
nested array
Returns an array with the results
@param {Array | Matrix} array
@param {Function} callback   The callback is called with two parameters:
                             value1 and value2, which contain the current
                             element of both arrays.
@param {boolean} [skipZeros] Invoke callback function for non-zero values only.

@return {Array | Matrix} res