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

Hi Curtis,

Curtis Rueden wrote:

I did a bit more research, and found out some more interesting facts.

First, I added a straight Java serialization test to my test program.
This test produces files identical to VisADForm's serialization mode,
so therefore VisADForm serialization isn't "forcing" anything.

What is actually happening, I discovered, is that even though I'm
calling setSamples(double[][], boolean) to set my samples for the
"doubles" FlatField, they are getting packed back into floats in
FlatField.packValues, because the range type is set to floats.

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.

Therefore, my two FlatFields are actually identical. Although I'm
not sure how to construct a FlatField with a DoubleSet based on
Integer2DSet--so that when I call setSamples(double[][], boolean) it
preserves the doubles array without copying--VisBio does not need
that functionality anyway.

I think you can set the RangeSets in the FlatField constructor, or if the
rangeTypes have their own defaultSets.  I don't think this has anything
to do with the domainSet of the FlatField as you mention above,  but
I've been wrong before.

Tom


  • 2004 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: