Re: float[][] vs double[][] in VisAD file form

  • To: Curtis Rueden <ctrueden@xxxxxxxx>
  • Subject: Re: float[][] vs double[][] in VisAD file form
  • From: Bill Hibbard <billh@xxxxxxxxxxxxx>
  • Date: Thu, 22 Jul 2004 14:44:45 -0500 (CDT)
Hi Curtis,

> It turns out that the range type is only set to doubles if the
> provided *domain* set is a DoubleSet. This behavior seems somewhat
> non-intuitive.

VisAD Data objects are immutable (i.e., cannot be modified
after constructed) except for Field range and ErrorEstimate
values, in order to promote thread safeness. In the situation
you've encountered, the values are mutable but the arrays
allocated to hold them (float[][] or double[] or scaled
integers) are not. Hence the choice between FloatSet and
DoubleSet can only be made in the constructor. However, both
signatures of setSamples (taking float[][] and double[][]
arguments) are part of the class signature and must always be
supported.

Cheers,
Bill