for (i = 0; i < N; i++)
{
result[i] = 0;
for ( j=RowIndex[i]; j<RowIndex[i + 1]; j++)
{
if (i == col[j])
result[i] += val[j] * vector[col[j]];
else
{
result[i] += val[j] * vector[col[j]];
result[col[j]] += val[j] * vector[i];
}
}
}