Closed miniksa closed 4 months ago
If you want me to add more overloads elsewhere or otherwise deduplicate this somehow... let me know. I intentionally tried to keep this scoped as narrow as possible until hearing from you.
@Austin-Lamb, my co-worker, suggests that I should use names on the parts of the ValueTuple so it's less ugly than Item1, Item2, etc.
Thanks!
The method parameters should also be documented in the public CompressedColumnStorage
class.
Leaving the original conversion method for enumerables of Tuple
in place is fine.
I was wondering whether the IEnumerable<Tuple<int, int, T>> EnumerateIndexed()
method of the Matrix
class should also use ValueTuple
. What do you think? It affects the public API, but the change is small, so maybe no need to increment the major version.
Thanks!
The method parameters should also be documented in the public
CompressedColumnStorage
class.Leaving the original conversion method for enumerables of
Tuple
in place is fine.I was wondering whether the
IEnumerable<Tuple<int, int, T>> EnumerateIndexed()
method of theMatrix
class should also useValueTuple
. What do you think? It affects the public API, but the change is small, so maybe no need to increment the major version.
Yeah I thought about that, but I didn't want to change the public API. I almost thought of making EnumerateIndexedAsValueTuples()
or something just to not break anyone.... but that depends what you prefer.
I know that it would increase the performance for when it's used in the FromMatrix()
method and I could link that up without all those temporary allocations.
Try this on, @wo80. I made a separate abstract method and implemented that one in both the Compressed and Dense matrix classes, then used it in the .OfMatrix helper. Happy to keep iterating if you want me to just replace the old one. I'm just normally allergic to public API breaking changes.
I'm just normally allergic to public API breaking changes.
I fully agree. Version 4 was just published, and I don't want to release a new major version with such a minor change, so let's leave it this way.
I'll add a TODO
comment to replace the old method and hopefully will remember when version 5 is released ... in 10 years or so 😁
When working with this package, I wanted to use ValueTuple over classic Tuple to avoid the heap allocation that occurs on every single Tuple (improving performance).