question about writing arrays of datatypes

Hi folks -
I've got another naive question about building Datatypes. I've got a Datatype that I'm forming from arrays of doubles. Ultimately, I'll be writing an array of this Datatype. The complicating factor is that the arrays of doubles won't necessarily have the same dimensions from one instance of the Datatype to the next.

Here's a little pseudo-code to more concretely illustrate what I mean:

Datatype {
    double[] a;
    double[][] b;
    double[] c;
};

Datatype[] allData = {
     { a = {1., 2., 3.} } b = {{1.,2.},{3.,4.}}, c = {1.} },
     { a = {1.,} b = {{1.}}, c = {1., 2.} },
     { a = {}, b = {{1.}, {2.}}, c = {1., 2., 3.} }
};

I'm trying to use the Java H5 class to achieve this.

Thanks in advance for your time.

-Josiah

···

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

Hi Josiah,

Hi folks -
I've got another naive question about building Datatypes. I've got a Datatype that I'm forming from arrays of doubles. Ultimately, I'll be writing an array of this Datatype. The complicating factor is that the arrays of doubles won't necessarily have the same dimensions from one instance of the Datatype to the next.

  Sounds like you might want a variable-length sequence of doubles as your datatype. Look at the documentation for H5Tvlen_create()...

  Quincey

···

On Jan 10, 2011, at 3:00 PM, Josiah Slack wrote:

Here's a little pseudo-code to more concretely illustrate what I mean:

Datatype {
  double[] a;
  double[][] b;
  double[] c;
};

Datatype[] allData = {
   { a = {1., 2., 3.} } b = {{1.,2.},{3.,4.}}, c = {1.} },
   { a = {1.,} b = {{1.}}, c = {1., 2.} },
   { a = {}, b = {{1.}, {2.}}, c = {1., 2., 3.} }
};

I'm trying to use the Java H5 class to achieve this.

Thanks in advance for your time.

-Josiah

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Thanks. Can you point me to any examples using H5Tvlen_create() in context (preferably Java, but I'll take what I can get)?

-Josiah

···

On 1/11/2011 7:44 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 10, 2011, at 3:00 PM, Josiah Slack wrote:

Hi folks -
I've got another naive question about building Datatypes. I've got a Datatype that I'm forming from arrays of doubles. Ultimately, I'll be writing an array of this Datatype. The complicating factor is that the arrays of doubles won't necessarily have the same dimensions from one instance of the Datatype to the next.

  Sounds like you might want a variable-length sequence of doubles as your datatype. Look at the documentation for H5Tvlen_create()...

  Quincey

Here's a little pseudo-code to more concretely illustrate what I mean:

Datatype {
   double[] a;
   double[][] b;
   double[] c;
};

Datatype[] allData = {
    { a = {1., 2., 3.} } b = {{1.,2.},{3.,4.}}, c = {1.} },
    { a = {1.,} b = {{1.}}, c = {1., 2.} },
    { a = {}, b = {{1.}, {2.}}, c = {1., 2., 3.} }
};

I'm trying to use the Java H5 class to achieve this.

Thanks in advance for your time.

-Josiah

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

Hi Josiah,

Thanks. Can you point me to any examples using H5Tvlen_create() in context (preferably Java, but I'll take what I can get)?

  Hmm, I don't see any code that uses H5Tvlen_create() in our examples files, but you can look at test/tvltypes.c for examples of how it's used in the context of our regression tests. Perhaps Peter has a pointer to a Java example...

  Quincey

···

On Jan 11, 2011, at 9:22 AM, Josiah Slack wrote:

-Josiah

On 1/11/2011 7:44 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 10, 2011, at 3:00 PM, Josiah Slack wrote:

Hi folks -
I've got another naive question about building Datatypes. I've got a Datatype that I'm forming from arrays of doubles. Ultimately, I'll be writing an array of this Datatype. The complicating factor is that the arrays of doubles won't necessarily have the same dimensions from one instance of the Datatype to the next.

  Sounds like you might want a variable-length sequence of doubles as your datatype. Look at the documentation for H5Tvlen_create()...

  Quincey

Here's a little pseudo-code to more concretely illustrate what I mean:

Datatype {
  double[] a;
  double[][] b;
  double[] c;
};

Datatype[] allData = {
   { a = {1., 2., 3.} } b = {{1.,2.},{3.,4.}}, c = {1.} },
   { a = {1.,} b = {{1.}}, c = {1., 2.} },
   { a = {}, b = {{1.}, {2.}}, c = {1., 2., 3.} }
};

I'm trying to use the Java H5 class to achieve this.

Thanks in advance for your time.

-Josiah

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

I'll have a look, thanks.

-Josiah

···

