Created
April 21, 2012 19:39
-
-
Save engie/2439256 to your computer and use it in GitHub Desktop.
Pointer Matrix*Vector implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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