title: How to access on Vector components when we don't know in advance its dimension
body: <p>For a two dimension vector i use this snippet, but if i don't know in advance the number of dimension of vector, how can i adapt my code ?</p>
  
  <pre><code>var vect = Vectors.dense(0,0)
  var rdd_vects = sc.parallelize(Array(vect,vect,...))
  
  var sum = rdd_vects.reduce( case (x,y) =&gt; Vectors.dense(x(0)+y(0),x(1)+y(1))  )
  </code></pre>
  
  <p>Thank you for your advices</p>