On 1/11/2011 10:55 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 11, 2011, at 9:22 AM, Josiah Slack wrote:

Thanks. Can you point me to any examples using H5Tvlen_create() in context (preferably Java, but I'll take what I can get)?

  Hmm, I don't see any code that uses H5Tvlen_create() in our examples files, but you can look at test/tvltypes.c for examples of how it's used in the context of our regression tests. Perhaps Peter has a pointer to a Java example...

  Quincey

-Josiah

On 1/11/2011 7:44 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 10, 2011, at 3:00 PM, Josiah Slack wrote:

Hi folks -
I've got another naive question about building Datatypes. I've got a Datatype that I'm forming from arrays of doubles. Ultimately, I'll be writing an array of this Datatype. The complicating factor is that the arrays of doubles won't necessarily have the same dimensions from one instance of the Datatype to the next.

  Sounds like you might want a variable-length sequence of doubles as your datatype. Look at the documentation for H5Tvlen_create()...

  Quincey

Here's a little pseudo-code to more concretely illustrate what I mean:

Datatype {
   double[] a;
   double[][] b;
   double[] c;
};

Datatype[] allData = {
    { a = {1., 2., 3.} } b = {{1.,2.},{3.,4.}}, c = {1.} },
    { a = {1.,} b = {{1.}}, c = {1., 2.} },
    { a = {}, b = {{1.}, {2.}}, c = {1., 2., 3.} }
};

I'm trying to use the Java H5 class to achieve this.

Thanks in advance for your time.

-Josiah

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

Josiah,

There doesn't seem to be a Java example, but there is a C example:

http://www.hdfgroup.org/ftp/HDF5/examples/examples-by-api/hdf5-examples/1_8/C/H5T/h5ex_t_vlen.c

Also, is there a maximum size for the array of doubles? If so, you may be better off using a fixed length array and a separate field to store the actual length, then using compression to mostly eliminate the wasted space.

Thanks,
-Neil

···

On 01/11/2011 09:57 AM, Josiah Slack wrote:

I'll have a look, thanks.

-Josiah

On 1/11/2011 10:55 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 11, 2011, at 9:22 AM, Josiah Slack wrote:

Thanks. Can you point me to any examples using H5Tvlen_create() in context (preferably Java, but I'll take what I can get)?

    Hmm, I don't see any code that uses H5Tvlen_create() in our examples files, but you can look at test/tvltypes.c for examples of how it's used in the context of our regression tests. Perhaps Peter has a pointer to a Java example...

    Quincey

-Josiah

On 1/11/2011 7:44 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 10, 2011, at 3:00 PM, Josiah Slack wrote:

Hi folks -
I've got another naive question about building Datatypes. I've got a Datatype that I'm forming from arrays of doubles. Ultimately, I'll be writing an array of this Datatype. The complicating factor is that the arrays of doubles won't necessarily have the same dimensions from one instance of the Datatype to the next.

    Sounds like you might want a variable-length sequence of doubles as your datatype. Look at the documentation for H5Tvlen_create()...

    Quincey

Here's a little pseudo-code to more concretely illustrate what I mean:

Datatype {
   double[] a;
   double[][] b;
   double[] c;
};

Datatype[] allData = {
    { a = {1., 2., 3.} } b = {{1.,2.},{3.,4.}}, c = {1.} },
    { a = {1.,} b = {{1.}}, c = {1., 2.} },
    { a = {}, b = {{1.}, {2.}}, c = {1., 2., 3.} }
};

I'm trying to use the Java H5 class to achieve this.

Thanks in advance for your time.

-Josiah

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Thanks for the lead - I've grabbed the source and am about to look it over.

-Josiah

···

On 1/11/2011 11:01 AM, Neil Fortner wrote:

Josiah,

There doesn't seem to be a Java example, but there is a C example:

http://www.hdfgroup.org/ftp/HDF5/examples/examples-by-api/hdf5-examples/1_8/C/H5T/h5ex_t_vlen.c

Also, is there a maximum size for the array of doubles? If so, you may
be better off using a fixed length array and a separate field to store
the actual length, then using compression to mostly eliminate the wasted
space.

Thanks,
-Neil

On 01/11/2011 09:57 AM, Josiah Slack wrote:

I'll have a look, thanks.

-Josiah

On 1/11/2011 10:55 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 11, 2011, at 9:22 AM, Josiah Slack wrote:

