|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jcae.mesh.oemm.PAVLTreeIntArrayDup
public class PAVLTreeIntArrayDup
Implementation of PAVL binary trees to store locational codes. It is based on excellent Ben Pfaff's GNU libavl. In C, the version with parent pointers (pavl) is slightly faster than avl. Even if there does not seem to be much difference in Java, we chose this version. A major improvement is to use an int array for storing nodes, so that extra memory is almost never allocated. On trees with 2 millions of nodes, this optimization gives a speedup of 5.
Constructor Summary | |
---|---|
PAVLTreeIntArrayDup()
|
Method Summary | |
---|---|
int |
get(int[] ijk)
Returns node value. |
int |
insert(int[] ijk,
int value)
Inserts a node associated to a value into the tree. |
void |
show()
Dumps tree content. |
int |
size()
Returns tree size. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PAVLTreeIntArrayDup()
Method Detail |
---|
public final int insert(int[] ijk, int value)
ijk
- integer coordinatesvalue
- node value
value
public final int get(int[] ijk)
ijk
- coordinates
-1
if this key does not
exist in the tree.public int size()
public void show()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |