F
François Grondin
Hi everyone
Does anyone has an explanation why one can't define a list of numbers using
generics AND basic number types? I mean for example
List<double> list = new ArrayList<double>();
I know that the normal way to do it would be using wrappers :
List<Double> list = new ArrayList<Double>();
I can use the fact that autoboxing and unboxing will convert from wrapper to
basic type. But my concern is that I have to develop an application that
does a lot of numerical computations, and calculation speed IS an important
issue.
When I read about autoboxing/unboxing from Sun web site, it is clearly
written that it should not be used "for scientific computing or other
performance-sensitive numerical code". If necessary, I'll work with double[]
instead, if it's my only alternative.
Any ideas?
Thanks.
François Grondin
Does anyone has an explanation why one can't define a list of numbers using
generics AND basic number types? I mean for example
List<double> list = new ArrayList<double>();
I know that the normal way to do it would be using wrappers :
List<Double> list = new ArrayList<Double>();
I can use the fact that autoboxing and unboxing will convert from wrapper to
basic type. But my concern is that I have to develop an application that
does a lot of numerical computations, and calculation speed IS an important
issue.
When I read about autoboxing/unboxing from Sun web site, it is clearly
written that it should not be used "for scientific computing or other
performance-sensitive numerical code". If necessary, I'll work with double[]
instead, if it's my only alternative.
Any ideas?
Thanks.
François Grondin