Thanks. Can you point me to any examples using H5Tvlen_create() in
context (preferably Java, but I'll take what I can get)?

     Hmm, I don't see any code that uses H5Tvlen_create() in our
examples files, but you can look at test/tvltypes.c for examples of
how it's used in the context of our regression tests. Perhaps Peter
has a pointer to a Java example...

     Quincey

-Josiah

On 1/11/2011 7:44 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 10, 2011, at 3:00 PM, Josiah Slack wrote:

Hi folks -
I've got another naive question about building Datatypes. I've got
a Datatype that I'm forming from arrays of doubles. Ultimately,
I'll be writing an array of this Datatype. The complicating
factor is that the arrays of doubles won't necessarily have the
same dimensions from one instance of the Datatype to the next.

     Sounds like you might want a variable-length sequence of
doubles as your datatype. Look at the documentation for
H5Tvlen_create()...

     Quincey

Here's a little pseudo-code to more concretely illustrate what I
mean:

Datatype {
    double[] a;
    double[][] b;
    double[] c;
};

Datatype[] allData = {
     { a = {1., 2., 3.} } b = {{1.,2.},{3.,4.}}, c = {1.} },
     { a = {1.,} b = {{1.}}, c = {1., 2.} },
     { a = {}, b = {{1.}, {2.}}, c = {1., 2., 3.} }
};

I'm trying to use the Java H5 class to achieve this.

Thanks in advance for your time.

-Josiah

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

Just to follow up on the suggestion of using a maximum size. The onus would then be on the consumer of the data to use the extra field?

Thanks for your attention.

-Josiah

···

On 1/11/2011 11:01 AM, Neil Fortner wrote:

Josiah,

There doesn't seem to be a Java example, but there is a C example:

http://www.hdfgroup.org/ftp/HDF5/examples/examples-by-api/hdf5-examples/1_8/C/H5T/h5ex_t_vlen.c

Also, is there a maximum size for the array of doubles? If so, you may
be better off using a fixed length array and a separate field to store
the actual length, then using compression to mostly eliminate the wasted
space.

Thanks,
-Neil

On 01/11/2011 09:57 AM, Josiah Slack wrote:

I'll have a look, thanks.

-Josiah

On 1/11/2011 10:55 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 11, 2011, at 9:22 AM, Josiah Slack wrote:

Thanks. Can you point me to any examples using H5Tvlen_create() in
context (preferably Java, but I'll take what I can get)?

     Hmm, I don't see any code that uses H5Tvlen_create() in our
examples files, but you can look at test/tvltypes.c for examples of
how it's used in the context of our regression tests. Perhaps Peter
has a pointer to a Java example...

     Quincey

-Josiah

On 1/11/2011 7:44 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 10, 2011, at 3:00 PM, Josiah Slack wrote:

Hi folks -
I've got another naive question about building Datatypes. I've got
a Datatype that I'm forming from arrays of doubles. Ultimately,
I'll be writing an array of this Datatype. The complicating
factor is that the arrays of doubles won't necessarily have the
same dimensions from one instance of the Datatype to the next.

     Sounds like you might want a variable-length sequence of
doubles as your datatype. Look at the documentation for
H5Tvlen_create()...

     Quincey

Here's a little pseudo-code to more concretely illustrate what I
mean:

Datatype {
    double[] a;
    double[][] b;
    double[] c;
};

Datatype[] allData = {
     { a = {1., 2., 3.} } b = {{1.,2.},{3.,4.}}, c = {1.} },
     { a = {1.,} b = {{1.}}, c = {1., 2.} },
     { a = {}, b = {{1.}, {2.}}, c = {1., 2., 3.} }
};

I'm trying to use the Java H5 class to achieve this.

Thanks in advance for your time.

-Josiah

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

Using h5ex_t_vlen.c as a rough model, I've taken a stab at a Java version. Not surprisingly, it's failing.

Here's the code:
     private static final String FNAME = "H5CreateVlen.h5";

     private static double[] a = {1., 2., 3.};

     private static double[] b = {1.};

     private static double[][] allData = {
         a, b
     };

     private static void createVlenCompound() throws Exception {
         int DIM1 = 2;
         long[] dims = {DIM1};

         int fid = H5Fcreate(FNAME, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT,
                             HDF5Constants.H5P_DEFAULT);
         int sid = H5Screate_simple(1, dims, null);

         int tid = H5Tvlen_create(HDF5Constants.H5T_NATIVE_DOUBLE);
         int did = H5Dcreate(fid, "ds1", tid, sid, HDF5Constants.H5P_DEFAULT);

         H5Dwrite(did, tid, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, HDF5Constants.H5P_DEFAULT, allData);
         H5Tclose(tid);
         H5Sclose(sid);
         H5Dclose(did);
         H5Fclose(fid);
     }

     public static void main( String args[] ) throws Exception {
         createVlenCompound();
     }

