I'm trying to implement simple sliding window alogirithm on two-dimensional array in C# 3.0, I found this as very useful but it involves only single-dimensioal array.
The post also includes the code for the algo, I'm totaly failed to use it for my senario... can any one suggest me how do I proceed?
Scenario:
http://parasu516.googlepages.com/matrix.jpg http://parasu516.googlepages.com/matrix.jpg
The above image is 10X10 matrix and need get 3X3 matrix out it, using any algorithm (Sliding window would be greate). Red rectangle is a first set and green one is the second. and it goes on till the end for all rows
PS: I googled about the algo, but no luck :(
Naive implementation:
Helper method to copy between two-dimensional arrays:
Test main:
Output:
Now all you have to do is apply the same technique as shown in that blog post :)