Closed Make42 closed 5 years ago
combining them has come up many times before, and if I had the time and inclination, i would probably replace Breeze's algebra typeclasses with Spire's. But to answer your question, yes, you will lose a lot of performance if you use anything other than floats or doubles. Ints are reasonably fast, but they're backed by java/scala code, not by fortran or native code.
I use breeze's collections (namely
DenseVector
), in which I have integers and doubles and the like, and use them a little like you might use numpy's arrays. I stumbled upon https://github.com/non/spire. My impression is, it is not so strong on collection, but stronger on types that I might want to put inside of collections - e.g.Interval
sounds awesome. Is my impression right and would be combining them a good idea?From https://stackoverflow.com/a/40474914/4533188 I learned that Breeze uses netlib-java to be really fast. Would I destroy that speed if I put descendants of
AnyRef
(in this case from Spire) into theDenseVector
s back-end Arrays instead of descendants ofAnyVal
?