Here's the stack trace:
Exception in thread "main" java.lang.IllegalArgumentException: doubleToByte: start or len is out of bounds
  at ncsa.hdf.hdf5lib.HDFNativeData.doubleToByte(Native Method)
  at ncsa.hdf.hdf5lib.HDFArray.byteify(HDFArray.java:230)
  at ncsa.hdf.hdf5lib.H5.H5Dwrite(H5.java:1172)
  at ncsa.hdf.hdf5lib.H5.H5Dwrite(H5.java:1190)
  at javaExample.H5createVlen.createVlenCompound(H5createVlen.java:43)
  at javaExample.H5createVlen.main(H5createVlen.java:51)

I didn't dig deep enough into the C++ to see how hvl_t (the datatype being used in the sample) is defined, but it seems at the least to have a pointer part and a size part. I was crossing my fingers that the Java H5 class would use reflection or the like to derive the size information needed.

Any further advice for me?

Thanks.

-Josiah

···

On 1/11/2011 11:06 AM, Josiah Slack wrote:

Thanks for the lead - I've grabbed the source and am about to look it over.

-Josiah
On 1/11/2011 11:01 AM, Neil Fortner wrote:

Josiah,

There doesn't seem to be a Java example, but there is a C example:

http://www.hdfgroup.org/ftp/HDF5/examples/examples-by-api/hdf5-examples/1_8/C/H5T/h5ex_t_vlen.c

Also, is there a maximum size for the array of doubles? If so, you may
be better off using a fixed length array and a separate field to store
the actual length, then using compression to mostly eliminate the wasted
space.

Thanks,
-Neil

On 01/11/2011 09:57 AM, Josiah Slack wrote:

I'll have a look, thanks.

-Josiah

On 1/11/2011 10:55 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 11, 2011, at 9:22 AM, Josiah Slack wrote:

Thanks. Can you point me to any examples using H5Tvlen_create() in
context (preferably Java, but I'll take what I can get)?

      Hmm, I don't see any code that uses H5Tvlen_create() in our
examples files, but you can look at test/tvltypes.c for examples of
how it's used in the context of our regression tests. Perhaps Peter
has a pointer to a Java example...

      Quincey

-Josiah

On 1/11/2011 7:44 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 10, 2011, at 3:00 PM, Josiah Slack wrote:

Hi folks -
I've got another naive question about building Datatypes. I've got
a Datatype that I'm forming from arrays of doubles. Ultimately,
I'll be writing an array of this Datatype. The complicating
factor is that the arrays of doubles won't necessarily have the
same dimensions from one instance of the Datatype to the next.

      Sounds like you might want a variable-length sequence of
doubles as your datatype. Look at the documentation for
H5Tvlen_create()...

      Quincey

Here's a little pseudo-code to more concretely illustrate what I
mean:

Datatype {
     double[] a;
     double[][] b;
     double[] c;
};

Datatype[] allData = {
      { a = {1., 2., 3.} } b = {{1.,2.},{3.,4.}}, c = {1.} },
      { a = {1.,} b = {{1.}}, c = {1., 2.} },
      { a = {}, b = {{1.}, {2.}}, c = {1., 2., 3.} }
};

I'm trying to use the Java H5 class to achieve this.

Thanks in advance for your time.

-Josiah

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

The Java interface does not work on vlen except of vlen of strings.
In order to support vlen (other than strings) we need to map the
vlen_t data structure between C and Java, which is not implemented.

Thanks
--pc

···

On 1/11/2011 3:30 PM, Josiah Slack wrote:

Using h5ex_t_vlen.c as a rough model, I've taken a stab at a Java version. Not surprisingly, it's failing.

Here's the code:
    private static final String FNAME = "H5CreateVlen.h5";

    private static double[] a = {1., 2., 3.};

    private static double[] b = {1.};

    private static double[][] allData = {
        a, b
    };

    private static void createVlenCompound() throws Exception {
        int DIM1 = 2;
        long[] dims = {DIM1};

        int fid = H5Fcreate(FNAME, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT,
                            HDF5Constants.H5P_DEFAULT);
        int sid = H5Screate_simple(1, dims, null);

        int tid = H5Tvlen_create(HDF5Constants.H5T_NATIVE_DOUBLE);
        int did = H5Dcreate(fid, "ds1", tid, sid, HDF5Constants.H5P_DEFAULT);

        H5Dwrite(did, tid, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, HDF5Constants.H5P_DEFAULT, allData);
        H5Tclose(tid);
        H5Sclose(sid);
        H5Dclose(did);
        H5Fclose(fid);
    }

    public static void main( String args[] ) throws Exception {
        createVlenCompound();
    }

