Survival survivalcurve gethashcode - CyrilB1531/lodestar GitHub Wiki
Development build. This page describes
main, not a released package. The latest published Lodestar.Survival is 0.2.0 — read its documentation.
Home › Survival › Survival estimators
SurvivalCurve.GetHashCode
A hash consistent with the equality, in constant time.
public int GetHashCode()
Returns — a hash over the confidence level and the number of steps.
Example — equal curves hash alike.
using Lodestar.Survival;
SurvivalCurve left = BreslowFlemingHarrington.Estimate([1, 2, 3], [true, false, true]);
SurvivalCurve right = BreslowFlemingHarrington.Estimate([1, 2, 3], [true, false, true]);
bool alike = left.GetHashCode() == right.GetHashCode(); // => True
Remarks — the four arrays share one index, so the step count stands for all of them. A curve can hold thousands of steps, which is the walk this avoids; unequal curves may collide.
Applies to — net10.0, netstandard2.0.
See also — SurvivalCurve.Equals, SurvivalCurve.