title: Boost uBLAS matrix/vector product
body: <p>can someone please provide an example of how to use uBLAS product to multiply things?  Or if there's a nicer C++ matrix library you can recommend I'd welcome that too.  This is turning into one major headache.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>vector&lt;double&gt; myVec(scalar_vector&lt;double&gt;(3));
  matrix&lt;double&gt; myMat(scalar_matrix&lt;double&gt;(3,3,1));
  matrix&lt;double&gt; temp = prod(myVec, myMat);
  </code></pre>
  
  <p>Here's the error:</p>
  
  <pre><code>cannot convert from 'boost::numeric::ublas::matrix_vector_binary1&lt;E1,E2,F&gt;' to 'boost::numeric::ublas::matrix&lt;T&gt;'
  </code></pre>
  
  <p>I have exhausted my search.  Stackoverflow has a question about this <a href="https://stackoverflow.com/questions/2079602/ublas-matrix-expression-tutorial-examples">here</a>.  Boost documentation has an example <a href="http://www.boost.org/doc/libs/1_46_1/libs/numeric/ublas/doc/matrix_expression.htm#matrix_operations" rel="nofollow noreferrer">here</a>.
  I've copied the code from example, but it's of no use to me because the template magic that works for stdout is useless to me.</p>
  
  <pre><code>#include &lt;boost/numeric/ublas/matrix.hpp&gt;
  #include &lt;boost/numeric/ublas/io.hpp&gt;
  
  int main () {
      using namespace boost::numeric::ublas;
      matrix&lt;double&gt; m (3, 3);
      vector&lt;double&gt; v (3);
      for (unsigned i = 0; i &lt; std::min (m.size1 (), v.size ()); ++ i) {
          for (unsigned j = 0; j &lt; m.size2 (); ++ j)
              m (i, j) = 3 * i + j;
          v (i) = i;
      }
  
      std::cout &lt;&lt; prod (m, v) &lt;&lt; std::endl;
      std::cout &lt;&lt; prod (v, m) &lt;&lt; std::endl;
  }
  </code></pre>