scalala / Scalala

Scalala has been superseded by dlwh/breeze. Scalala is a high performance numeric linear algebra library for Scala, with rich Matlab-like operators on vectors and matrices; a library of numerical routines; support for plotting.
http://groups.google.com/group/scalala
GNU Lesser General Public License v2.1
298 stars 30 forks source link

remove sealed from trait DefaultArrayValue #55

Open amato-gianluca opened 12 years ago

amato-gianluca commented 12 years ago

Hi, I need to extend scalala to work with class BigDecimal. I implemented an implicit object for Scalar[BigDecimal] and a lot of implicit objects for the different operators, but since the trait DefaultArrayValue is sealed, I cannot define an object of class DefaultArrayValue without changing the scalala source code. Why is this trait sealed? Wouldn't be better to make it non-sealed?

dlwh commented 12 years ago

Happy to accept a patch on this one. DanR was historically opposed, but I don't really care. Add a note that the value must be logically "zero" or you'll run into trouble with what the operators expect, if you would.

-- David

On Fri, May 25, 2012 at 1:26 PM, Gianluca Amato reply@reply.github.com wrote:

Hi, I need to extend scalala to work with class BigDecimal. I implemented an implicit object for Scalar[BigDecimal] and a lot of implicit objects for the different operators, but since the trait DefaultArrayValue is sealed, I cannot define an object of class  DefaultArrayValue without changing the scalala source code. Why is this trait sealed? Wouldn't be better to make it non-sealed?


Reply to this email directly or view it on GitHub: https://github.com/scalala/Scalala/issues/55

amato-gianluca commented 12 years ago

The comment on the trait DefaultArrayValue says that "this value must be null for all references types in order for SparseArray to work as expected". So, I am not sure anymore it is safe to override the default null value for BigDecimal. I'll do some experiments.