Here's the stack trace:
Exception in thread "main" java.lang.IllegalArgumentException: doubleToByte: start or len is out of bounds
    at ncsa.hdf.hdf5lib.HDFNativeData.doubleToByte(Native Method)
    at ncsa.hdf.hdf5lib.HDFArray.byteify(HDFArray.java:230)
    at ncsa.hdf.hdf5lib.H5.H5Dwrite(H5.java:1172)
    at ncsa.hdf.hdf5lib.H5.H5Dwrite(H5.java:1190)
    at javaExample.H5createVlen.createVlenCompound(H5createVlen.java:43)
    at javaExample.H5createVlen.main(H5createVlen.java:51)

I didn't dig deep enough into the C++ to see how hvl_t (the datatype being used in the sample) is defined, but it seems at the least to have a pointer part and a size part. I was crossing my fingers that the Java H5 class would use reflection or the like to derive the size information needed.

Any further advice for me?

Thanks.

-Josiah

On 1/11/2011 11:06 AM, Josiah Slack wrote:

Thanks for the lead - I've grabbed the source and am about to look it over.

-Josiah
On 1/11/2011 11:01 AM, Neil Fortner wrote:

Josiah,

There doesn't seem to be a Java example, but there is a C example:

http://www.hdfgroup.org/ftp/HDF5/examples/examples-by-api/hdf5-examples/1_8/C/H5T/h5ex_t_vlen.c

Also, is there a maximum size for the array of doubles? If so, you may
be better off using a fixed length array and a separate field to store
the actual length, then using compression to mostly eliminate the wasted
space.

Thanks,
-Neil

On 01/11/2011 09:57 AM, Josiah Slack wrote:

I'll have a look, thanks.

-Josiah

On 1/11/2011 10:55 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 11, 2011, at 9:22 AM, Josiah Slack wrote:

Thanks. Can you point me to any examples using H5Tvlen_create() in
context (preferably Java, but I'll take what I can get)?

      Hmm, I don't see any code that uses H5Tvlen_create() in our
examples files, but you can look at test/tvltypes.c for examples of
how it's used in the context of our regression tests. Perhaps Peter
has a pointer to a Java example...

      Quincey

-Josiah

On 1/11/2011 7:44 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 10, 2011, at 3:00 PM, Josiah Slack wrote:

Hi folks -
I've got another naive question about building Datatypes. I've got
a Datatype that I'm forming from arrays of doubles. Ultimately,
I'll be writing an array of this Datatype. The complicating
factor is that the arrays of doubles won't necessarily have the
same dimensions from one instance of the Datatype to the next.

      Sounds like you might want a variable-length sequence of
doubles as your datatype. Look at the documentation for
H5Tvlen_create()...

      Quincey

Here's a little pseudo-code to more concretely illustrate what I
mean:

Datatype {
     double[] a;
     double[][] b;
     double[] c;
};

Datatype[] allData = {
      { a = {1., 2., 3.} } b = {{1.,2.},{3.,4.}}, c = {1.} },
      { a = {1.,} b = {{1.}}, c = {1., 2.} },
      { a = {}, b = {{1.}, {2.}}, c = {1., 2., 3.} }
};

I'm trying to use the Java H5 class to achieve this.

Thanks in advance for your time.

-Josiah

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

I seem to have an uncanny ability to find the unimplemented features... Oh well, thanks for the info.

-Josiah

···

On 1/11/2011 4:59 PM, Peter Cao wrote:

The Java interface does not work on vlen except of vlen of strings.
In order to support vlen (other than strings) we need to map the
vlen_t data structure between C and Java, which is not implemented.

Thanks
--pc

On 1/11/2011 3:30 PM, Josiah Slack wrote:

Using h5ex_t_vlen.c as a rough model, I've taken a stab at a Java
version. Not surprisingly, it's failing.

Here's the code:
     private static final String FNAME = "H5CreateVlen.h5";

     private static double[] a = {1., 2., 3.};

     private static double[] b = {1.};

     private static double[][] allData = {
         a, b
     };

     private static void createVlenCompound() throws Exception {
         int DIM1 = 2;
         long[] dims = {DIM1};

         int fid = H5Fcreate(FNAME, HDF5Constants.H5F_ACC_TRUNC,
HDF5Constants.H5P_DEFAULT,
                             HDF5Constants.H5P_DEFAULT);
         int sid = H5Screate_simple(1, dims, null);

         int tid = H5Tvlen_create(HDF5Constants.H5T_NATIVE_DOUBLE);
         int did = H5Dcreate(fid, "ds1", tid, sid,
HDF5Constants.H5P_DEFAULT);

         H5Dwrite(did, tid, HDF5Constants.H5S_ALL,
HDF5Constants.H5S_ALL, HDF5Constants.H5P_DEFAULT, allData);
         H5Tclose(tid);
         H5Sclose(sid);
         H5Dclose(did);
         H5Fclose(fid);
     }

     public static void main( String args[] ) throws Exception {
         createVlenCompound();
     }

