title: regarding element-by-element operations in boost::ublas
body: <p>I find that boost::ublas doesn't support element-by-element operations and operations in sequence very well (but the efficiency is pretty high :))
  I am trying to </p>
  
  <p>D = A^2 .* B^3 .* C</p>
  
  <p>where A, B, C are all square matrices of the same size, operator ".*" denotes the element-by-element operation and ^ is the power of the matrix. With boost:ublas, I wrote</p>
  
  <pre><code>for (int n=0; n&lt;300; n++)
  {
    for (int k=0; k&lt;300; k++)
    {
      D(n, k) = pow(abs(A(n, k)), 2)*pow(abs(B(n, k)), 3)*C(n, k);
    }
  }
  </code></pre>
  
  <p>In my program I have many sequent operations like those shown above, anyway I can get the same result but using one line of code instead of loop?</p>
  
  <p>Also, I observe that it seems no valid to assign a constant to all elements of matrix or vector like</p>
  
  <p>boost::numeric::ublas::vector v(100);
     v = 0.2;</p>
  
  <p>Instead, I have to use a loop to do the assignment again, any better way to save some code? My algorithm is a really long and there are so many tedious operations like those stated above. I tried another numerical library Armadillo, which provides a good way to simply the operations but it currently doesn't suppose sparse matrices (which will spend about 10 times in running my code).</p>