Hi,
I am looking into alternate ways to do a Matrix Multiplication. Instead of storing my matrix as a two-dimensional array, I am using a vector such as
vector<pair<pair<int,int >,int > >
to store my matrix. The pair within my pair (pair) stores my indices (i,j) and the other int stores the value for the given (i,j) pair. I thought I might have some luck implementing my sparse array this way.
The problem is when I try to multiply this matrix with itself.
If this was a 2-d array implementation, I would have multiplied the matrix as follows:
for(i=0; i<row1; i++)
{
for(j=0; j<col1; j++)
{
C[i][j] = 0;
for(k=0; k<col2; k++)
C[i][j] += A[i][j] * A[j][k];
}
}
Can somebody point out a way to achieve the same result using my vector of 'pair of pairs'?
Thanks