Is there a way to get an array in java which is longer than the length supported by an integer data type?
I'm looking for something that may be indexable using a big integer in Java because the natively supported array length is nowhere near as big as I need it to be for an algorithm I am implementing.
This library should be useful for you: http://fastutil.dsi.unimi.it/
It says:
"...provides also big (64-bit) arrays..."
Int32 gives you 17 8 gigabytes of storage. Do you have so much memory?
I think you should use sparse arrays, i.e. index elements by hash. For example, with just HashMap<BigInteger,YourValueType>
or with some libs like BigMemory and alternatives http://terracotta.org/products/bigmemory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With