-
Notifications
You must be signed in to change notification settings - Fork 0
Decomposition truncatedsvdoptions gethashcode
Development build. This page describes
main, not a released package. The latest published Lodestar.Decomposition is 0.3.0 — read its documentation.
Home › Decomposition › Factorization
A hash consistent with the equality, in constant time.
public int GetHashCode()Returns — a hash over the scalars and the length of Ω.
Example — equal options hash alike.
using Lodestar.Decomposition;
TruncatedSvdOptions left = new() { RandomMatrix = [1.0, 2.0], Seed = 3 };
TruncatedSvdOptions right = new() { RandomMatrix = [1.0, 2.0], Seed = 3 };
bool alike = left.GetHashCode() == right.GetHashCode(); // => TrueRemarks — Ω contributes its length, never its values: equal options necessarily agree on the
length, and hashing a features × (components + oversampling) block would make the cheap
operation the expensive one. Unequal options are allowed to collide. An absent Ω contributes -1
rather than 0, so it does not collide with an empty one.
Applies to — net10.0, netstandard2.0.
See also — TruncatedSvdOptions.Equals,
TruncatedSvdOptions.