Bounds with BinSize 0

Hey All

I am not sure if this is expected behavior… it is not what I would expect intuitively.

If I use Bounds (Spectral) with Bin Size 0 I get an output with center 0, width close to 0 but not quite and min as maxfloat and max as minfloat.

I would expect that either 0 was outputted in all outputs or better yet nothing.

see attached patch

I have often before found a behavior being unexpected but then having it explained to me as expected… is this another such case?

-sunep

bounds_binsize_zero.v4p (4.2 kB)

hi sune

i would like to argue that this is just again such a more or less expected behaviour. for God’s sake we have nothing like empty slices in vvvv; there are only empty spreads. your example patch shows that an empty spread however wouldn’t be an option here, since only one output slice represents that operation on zero input slices.

so we need some ouput values, that somehow reflect that no operations on input slices have been performed. however in the best case we wouldn’t need to handle this as an extra case, but only as a natural result.

most spread operation nodes work like that:

  • on each bin:
    ** initialize some accumulating variable
    ** loop over all input slices in this bin:
    *** operate on accumulated value and current input slice
    ** output slice: accumulating value

so binsize 0 means that no operations on input slices are performed, but only some initialization.

initialization for different operators:

  • multiply: 1.0
  • add: 0.0
  • min: +INF
  • max: -INF

min and max are not available as extra nodes, but they work that way within the bounds node.

Center should then be 0 (in the middle between min and max) and width should be (max-min). i would have expected +INF or -INF, but i’m ok with -6*10^300 (“near” to -INF).

i just was informed that the middle between -INF and +INF is probably not defined (mathematically). so Center should be NAN(?), maybe also the Width(?)