title: Is there a functionality in C++ to create a block matrix as simple as Python's `numpy.bmat`?
body: <p>Is there a functionality in C++ to create a block matrix as simple as <a href="https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.bmat.html" rel="nofollow noreferrer">numpy.bmat</a>?</p>
  
  <p>Example:</p>
  
  <p><em>Python</em>:</p>
  
  <pre><code>m = np.bmat([[A, B], [C, D]])
  </code></pre>
  
  <p><em>C++</em> The only approach I know of is using <a href="http://www.boost.org/doc/libs/1_66_0/libs/numeric/ublas/doc/operations_overview.html" rel="nofollow noreferrer">boost::numeric::ublas::project</a>:</p>
  
  <pre><code>#include &lt;boost/numeric/ublas/matrix.hpp&gt;
  
  boost::numeric::ublas::matrix m;
  
  //...
  
  r1 = boost::numeric::ublas::range(i1, i2);
  r2 = boost::numeric::ublas::range(i3, i4);
  boost::numeric::ublas::project(m, r1, r2) = A;
  
  // repeat code above for other submatrices, each time calculating the appropriate indices
  </code></pre>