-
Notifications
You must be signed in to change notification settings - Fork 0
Fuzzy scorematrix gethashcode
Development build. This page describes
main, not a released package. The latest published Lodestar.Fuzzy is 0.4.0 — read its documentation.
Home › Fuzzy › Fuzzy matching
The shape's hash.
public int GetHashCode()Returns — a hash combining Rows and Columns.
Example — the same handle hashes the same.
using Lodestar.Fuzzy;
ScoreMatrix scores = Process.Cdist(["new york"], ["new york mets", "boston red sox"]);
ScoreMatrix sameHandle = scores;
bool agree = scores.GetHashCode() == sameHandle.GetHashCode(); // => TrueRemarks — the shape alone, on purpose. Two matrices of the same shape collide, which costs a
hash bucket and never a wrong answer:
Equals settles it on the storage. Hashing the cells would walk the
whole matrix to place it in a dictionary, which is work a caller of this type is not asking for.
Hand-rolled rather than HashCode.Combine, which netstandard2.0 does not carry and no polyfill
in this repository supplies.
Applies to — net10.0, netstandard2.0.
See also — ScoreMatrix, ScoreMatrix.Equals.