scanning one matrix over another matrix

From: seia0106 (miahmed67_at_yahoo.com)
Date: 03/08/04


Date: 8 Mar 2004 10:22:46 -0800

Hello everyone,
I am trying to write a function using For loops that should make one
matrix slide over another bigger matrix and calculate scalar product
in each step. For example here are the two matrices
int A[5][5]={{1,2,3,4,5},{6,7,8,9,10},{11,12,13,14,15},{16,17,18,19,20},{21,22,23,24,25}};
int B[3][3] = {{1,2,3},{4,5,6},{7,8,9}};

What i want is to put matrix B on top of Matrix A(starting top left),
calculate scalar product of B and that portion(3x3) of A that lies
under B, then move one column right , again calculate scalar product
and repeat this process till last column and then do the same with
row 2.
What i am fiding difficult is how to write the For loops for this kind
of operation.
Can anyone please kindly provide some help in solving this problem. It
may sound easy to many of you but is causing difficulty to me.
Thanks in advance.



Relevant Pages