Here's the stack trace:
Exception in thread "main" java.lang.IllegalArgumentException:
doubleToByte: start or len is out of bounds
     at ncsa.hdf.hdf5lib.HDFNativeData.doubleToByte(Native Method)
     at ncsa.hdf.hdf5lib.HDFArray.byteify(HDFArray.java:230)
     at ncsa.hdf.hdf5lib.H5.H5Dwrite(H5.java:1172)
     at ncsa.hdf.hdf5lib.H5.H5Dwrite(H5.java:1190)
     at javaExample.H5createVlen.createVlenCompound(H5createVlen.java:43)
     at javaExample.H5createVlen.main(H5createVlen.java:51)

I didn't dig deep enough into the C++ to see how hvl_t (the datatype
being used in the sample) is defined, but it seems at the least to
have a pointer part and a size part. I was crossing my fingers that
the Java H5 class would use reflection or the like to derive the size
information needed.

Any further advice for me?

Thanks.

-Josiah

On 1/11/2011 11:06 AM, Josiah Slack wrote:

Thanks for the lead - I've grabbed the source and am about to look it
over.

-Josiah
On 1/11/2011 11:01 AM, Neil Fortner wrote:

Josiah,

There doesn't seem to be a Java example, but there is a C example:

http://www.hdfgroup.org/ftp/HDF5/examples/examples-by-api/hdf5-examples/1_8/C/H5T/h5ex_t_vlen.c

Also, is there a maximum size for the array of doubles? If so, you may
be better off using a fixed length array and a separate field to store
the actual length, then using compression to mostly eliminate the
wasted
space.

Thanks,
-Neil

On 01/11/2011 09:57 AM, Josiah Slack wrote:

I'll have a look, thanks.

-Josiah

On 1/11/2011 10:55 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 11, 2011, at 9:22 AM, Josiah Slack wrote:

Thanks. Can you point me to any examples using H5Tvlen_create() in
context (preferably Java, but I'll take what I can get)?

       Hmm, I don't see any code that uses H5Tvlen_create() in our
examples files, but you can look at test/tvltypes.c for examples of
how it's used in the context of our regression tests. Perhaps Peter
has a pointer to a Java example...

       Quincey

-Josiah

On 1/11/2011 7:44 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 10, 2011, at 3:00 PM, Josiah Slack wrote:

Hi folks -
I've got another naive question about building Datatypes. I've got
a Datatype that I'm forming from arrays of doubles. Ultimately,
I'll be writing an array of this Datatype. The complicating
factor is that the arrays of doubles won't necessarily have the
same dimensions from one instance of the Datatype to the next.

       Sounds like you might want a variable-length sequence of
doubles as your datatype. Look at the documentation for
H5Tvlen_create()...

       Quincey

Here's a little pseudo-code to more concretely illustrate what I
mean:

Datatype {
      double[] a;
      double[][] b;
      double[] c;
};

Datatype[] allData = {
       { a = {1., 2., 3.} } b = {{1.,2.},{3.,4.}}, c = {1.} },
       { a = {1.,} b = {{1.}}, c = {1., 2.} },
       { a = {}, b = {{1.}, {2.}}, c = {1., 2., 3.} }
};

I'm trying to use the Java H5 class to achieve this.

Thanks in advance for your time.

-Josiah

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

The limitation is stated at "About This Release", which is located at the hdf-java top page.
We are going to have a separate page for known problems and limitations so that users
can easily find the information.

Thanks
--pc

···

I seem to have an uncanny ability to find the unimplemented features... Oh well, thanks for the info.

-Josiah

On 1/11/2011 4:59 PM, Peter Cao wrote:

The Java interface does not work on vlen except of vlen of strings.
In order to support vlen (other than strings) we need to map the
vlen_t data structure between C and Java, which is not implemented.

Thanks
--pc

On 1/11/2011 3:30 PM, Josiah Slack wrote:

Using h5ex_t_vlen.c as a rough model, I've taken a stab at a Java
version. Not surprisingly, it's failing.

Here's the code:
     private static final String FNAME = "H5CreateVlen.h5";

     private static double[] a = {1., 2., 3.};

     private static double[] b = {1.};

     private static double[][] allData = {
         a, b
     };

     private static void createVlenCompound() throws Exception {
         int DIM1 = 2;
         long[] dims = {DIM1};

         int fid = H5Fcreate(FNAME, HDF5Constants.H5F_ACC_TRUNC,
HDF5Constants.H5P_DEFAULT,
                             HDF5Constants.H5P_DEFAULT);
         int sid = H5Screate_simple(1, dims, null);

         int tid = H5Tvlen_create(HDF5Constants.H5T_NATIVE_DOUBLE);
         int did = H5Dcreate(fid, "ds1", tid, sid,
HDF5Constants.H5P_DEFAULT);

         H5Dwrite(did, tid, HDF5Constants.H5S_ALL,
HDF5Constants.H5S_ALL, HDF5Constants.H5P_DEFAULT, allData);
         H5Tclose(tid);
         H5Sclose(sid);
         H5Dclose(did);
         H5Fclose(fid);
     }

     public static void main( String args[] ) throws Exception {
         createVlenCompound();
     }

