Not sure how to meet the demands of stackoverflow on this one...
I'd like to modify the MathNET Numerics package so that I can use the indexer to access or assign to a sub-matrix as follows:
A[rows, cols]
where rows
and cols
are int[]
I've written an extension method Sub(int[] rows, int[] cols) which achieves the same but it would be smarter to have the indexing manner.
IS it possible to add an extension of the indexer without rebuilding the whole package? If so how?
No, there's no such thing as an "extension indexer" right now. Extension methods are as close as you can get. However, it's entirely possible (but not guaranteed) that they'll come in C# 8. So your options are:
See more on this question at Stackoverflow