I am trying to declare and use XNA Vectors for Matrix Multiplication, Summation, etc. in C#.
Those will be used for Image processing to make it faster than regular SetPixel and GetPixel. However, I am always failing to find a working example and I tried many examples online but it seems I am missing something.
Any help and sample code?
Thanks!
If you are worried about Performance then you can revert to coding in
unsafecontext.By marking a type, type member, or statement block with the unsafe keyword, you’re permitted to use pointer types and perform C++ style pointer operations on memory within that scope, and to be able to do this within the managed execution framework. Unsafe code can run faster than a corresponding safe implementation.
Here is a nice, short example that comes from the book C# 4.0 in a Nutshell:
(Source)
Apart from that you should also take a look at this SO Question
Why is matrix multiplication in .NET so slow?