The same vectors return different hashCodes, for example:
final vec1 = Vector.column([1, 2, 3]);
final vec2 = Vector.column([1, 2, 3]);
print('Hash codes are equal: ${vec1.hashCode == vec2.hashCode}');
// This prints: Hash codes are equal: false
To work around this, I have added a function that calculates the hashCode using quiver's hashObjects function:
HashSet<Vector> createVectorSet(Iterable<Vector> vectors) =>
HashSet<Vector>(
equals: (vec1, vec2) => vec1 == vec2,
hashCode: (vec) => hashObjects(vec.toList()),
)
..addAll(vectors);
This fixes the problem and I now can use Vectors in sets. I hope this can be fixed in a future version, computing the union and intersection of Vector sets should work without any fuss.