title: How to perform element-wise scalar operations on a vector with Scala Breeze?
body: <p>With Scalala it was possible to perform element-wise operations on a Vector using a scalar operand.  Say you have a Vector of random numbers between 0 and 1 and you want to subtract each value from 1:</p>
  
  <pre><code>import breeze.linalg._
  
  val x = DenseVector.rand(5)
  val y = 1d :- x  //DOESN'T COMPILE: "value :- is not a member of Double"
  </code></pre>
  
  <p>Unlike Scalala, Breeze fails to compile with this approach.  You can work around this by generating a Vector of ones but it just seems like there should be a better way.</p>
  
  <pre><code>val y = DenseVector.ones[Double](x.size) :- x
  </code></pre>
  
  <p>Another workaround would be to use the mapValues method which is a bit more readable:</p>
  
  <pre><code>val y = x mapValues { 1 - _ }
  </code></pre>
  
  <p>What is the proper way to accomplish this with Breeze?</p>