On 10/3/10 2:21 PM, Luc Maisonobe wrote:
> Hi all,
>
> I have fixed MATH391. Now vectors can be built with 0 length using
> several constructors.
>
> There is however one remaining problem, for Fieldbased vectors (i.e.
> ArrayFieldVector). For these vectors, we need to store the field in
> addition to the vector components. For example a Fraction Vectors also
> stores a reference to FractionField. When a vector is built from a non
> empty array, the field can be retrieved from the first element, using
> d[0].getField(). Since 0 length vectors are now allowed, I add to create
> additional constructors that pass the field as an additional constructor
> parameter. This is much cleaner than the previous choice.
>
> Since the field is mainly a compiletime constant for a given program
> (people now when they use Fraction or Complex or Dfp), I would like to
> deprecate the former constructors in 2.2 and remove them in 3.0. This
> means someone building a Fraction vector would use:
>
> Fraction[] data = ...;
> ArrayFieldVector<Fraction> vector =
> new ArrayFieldVector<Fraction>(FractionField.getInstance(),
> data, false);
>
> instead of:
>
> Fraction[] data = ...;
> ArrayFieldVector<Fraction> vector =
> new ArrayFieldVector<Fraction>(data, false);
>
> which don't work for zerolength.
>
> What do you think about this proposed deprecation ?
+1  nice solution
Phil
>
> Luc
>
> 
> To unsubscribe, email: devunsubscribe@commons.apache.org
> For additional commands, email: devhelp@commons.apache.org
>

To unsubscribe, email: devunsubscribe@commons.apache.org
For additional commands, email: devhelp@commons.apache.org
