Skip to content

Survival coxbaseline gethashcode

github-actions[bot] edited this page Sep 26, 2026 · 1 revision

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

CoxBaseline.GetHashCode

A hash consistent with the equality, in constant time.

public int GetHashCode()

Returns — a hash over the stratum label and the number of times.

Example — equal baselines hash alike.

using Lodestar.Survival;

CoxBaseline left = new(1, [1.0, 2.0], [0.1, 0.2], [0.1, 0.3], [0.9, 0.74]);
CoxBaseline right = new(1, [1.0, 2.0], [0.1, 0.2], [0.1, 0.3], [0.9, 0.74]);

bool alike = left.GetHashCode() == right.GetHashCode();  // => True

Remarks — the four arrays share one index, so the time count stands for all of them; unequal baselines may collide.

Applies to — net10.0, netstandard2.0.

See also — CoxBaseline.Equals, CoxBaseline.

Clone this wiki locally