Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[january-dev] Support for sparse arrays?

Hi all,
I wish to store some measurements in a 2-D array.

We can imagine these measurements as being a series of fuel
consumption measurements, each accompanied by the measurements of
speed and engine revs.  I wish to bin this data, and produce a grid of
measured fuel consumption (litre/sec) indexed by speed (m/sec) in one
axis and engine revs (/sec) in the other.

The January dataset constructors seem to assume that values are
present for all cells.

But, my measurements are infrequent, resulting in a relatively sparse array.

I could provide zeros for the cells that don't have measurements, but
does January offer any alternative strategies/working practices?

Note 1: My default strategy would be to create an empty DoubleDataset
of the correct dimensions, then work through my measurements and use
.setItem(double value, int I, int j) to set the value of specific
cells.

Note 2: I don't have concerns about the memory wastage that are
resolved through Sparse Matrix libraries, my arrays remain quite
small.

Thanks,
Ian


Back to the top