Tagged Questions

2
votes
3answers
76 views

What does “SparseArray - there can be gaps in the indices” mean?

Developing a program which uses hash map with integer as keys and objects as values. I keep on getting Lint warning informing SparseArray is more efficient and when I read about the same it was given ...
0
votes
2answers
209 views

Memory-efficient sparse array in Java

(There are some questions about time-efficient sparse arrays but I am looking for memory efficiency.) I need the equivalent of a List<T> or Map<Integer,T> which Can grow on demand just ...
2
votes
2answers
451 views

SparseArray, check if key exists

I was implementing a Bitmap cache using a HashMap<Integer, Bitmap> and received the following warning in Eclipse: Use new SparseArray(...) instead for better performance. I've never heard ...
0
votes
3answers
319 views

SparseArray clone in Android

I am trying to iterate through a SparseArray and delete a few items. private SparseArray record; int size = record.size(); for (int index = 0; index < size; index++) { ...
31
votes
9answers
15k views

Sparse matrices / arrays in Java

I'm working on a project, written in Java, which requires that I build a very large 2-D sparse array. Very sparse, if that makes a difference. Anyway: the most crucial aspect for this application is ...
7
votes
6answers
2k views

java: sparse bit vector

Are there any well-known libraries in Java for sparse bit vectors? (And are there guidelines for how sparse is useful to use them vs. java.util.BitSet?)
0
votes
2answers
910 views

Which is the best way to implement a sparse vector in Java?

Which is the best way to implement a sparse vector in Java? Of course the good thing would be to have something that can be manipulated quite easily (normalization, scalar product and so on) Thanks ...
0
votes
4answers
1k views

Java time-efficient sparse 1D array (double)

I need an efficient Java structure to manipulate very sparse vectors of doubles: basic read / write operations. I implemented it in a HashMap but the access is too slow. Should I use another data ...