Skip to content

Instantly share code, notes, and snippets.

@engie
Created April 21, 2012 19:35
Show Gist options
  • Save engie/2439238 to your computer and use it in GitHub Desktop.
Save engie/2439238 to your computer and use it in GitHub Desktop.
Initial matrix*vector implementation
//B is a uBLAS matrix
//W is a uBLAS vector
//myX is the output
for( uint32 i = 0; i < B.size1(); i++ ) //For each row
{
myX[i] = 0;
for( uint32 j = 0; j < B.size2(); j++ ) //For each col
{
myX[i] += B(i, j) * W(j);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment