Skip to content

Instantly share code, notes, and snippets.

@engie
Created April 21, 2012 19:39
Show Gist options
  • Save engie/2439256 to your computer and use it in GitHub Desktop.
Save engie/2439256 to your computer and use it in GitHub Desktop.
Pointer Matrix*Vector implementation
const double* b_p = &(B.data()[0]);
double* w_p = &(W.data()[0]);
uint32 rows = B.size1();
uint32 cols = B.size2();
for( uint32 i = 0; i < rows; i++ ) //For each row
{
myX[i] = 0;
double* w_p_row = w_p;
for( uint32 j = 0; j < cols; j++ ) //For each col
{
myX[i] += *(b_p++) * *(w_p_row++);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment