Description
Currently the library's open methods on matrices do not easily conform to a single unified interface very well.
The At(row, col) -> n function is the only function (save me being blind) that is commonly implemented across all matrix implementations.
I propose that all matrix implementations implement a common interface;
interface {
At(row, col int) float32 | float64
NumRows() int
NumCols() int
}
I personally like the garbage-in garbage-out approach from implementations of .At in this library, but I do feel that all matrices should also provide .NumRows() and .NumCols() like MatMxN does, or some equivalent.
In the case of generalized methods that can operate on matrices of varying dimensions, this would allow one to implement methods that can operate on all matrix implementations in this library using an interface, avoiding the need to duplicate functions or type-switch to find the dimensions of a matrix.
Activity