Hmm, it would be good, but... do you have any idea how to implement dot product in C#, so it will work with both 1- and 2-dimensional rectangular arrays?
The problem is that in C++ you can just get pointer to a matrix row and pass it to the vdotproduct. And if you want to work with column, you can pass pointer to column with non-unit stride (step) equal to N. So you can handle both matrices and vectors within one function. But you can't do such things in C#. The only solution is to have many overloaded versions of vdotproduct: vdotproduct(array[,],array[]), vdotproduct(array[],array[]), ... And many overloads for other functions. Another solution is to use pointers (C# supports them), but it will make ALGLIB code unsafe.
Do you have any idea how to solve this issue? It is not rhetoric question :) I'd be glad to hear any suggestions.
|