scalanlp / breeze

Breeze is/was a numerical processing library for Scala.
https://www.scalanlp.org
Apache License 2.0
3.45k stars 693 forks source link

Should a trait be used instead of DenseMatrix / DenseVector? #775

Closed aliakhtar closed 4 years ago

aliakhtar commented 4 years ago

I find myself using the concrete classes DenseMatrix / DenseVector a lot. Is there a trait I should use instead so I can switch out the implementation to HashVector / SparseVector in future if needed?

I tried using VectorLike but it takes in a lot of type params.

dlwh commented 4 years ago

There's Vector and Matrix, but I don't recommend using them unless you're pretty sure you're going to want the genericness. It slows things down.

On Tue, Mar 10, 2020 at 12:54 PM Ali Akhtar notifications@github.com wrote:

I find myself using the concrete classes DenseMatrix / DenseVector a lot. Is there a trait I should use instead so I can switch out the implementation to HashVector / SparseVector in future if needed?

I tried using VectorLike but it takes in a lot of type params.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/scalanlp/breeze/issues/775?email_source=notifications&email_token=AAACLIO6HB5A5DF6OQU5ACLRG2LGDA5CNFSM4LFGXVF2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IUAEVTQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAACLIJVCEDTYUQCIYVAAVLRG2LGDANCNFSM4LFGXVFQ .

aliakhtar commented 4 years ago

You mean slow performance wise? Or just slower to code?

dlwh commented 4 years ago

sorry missed this. slow in both senses.