title: element-wise operations with boost c++ ublas matrix and vector types
body: <p>i'd like to perform element-wise functions on boost matrix and vector types, e.g. take the logarithm of each element, exponentiate each element, apply special functions, such as gamma and digamma, etc. (similar to matlab's treatment of these functions applied to matrices and vectors.)</p>
  
  <p>i suppose writing a helper function that brute-forced this for each desired function would suffice, but this seems wasteful.</p>
  
  <p>likewise, the boost wiki offers some code to <a href="http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Examples_-_How_To_Extend_UBLAS" rel="nofollow noreferrer">vectorize standard functions</a>, but this seems quite complex.</p>
  
  <p>valarray has been suggested, but i'd like to avoid converting between data types, as i need the ublas data types for other operations (matrix products, sparse matrices, etc.)</p>
  
  <p>any help is greatly appreciated.</p>