Hi,

Personal experience here but I think you'll come to the same conclusions if
you go through the mailing lists long enough:  vlens  are not a first class
citizen in HDF.  There's all kinds of exceptions and requirements to use
them not common to other types.

But what are you going to do, not have variable length data?  Sheesh, right?

So you need to do something several dub as "linearization" - keeping a
dataset of the counts of the variable-length data in one dataset.  Then
another dataset that has each of those variable-length lists concatenated
in the same order.  Exclusive-prefix sum (a variant cumulative sum) that
and you'll have the starting indices of each list.

It's a little awkward - but it works, is supported in all the
bindings/languages, and filters work on it - all of which can't be said for
vlen types.

Of course your exact question you didn't ask this - but I'll be quick and
point out you'd have a dataset of them in the above approach that you could
load, if that's something you control.

-Jason

On Fri, Oct 9, 2015 at 12:38 PM, Jiaxin Han <[email protected]> wrote:

> Hi Everyone,
>
> Is it possible to do this?
>
> I have an array containing Nvl variable length arrays already written to
> a hdf5 file. I can read in the entire data by (e.g., in c++)
>
> hvl_t vl[Nvl];
> dset.read(vl, VarLenType(&PredType:NATIVE_INT));
>
> However, if I only want to read the length of each variable-length object,
> i.e., vl[].len, how can I do it without reading in the data vl[].p as
> well?
> Thanks!
>
> Jiaxin
>
>
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> [email protected]
> http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
> Twitter: https://twitter.com/hdf5
>
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Reply via email to