Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
Updates deps, better Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
vsonnier committed Oct 25, 2014
1 parent 8b03c76 commit 6157110
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 63 deletions.
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

HPPCRT-29 : Regression: setDefaultValue() method absent from v0.66 IndexedHeaps

HPPCRT-30: ObjectOpen[VType]HashMap.putOrAdd() wrong in Robin-Hood version
HPPCRT-30: Object[VType]OpenHashMap.putOrAdd() wrong in Robin-Hood version

** New features

Expand Down
4 changes: 2 additions & 2 deletions hppcrt-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<phase>generate-sources</phase>
<configuration>
<fork>true</fork>
<meminitial>50m</meminitial>
<meminitial>256m</meminitial>
<maxmem>512m</maxmem>
<target>
<property name="classpath" refid="maven.plugin.classpath" />
Expand Down Expand Up @@ -228,7 +228,7 @@
</excludes>

<parallelism>auto</parallelism>
<maxMemory>500m</maxMemory>
<maxMemory>400m</maxMemory>

<!-- Attach a simple listener. -->
<listeners>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* A Heap-based, min-priority queue of <code>KType</code>s.
* i.e. top() is the smallest element,
* as defined by Sedgewick: Algorithms 4th Edition (2011).
* It assure O(log(N)) complexity for insertion, deletion and update priority of the first element,
* and constant time to examine the first element by {@link #top()}.
* It assure O(log(N)) complexity for insertion, deletion and update priority of the min element,
* and constant time to examine the min element by {@link #top()}.
* <p><b>Important: </b>
* Ordering of elements must be defined either
* #if ($TemplateOptions.KTypeGeneric)
Expand Down Expand Up @@ -482,7 +482,7 @@ public KType popTop()
/*! #if ($TemplateOptions.KTypeGeneric) !*/
this.buffer[1] = Intrinsics.<KType> defaultKTypeValue();
/*! #end !*/
//diminuish size
//diminish size
this.elementsCount = 0;
}
else
Expand All @@ -497,7 +497,7 @@ public KType popTop()
this.buffer[this.elementsCount] = Intrinsics.<KType> defaultKTypeValue();
/*! #end !*/

//diminuish size
//diminish size
this.elementsCount--;

//percolate down the first element
Expand Down Expand Up @@ -734,8 +734,8 @@ public KType[] toArray(final KType[] target)
/*! #if ($TemplateOptions.KTypeGeneric) !*/
public Comparator<? super KType>
/*! #else
public KTypeComparator<? super KType>
#end !*/
public KTypeComparator<? super KType>
#end !*/
comparator() {

return this.comparator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* as defined by Sedgewick: Algorithms 4th Edition (2011).
* This class is also a {@link IntKTypeMap}, and acts like a (K,V) = (int, KType) map with >= 0 keys.
* It assures O(log(N)) complexity for insertion, deletion, updating priorities,
* and constant time to examine the first element by {@link #top()} and for {@link #containsKey(int)}.
* and constant time to examine the min element by {@link #top()} and for {@link #containsKey(int)}.
* <p><b>Important: </b>
* Ordering of elements must be defined either
* #if ($TemplateOptions.KTypeGeneric)
Expand Down Expand Up @@ -150,7 +150,7 @@ public void reset(final EntryIterator obj)
* @see BoundedProportionalArraySizingStrategy
*/
public KTypeIndexedHeapPriorityQueue(/*! #if ($TemplateOptions.KTypeGeneric) !*/final Comparator<? super KType> comp
/*! #else
/*! #else
KTypeComparator<? super KType> comp
#end !*/)
{
Expand Down Expand Up @@ -1499,10 +1499,10 @@ public void setDefaultValue(final KType defaultValue)
*/
/*! #if ($TemplateOptions.KTypeGeneric) !*/
public Comparator<? super KType>
/*! #else
/*! #else
public KTypeComparator<? super KType>
#end !*/
comparator() {
comparator() {

return this.comparator;
}
Expand Down Expand Up @@ -1659,22 +1659,22 @@ private void swimComparable(int k)
//swap k and its parent
parent = k >> 1;

//swap k and parent
tmp = buffer[k];
buffer[k] = buffer[parent];
buffer[parent] = tmp;
//swap k and parent
tmp = buffer[k];
buffer[k] = buffer[parent];
buffer[parent] = tmp;

//swap references
indexK = qp[k];
indexParent = qp[parent];
//swap references
indexK = qp[k];
indexParent = qp[parent];

pq[indexK] = parent;
pq[indexParent] = k;
pq[indexK] = parent;
pq[indexParent] = k;

qp[k] = indexParent;
qp[parent] = indexK;
qp[k] = indexParent;
qp[parent] = indexK;

k = parent;
k = parent;
}
}

Expand Down Expand Up @@ -1703,22 +1703,22 @@ private void swimComparator(int k)
//swap k and its parent
parent = k >> 1;

//swap k and parent
tmp = buffer[k];
buffer[k] = buffer[parent];
buffer[parent] = tmp;
//swap k and parent
tmp = buffer[k];
buffer[k] = buffer[parent];
buffer[parent] = tmp;

//swap references
indexK = qp[k];
indexParent = qp[parent];
//swap references
indexK = qp[k];
indexParent = qp[parent];

pq[indexK] = parent;
pq[indexParent] = k;
pq[indexK] = parent;
pq[indexParent] = k;

qp[k] = indexParent;
qp[parent] = indexK;
qp[k] = indexParent;
qp[parent] = indexK;

k = parent;
k = parent;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,28 @@ public class KTypeVTypeOpenHashMap<KType, VType>
/*! #end !*/
/*! #if ($RH) !*/
public int[] allocated;
/*! #elseif ($SA)
//True if key = 0 is in the map.
public boolean allocatedDefaultKey = false;
//if allocatedDefaultKey = true, contains the associated V to the key = 0
public VType defaultKeyValue;
#else
/*! #elseif (!$SA)
public boolean[] allocated;
#end !*/

/**
#if ($SA)
*True if key = 0 is in the map.
#end
*/
/*! #if ($SA)
public boolean allocatedDefaultKey = false;
#end !*/

/**
#if ($SA)
* if allocatedDefaultKey = true, contains the associated V to the key = 0
#end
*/
/*! #if ($SA)
public VType defaultKeyValue;
#end !*/

/**
* Cached number of assigned slots in {@link #keys}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*/
/*! ${TemplateOptions.generatedAnnotation} !*/
public class KTypeVTypeOpenIdentityHashMap<KType, VType>
implements KTypeVTypeMap<KType, VType>, Cloneable
implements KTypeVTypeMap<KType, VType>, Cloneable
{
/**
* Minimum capacity for the map.
Expand Down Expand Up @@ -110,12 +110,25 @@ public class KTypeVTypeOpenIdentityHashMap<KType, VType>
* @see #assigned
*/
public boolean[] allocated;
/*! #else
//True if key = null is in the map.
/*! #end !*/

/**
#if ($SA)
* True if key = null is in the map.
#end
*/
/*! #if ($SA)
public boolean allocatedDefaultKey = false;
//if allocatedDefaultKey = true, contains the associated V to the key = 0
#end !*/

/**
#if ($SA)
* if allocatedDefaultKey = true, contains the associated V to the key = null
#end
*/
/*! #if ($SA)
public VType defaultKeyValue;
#end
#end !*/

/**
* Cached number of assigned slots in {@link #keys}.
Expand Down Expand Up @@ -1249,7 +1262,7 @@ public KeysContainer keys()
* A view of the keys inside this hash map.
*/
public final class KeysContainer
extends AbstractKTypeCollection<KType> implements KTypeLookupContainer<KType>
extends AbstractKTypeCollection<KType> implements KTypeLookupContainer<KType>
{
private final KTypeVTypeOpenIdentityHashMap<KType, VType> owner =
KTypeVTypeOpenIdentityHashMap.this;
Expand Down Expand Up @@ -1851,7 +1864,7 @@ public KTypeVTypeOpenIdentityHashMap<KType, VType> clone()
@SuppressWarnings("unchecked")
final/* #end */
KTypeVTypeOpenIdentityHashMap<KType, VType> cloned =
new KTypeVTypeOpenIdentityHashMap<KType, VType>(this.size(), this.loadFactor);
new KTypeVTypeOpenIdentityHashMap<KType, VType>(this.size(), this.loadFactor);

cloned.putAll(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
*/
/*! ${TemplateOptions.generatedAnnotation} !*/
public class KTypeOpenHashSet<KType>
extends AbstractKTypeCollection<KType>
implements KTypeLookupContainer<KType>, KTypeSet<KType>, Cloneable
extends AbstractKTypeCollection<KType>
implements KTypeLookupContainer<KType>, KTypeSet<KType>, Cloneable
{
/**
* Minimum capacity for the map.
Expand Down Expand Up @@ -136,13 +136,19 @@ public class KTypeOpenHashSet<KType>
/*! #end !*/
/*! #if ($RH) !*/
public int[] allocated;
/*! #elseif ($SA)
//True if key = 0 is in the set.
public boolean allocatedDefaultKey = false;
#else
/*! #elseif (!$SA)
public boolean[] allocated;
#end !*/

/**
#if ($SA)
* True if key = 0 is in the map.
#end
*/
/*! #if ($SA)
public boolean allocatedDefaultKey = false;
#end !*/

/**
* Cached number of assigned slots in {@link #keys}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,16 @@ public class KTypeOpenIdentityHashSet<KType>
* or empty.
* @see #assigned
*/
/*! #end !*/
/*! #if (!$SA) !*/
public boolean[] allocated;
/*! #else
//True if key = null is in the set.
public boolean allocatedDefaultKey = false;
/*! #end !*/

/**
#if ($SA)
* True if key = null is in the map.
#end
*/
/*! #if ($SA)
public boolean allocatedDefaultKey = false;
#end !*/

/**
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<version>3.2</version>
</plugin>


Expand Down Expand Up @@ -207,7 +207,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.3</version>
<version>2.4</version>
<configuration>
<excludes>
<exclude>**/KType*</exclude>
Expand Down

0 comments on commit 6157110

Please sign in to comment.