Uses matrix outer product to determine all pair-wise differences in `attr` for the horizons of `p`. Supplies `attr` to `threshold.fun` to determine the minimum value criterion to return TRUE in output matrix for an "increase". Also, computes all pair-wise distances in depth dimension to determine whether the vertical distance criteria have been met simultaneously with `attr` increase.
This function assumes that the `threshold.fun` supplied by the user returns either a constant or a vector of equal length to its input.
Note that the `threshold.fun` result is allowed to contain NA, but that will result in no output for affected cells.
get.increase.depths
performs the conversion of the square matrix output of get.increase.matrix
back to horizon top depth for where criteria were met.