 main () {
    using namespace boost::numeric::ublas;
    vector&lt;double&gt; v (3);
    for (unsigned i = 0; i &lt; v.size (); ++ i)
        v (i) = i;

    std::cout &lt;&lt; 2.0 * v &lt;&lt; std::endl;
    std::cout &lt;&lt; v * 2.0 &lt;&lt; std::endl;
}
</pre>
<h2><a name="vector_reductions"></a>Vector Reductions</h2>
<h3>Unary Reductions</h3>
<h4>Prototypes</h4>
<pre>
<code>template&lt;class E, class F&gt;
    struct vector_scalar_unary_traits {
         typedef typename F::result_type result_type;
  