Boost logo

Boost :

Subject: Re: [boost] Formal Review of Proposed Boost.Histogram Library Starts TODAY
From: a.hagen-zanker_at_[hidden]
Date: 2018-09-26 17:01:43


>Histogram uses a generalized bin concept, where a single bin can represent a single value on an axis or a domain of values.

That is exactly why a generic member function called value() makes no sense to me. It is not a given that the bin has a single value.

> When you have an category axis that represents the sequence "red", "green", "blue", then what's the domain for the bin "red"?

Well that would just consist of be the value "red" wouldn't it. Somehow we're talking past each other. I am perfectly fine with a bin consisting of a single value. But in the general case you cannot expect bins to have a single value. Maybe you never intended that. However, I then think your example 2 could be better chosen. I assumed this to demonstrate general behaviour.

> Why is it illogical that a bin knows its own index?

Because the axis already maps indices to bin types. It is not necessary for the bin to know it, and bins can be a lot simpler if they don't need to know their number.

>The library is not forcing you to define your own bins in this way.

The library isn't forcing me to do anything, but if I want to use it, I have to conform to its concepts, right.?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk