Hacker News new | ask | show | jobs
by aklein 4819 days ago
Depends what you mean by sparse vector support. Maybe what you're interested in is best served by Series:

  val s = Series(Vec(1,2,3), Index(0,5,10))
This gives you

  s: org.saddle.Series[Int, Int] = 
  [3 x 1]
  0  -> 1
  5  -> 2
  10 -> 3
Then, for instance,

  s(5,10)
  res0: org.saddle.Series[Int,Int] =
  [2 x 1]
  5  -> 2
  10 -> 3
1 comments

For me at least, sparse vector support means you can do elementwise operations (on the non-sparse elements) and in particular linear algebra like vector dot-products and matrix-vector multiply.