title: How to copy a boost::numeric::ublas::vector to a matrix?
body: <p>What am I doing wrong here?</p>
  
  <pre><code>// file main.cpp
  
  #include &lt;iostream&gt;
  #include &lt;boost/numeric/ublas/vector.hpp&gt;
  #include &lt;boost/numeric/ublas/matrix.hpp&gt;
  #include &lt;boost/numeric/ublas/matrix_proxy.hpp&gt;
  
  namespace ublas = boost::numeric::ublas;
  
  int main()
  {
      ublas::vector&lt;double&gt; const v( 10 );
      ublas::matrix&lt;double&gt; m( 1, v.size() );
      ublas::matrix_row&lt;ublas::matrix&lt;double&gt; &gt; r( m, 1 );
      r = v;
      return 0;
  }
  </code></pre>
  
  <p>This fails with message:</p>
  
  <pre><code>Check failed in file /usr/local/include/boost/numeric/ublas/functional.hpp at line 1370:
  i &lt; size_i
  terminate called after throwing an instance of 'boost::numeric::ublas::bad_index'
    what():  bad index
  Aborted
  </code></pre>
  
  <p>However, is there more laconic way to <code>v</code> into <code>m</code> at <code>main.cpp</code>?</p>