Here's the stack trace:
Exception in thread "main" java.lang.IllegalArgumentException:
doubleToByte: start or len is out of bounds
     at ncsa.hdf.hdf5lib.HDFNativeData.doubleToByte(Native Method)
     at ncsa.hdf.hdf5lib.HDFArray.byteify(HDFArray.java:230)
     at ncsa.hdf.hdf5lib.H5.H5Dwrite(H5.java:1172)
     at ncsa.hdf.hdf5lib.H5.H5Dwrite(H5.java:1190)
     at javaExample.H5createVlen.createVlenCompound(H5createVlen.java:43)
     at javaExample.H5createVlen.main(H5createVlen.java:51)

I didn't dig deep enough into the C++ to see how hvl_t (the datatype
being used in the sample) is defined, but it seems at the least to
have a pointer part and a size part. I was crossing my fingers that
the Java H5 class would use reflection or the like to derive the size
information needed.

Any further advice for me?

Thanks.

-Josiah

On 1/11/2011 11:06 AM, Josiah Slack wrote:

Thanks for the lead - I've grabbed the source and am about to look it
over.

-Josiah
On 1/11/2011 11:01 AM, Neil Fortner wrote:

Josiah,

There doesn't seem to be a Java example, but there is a C example:

http://www.hdfgroup.org/ftp/HDF5/examples/examples-by-api/hdf5-examples/1_8/C/H5T/h5ex_t_vlen.c

Also, is there a maximum size for the array of doubles? If so, you may
be better off using a fixed length array and a separate field to store
the actual length, then using compression to mostly eliminate the
wasted
space.

Thanks,
-Neil

On 01/11/2011 09:57 AM, Josiah Slack wrote:

I'll have a look, thanks.

-Josiah

On 1/11/2011 10:55 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 11, 2011, at 9:22 AM, Josiah Slack wrote:

Thanks. Can you point me to any examples using H5Tvlen_create() in
context (preferably Java, but I'll take what I can get)?

       Hmm, I don't see any code that uses H5Tvlen_create() in our
examples files, but you can look at test/tvltypes.c for examples of
how it's used in the context of our regression tests. Perhaps Peter
has a pointer to a Java example...

       Quincey

-Josiah

On 1/11/2011 7:44 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 10, 2011, at 3:00 PM, Josiah Slack wrote:

Hi folks -
I've got another naive question about building Datatypes. I've got
a Datatype that I'm forming from arrays of doubles. Ultimately,
I'll be writing an array of this Datatype. The complicating
factor is that the arrays of doubles won't necessarily have the
same dimensions from one instance of the Datatype to the next.

       Sounds like you might want a variable-length sequence of
doubles as your datatype. Look at the documentation for
H5Tvlen_create()...

       Quincey

Here's a little pseudo-code to more concretely illustrate what I
mean:

Datatype {
      double[] a;
      double[][] b;
      double[] c;
};

Datatype[] allData = {
       { a = {1., 2., 3.} } b = {{1.,2.},{3.,4.}}, c = {1.} },
       { a = {1.,} b = {{1.}}, c = {1., 2.} },
       { a = {}, b = {{1.}, {2.}}, c = {1., 2., 3.} }
};

I'm trying to use the Java H5 class to achieve this.

Thanks in advance for your time.

-Josiah

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

I even read it. I'm afraid the details didn't really sink in, as I was trying to absorb everything at once about HDF5. Sorry if I've wasted anybody's time.

-Josiah

···

On 1/11/2011 5:24 PM, Peter Cao wrote:

The limitation is stated at "About This Release", which is located at
the hdf-java top page.
We are going to have a separate page for known problems and limitations
so that users
can easily find the information.

Thanks
--pc

I seem to have an uncanny ability to find the unimplemented
features... Oh well, thanks for the info.

-Josiah

On 1/11/2011 4:59 PM, Peter Cao wrote:

The Java interface does not work on vlen except of vlen of strings.
In order to support vlen (other than strings) we need to map the
vlen_t data structure between C and Java, which is not implemented.

Thanks
--pc

On 1/11/2011 3:30 PM, Josiah Slack wrote:

Using h5ex_t_vlen.c as a rough model, I've taken a stab at a Java
version. Not surprisingly, it's failing.

