Infinity alias
renatocf opened this issue · 6 comments
Create an Infinity
alias in the same header where Probability
is defined, in order to fully encapsulate floating point types in more meaningful definitions.
Should we have an generic Infinity
type? Because not all infinities are probabilities...
Or maybe it is better a Zero
alias... as -std::numeric_limits<Probability>::infinity()
means p(x)=0.
Hmm... So shouldn't we split our concepts in a Probability
and a LogProbability
types? I think that would be a more accurate description of what we are using through the system. Or, if all our probabilities are standardized in one of them, then we should use the concept of infinite / zero properly.
Anyway, the idea behind this issue is to use a more semantic representation of what our methods are returning. This will have a direct impact in how assertions shall be made in #50.
There is a long time we don't discuss this issue. What do you think about it? Does it worth we have a LogProbability
alias besides the current Probability
class?
I believe my last argument is very reasonable, and I'd like to make this refactoring before going to issue #11. What do you think?
I think we don't need a Probability
type because we only use LogProbabilities
...
Maybe it is better to rename Probability
to LogProbability
and create an Infinity
type.
I think this is a good solution. I'll implement it!