Here's the code:
      private static final String FNAME = "H5CreateVlen.h5";

      private static double[] a = {1., 2., 3.};

      private static double[] b = {1.};

      private static double[][] allData = {
          a, b
      };

      private static void createVlenCompound() throws Exception {
          int DIM1 = 2;
          long[] dims = {DIM1};

          int fid = H5Fcreate(FNAME, HDF5Constants.H5F_ACC_TRUNC,
HDF5Constants.H5P_DEFAULT,
                              HDF5Constants.H5P_DEFAULT);
          int sid = H5Screate_simple(1, dims, null);

          int tid = H5Tvlen_create(HDF5Constants.H5T_NATIVE_DOUBLE);
          int did = H5Dcreate(fid, "ds1", tid, sid,
HDF5Constants.H5P_DEFAULT);

          H5Dwrite(did, tid, HDF5Constants.H5S_ALL,
HDF5Constants.H5S_ALL, HDF5Constants.H5P_DEFAULT, allData);
          H5Tclose(tid);
          H5Sclose(sid);
          H5Dclose(did);
          H5Fclose(fid);
      }

      public static void main( String args[] ) throws Exception {
          createVlenCompound();
      }

Here's the stack trace:
Exception in thread "main" java.lang.IllegalArgumentException:
doubleToByte: start or len is out of bounds
      at ncsa.hdf.hdf5lib.HDFNativeData.doubleToByte(Native Method)
      at ncsa.hdf.hdf5lib.HDFArray.byteify(HDFArray.java:230)
      at ncsa.hdf.hdf5lib.H5.H5Dwrite(H5.java:1172)
      at ncsa.hdf.hdf5lib.H5.H5Dwrite(H5.java:1190)
      at
javaExample.H5createVlen.createVlenCompound(H5createVlen.java:43)
      at javaExample.H5createVlen.main(H5createVlen.java:51)

I didn't dig deep enough into the C++ to see how hvl_t (the datatype
being used in the sample) is defined, but it seems at the least to
have a pointer part and a size part. I was crossing my fingers that
the Java H5 class would use reflection or the like to derive the size
information needed.

Any further advice for me?

Thanks.

-Josiah

On 1/11/2011 11:06 AM, Josiah Slack wrote:

Thanks for the lead - I've grabbed the source and am about to look it
over.

-Josiah
On 1/11/2011 11:01 AM, Neil Fortner wrote:

Josiah,

There doesn't seem to be a Java example, but there is a C example:

http://www.hdfgroup.org/ftp/HDF5/examples/examples-by-api/hdf5-examples/1_8/C/H5T/h5ex_t_vlen.c

Also, is there a maximum size for the array of doubles? If so,
you may
be better off using a fixed length array and a separate field to
store
the actual length, then using compression to mostly eliminate the
wasted
space.

Thanks,
-Neil

On 01/11/2011 09:57 AM, Josiah Slack wrote:

I'll have a look, thanks.

-Josiah

On 1/11/2011 10:55 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 11, 2011, at 9:22 AM, Josiah Slack wrote:

Thanks. Can you point me to any examples using
H5Tvlen_create() in
context (preferably Java, but I'll take what I can get)?

        Hmm, I don't see any code that uses H5Tvlen_create() in our
examples files, but you can look at test/tvltypes.c for examples of
how it's used in the context of our regression tests. Perhaps
Peter
has a pointer to a Java example...

        Quincey

-Josiah

On 1/11/2011 7:44 AM, Quincey Koziol wrote:

Hi Josiah,

On Jan 10, 2011, at 3:00 PM, Josiah Slack wrote:

Hi folks -
I've got another naive question about building Datatypes.
I've got
a Datatype that I'm forming from arrays of doubles. Ultimately,
I'll be writing an array of this Datatype. The complicating
factor is that the arrays of doubles won't necessarily have the
same dimensions from one instance of the Datatype to the next.

        Sounds like you might want a variable-length sequence of
doubles as your datatype. Look at the documentation for
H5Tvlen_create()...

        Quincey

Here's a little pseudo-code to more concretely illustrate what I
mean:

Datatype {
       double[] a;
       double[][] b;
       double[] c;
};

Datatype[] allData = {
        { a = {1., 2., 3.} } b = {{1.,2.},{3.,4.}}, c = {1.} },
        { a = {1.,} b = {{1.}}, c = {1., 2.} },
        { a = {}, b = {{1.}, {2.}}, c = {1., 2., 3.} }
};

I'm trying to use the Java H5 class to achieve this.

Thanks in advance for your time.

-Josiah

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Josiah Slack
MIT Lincoln Laboratory
Group 36
jslack@ll.mit.edu
Ph: (781) 981-1754