Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

change method-name converIndexSetToBitmap to convertIndexSetToBitmap #49

Merged
merged 1 commit into from Feb 7, 2017
Jump to file or symbol
Failed to load files and symbols.
+31 −31
Split
@@ -230,7 +230,7 @@ protected EWAHCompressedBitmap getIndividualsBM(EnrichmentQuery q) {
return kb.getIndividualsBM(q.getClassId());
else if (q.getIndividualIds() != null) {
Set<Integer> ixs = q.getIndividualIds().stream().map( x -> kb.getIndividualIndex(x)).collect(Collectors.toSet());
- return EWAHUtils.converIndexSetToBitmap(ixs);
+ return EWAHUtils.convertIndexSetToBitmap(ixs);
}
else {
return null;
@@ -86,7 +86,7 @@ protected EWAHCompressedBitmap getDirectProfileBM(ProfileQuery q) {
for (String cid : q.getQueryClassIds()) {
positions.add(knowledgeBase.getClassIndex(cid));
}
- return EWAHUtils.converIndexSetToBitmap(positions);
+ return EWAHUtils.convertIndexSetToBitmap(positions);
}
// given an array of class IDs c1...cn, return an array S1...Sn,
@@ -114,7 +114,7 @@ protected EWAHCompressedBitmap getNegatedProfileBM(ProfileQuery q) {
int ci = knowledgeBase.getClassIndex(id);
bits.addAll( knowledgeBase.getSubClasses(ci).getPositions() );
}
- return EWAHUtils.converIndexSetToBitmap(bits);
+ return EWAHUtils.convertIndexSetToBitmap(bits);
}
protected EWAHCompressedBitmap getDirectNegatedProfileBM(QueryWithNegation q) {
@@ -124,7 +124,7 @@ protected EWAHCompressedBitmap getDirectNegatedProfileBM(QueryWithNegation q) {
int ci = knowledgeBase.getClassIndex(id);
bits.add(ci);
}
- return EWAHUtils.converIndexSetToBitmap(bits);
+ return EWAHUtils.convertIndexSetToBitmap(bits);
}
protected Match createMatch(String matchId, String matchLabel, double s) {
@@ -64,7 +64,7 @@ private EWAHCompressedBitmap getQueryBlanketBM(ProfileQuery q) {
}
}
- return onQueryNodesBM.or(EWAHUtils.converIndexSetToBitmap(nodesWithOnParents));
+ return onQueryNodesBM.or(EWAHUtils.convertIndexSetToBitmap(nodesWithOnParents));
}
// any negated query node that has at least one negated parent;
@@ -82,7 +82,7 @@ private EWAHCompressedBitmap getQueryNegatedNoTransition(EWAHCompressedBitmap ne
}
}
- return EWAHUtils.converIndexSetToBitmap(nodes);
+ return EWAHUtils.convertIndexSetToBitmap(nodes);
}
@@ -148,10 +148,10 @@ public MatchSet findMatchProfileImpl(ProfileQuery q) {
}
}
- EWAHCompressedBitmap nodesQuPtBM = EWAHUtils.converIndexSetToBitmap(nodesQuPt);
- EWAHCompressedBitmap nodesQuPuBM = EWAHUtils.converIndexSetToBitmap(nodesQuPu);
- EWAHCompressedBitmap nodesQfPtBM = EWAHUtils.converIndexSetToBitmap(nodesQfPtu);
- EWAHCompressedBitmap nodesQfPuBM = EWAHUtils.converIndexSetToBitmap(nodesQfPu);
+ EWAHCompressedBitmap nodesQuPtBM = EWAHUtils.convertIndexSetToBitmap(nodesQuPt);
+ EWAHCompressedBitmap nodesQuPuBM = EWAHUtils.convertIndexSetToBitmap(nodesQuPu);
+ EWAHCompressedBitmap nodesQfPtBM = EWAHUtils.convertIndexSetToBitmap(nodesQfPtu);
+ EWAHCompressedBitmap nodesQfPuBM = EWAHUtils.convertIndexSetToBitmap(nodesQfPu);
// include subclasses
@@ -97,7 +97,7 @@ private EWAHCompressedBitmap getQueryBlanketBM(ProfileQuery q) {
}
}
- return onQueryNodesBM.or(EWAHUtils.converIndexSetToBitmap(nodesWithOnParents));
+ return onQueryNodesBM.or(EWAHUtils.convertIndexSetToBitmap(nodesWithOnParents));
}
/**
@@ -205,7 +205,7 @@ private EWAHCompressedBitmap getDirectProfileBM(Set<String> classIds) {
for (String cid : classIds) {
positions.add(knowledgeBase.getClassIndex(cid));
}
- return EWAHUtils.converIndexSetToBitmap(positions);
+ return EWAHUtils.convertIndexSetToBitmap(positions);
}
}
@@ -74,7 +74,7 @@ public void setMaxLengthFromInstances() {
for (int j=0; j<setLength; j++) {
ibits.add(rand.nextInt(max));
}
- bm = EWAHUtils.converIndexSetToBitmap(ibits);
+ bm = EWAHUtils.convertIndexSetToBitmap(ibits);
// LOG.info("Created random set with length "+setLength);
newbms[i] = bm;
}
@@ -118,7 +118,7 @@ public void setMaxLengthFromInstances() {
for (int j=0; j<setLength; j++) {
ibits.add(allClasses.get(rand.nextInt(max)));
}
- bm = EWAHUtils.converIndexSetToBitmap(ibits);
+ bm = EWAHUtils.convertIndexSetToBitmap(ibits);
// LOG.info("Created random set with length "+setLength);
newbms[i] = bm;
}
@@ -41,7 +41,7 @@ public int getNumLevels() {
throws Exception {
int thing = this.getKnowledgeBase().getRootIndex(); //is this OWL:Thing?
- EWAHCompressedBitmap thingBM = EWAHUtils.converIndexSetToBitmap(new HashSet<Integer>(thing));
+ EWAHCompressedBitmap thingBM = EWAHUtils.convertIndexSetToBitmap(new HashSet<Integer>(thing));
EWAHCompressedBitmap liftAll = new EWAHCompressedBitmap();
EWAHCompressedBitmap[] attrSets = new EWAHCompressedBitmap[numLevels];
@@ -41,7 +41,7 @@ public LiftOneSimulatedData(BMKnowledgeBase knowledgeBase) {
private EWAHCompressedBitmap[] createAttributeSetsRecursive(EWAHCompressedBitmap atts, EWAHCompressedBitmap[] derivedAtts) {
int thing = this.getKnowledgeBase().getRootIndex(); //is this OWL:Thing?
- EWAHCompressedBitmap thingBM = EWAHUtils.converIndexSetToBitmap(new HashSet<Integer>(thing));
+ EWAHCompressedBitmap thingBM = EWAHUtils.convertIndexSetToBitmap(new HashSet<Integer>(thing));
EWAHCompressedBitmap[] attrSets = new EWAHCompressedBitmap[atts.cardinality()];
List<Integer> aList = atts.getPositions();
@@ -97,7 +97,7 @@ public int getSetLength() {
//do this in a while loop instead of for loop
while ((subsetCounter < numSets) ) { //&& (subsetTries < 7*maxNumSets)
Set<Integer> randomSet = makeRandomSubset(atts, setLength);
- sets.add(EWAHUtils.converIndexSetToBitmap(randomSet));
+ sets.add(EWAHUtils.convertIndexSetToBitmap(randomSet));
// LOG.info("Set size="+sets.size());
subsetCounter++;
}
@@ -232,7 +232,7 @@ public void setInclusive(Boolean flag) {
j++;
}
//make BM from set
- bm = EWAHUtils.converIndexSetToBitmap(s);
+ bm = EWAHUtils.convertIndexSetToBitmap(s);
double finalSumIC= calc.getICStatsForAttributesByBM(bm).getSum();
LOG.info("finalIC= "+(finalSumIC)+" targetIC="+(sumIC-categorySumIC)+" removed |n|="+(atts.cardinality()-bm.cardinality()));
if (bm.cardinality() > 0) {
@@ -62,7 +62,7 @@ public Double getICCutoff() {
}
}
if (s.size() > 0) {
- attrSets[0] = EWAHUtils.converIndexSetToBitmap(s);
+ attrSets[0] = EWAHUtils.convertIndexSetToBitmap(s);
}
return attrSets;
@@ -216,7 +216,7 @@ public EWAHCompressedBitmap getDirectTypes(int individualIndex, int classIndex)
* @return all classes directly instantiated by individual, that are subclasses of classIndex
*/
public EWAHCompressedBitmap getDirectTypes(Set<Integer> clsIndices, int classIndex) {
- EWAHCompressedBitmap bm = EWAHUtils.converIndexSetToBitmap(clsIndices);
+ EWAHCompressedBitmap bm = EWAHUtils.convertIndexSetToBitmap(clsIndices);
EWAHCompressedBitmap subclasses = getSubClasses(classIndex);
return bm.and(subclasses);
}
@@ -267,7 +267,7 @@ public EWAHCompressedBitmap getDirectIndividuals(int classIndex) {
* @param superClasses
*/
public void setSuperClasses(int clsIndex, Set<Integer> superClasses) {
- storedSuperClasses[clsIndex] = EWAHUtils.converIndexSetToBitmap(superClasses);
+ storedSuperClasses[clsIndex] = EWAHUtils.convertIndexSetToBitmap(superClasses);
}
/**
@@ -278,7 +278,7 @@ public void setSuperClasses(int clsIndex, Set<Integer> superClasses) {
* @param superClasses
*/
public void setDirectSuperClasses(int clsIndex, Set<Integer> superClasses) {
- storedDirectSuperClasses[clsIndex] = EWAHUtils.converIndexSetToBitmap(superClasses);
+ storedDirectSuperClasses[clsIndex] = EWAHUtils.convertIndexSetToBitmap(superClasses);
}
@@ -304,7 +304,7 @@ public void setStoredDirectSubClasses(
*/
public void setDirectSubClasses(int clsIndex,
Set<Integer> subClasses) {
- storedDirectSubClasses[clsIndex] = EWAHUtils.converIndexSetToBitmap(subClasses);
+ storedDirectSubClasses[clsIndex] = EWAHUtils.convertIndexSetToBitmap(subClasses);
}
/**
@@ -313,7 +313,7 @@ public void setDirectSubClasses(int clsIndex,
*/
public void setSubClasses(int clsIndex,
Set<Integer> subClasses) {
- storedSubClasses[clsIndex] = EWAHUtils.converIndexSetToBitmap(subClasses);
+ storedSubClasses[clsIndex] = EWAHUtils.convertIndexSetToBitmap(subClasses);
}
@@ -327,7 +327,7 @@ public void setSubClasses(int clsIndex,
* @param types
*/
public void setTypes(int individualIndex, Set<Integer> types) {
- storedTypes[individualIndex] = EWAHUtils.converIndexSetToBitmap(types);
+ storedTypes[individualIndex] = EWAHUtils.convertIndexSetToBitmap(types);
}
/**
@@ -339,23 +339,23 @@ public void setTypes(int individualIndex, Set<Integer> types) {
* @param types
*/
public void setDirectTypes(int individualIndex, Set<Integer> types) {
- storedDirectTypes[individualIndex] = EWAHUtils.converIndexSetToBitmap(types);
+ storedDirectTypes[individualIndex] = EWAHUtils.convertIndexSetToBitmap(types);
}
/**
* @param individualIndex
* @param types
*/
public void setNegatedTypes(int individualIndex, Set<Integer> types) {
- storedNegatedTypes[individualIndex] = EWAHUtils.converIndexSetToBitmap(types);
+ storedNegatedTypes[individualIndex] = EWAHUtils.convertIndexSetToBitmap(types);
}
/**
* @param individualIndex
* @param types
*/
public void setDirectNegatedTypes(int individualIndex, Set<Integer> types) {
- storedDirectNegatedTypes[individualIndex] = EWAHUtils.converIndexSetToBitmap(types);
+ storedDirectNegatedTypes[individualIndex] = EWAHUtils.convertIndexSetToBitmap(types);
}
@@ -370,7 +370,7 @@ public void setDirectNegatedTypes(int individualIndex, Set<Integer> types) {
* @param individuals
*/
public void setDirectIndividuals(int classIndex, Set<Integer> individuals) {
- storedDirectIndividuals[classIndex] = EWAHUtils.converIndexSetToBitmap(individuals);
+ storedDirectIndividuals[classIndex] = EWAHUtils.convertIndexSetToBitmap(individuals);
}
@@ -19,7 +19,7 @@
* @param bits - set of bits
* @return Bitmap representation of set of ints
*/
- public static EWAHCompressedBitmap converIndexSetToBitmap(Set<Integer> bits) {
+ public static EWAHCompressedBitmap convertIndexSetToBitmap(Set<Integer> bits) {
EWAHCompressedBitmap bm = new EWAHCompressedBitmap();
ArrayList<Integer> bitlist = new ArrayList<Integer>(bits);
Collections.sort(bitlist); // EWAH assumes sorted, otherwise silent failure
@@ -257,7 +257,7 @@ public void testLiftOneAnnotations() throws Exception {
}
//for each individual, the things removed == original
LOG.info("i= "+i+" orig="+origBM.toString()+" removed="+removedCBits.toString()+" in "+derivedBMs.length+" sets");
- Assert.assertTrue("Bits missing: "+origBM.andNot(EWAHUtils.converIndexSetToBitmap(removedCBits)), origBM.andNotCardinality(EWAHUtils.converIndexSetToBitmap(removedCBits))==0);
+ Assert.assertTrue("Bits missing: "+origBM.andNot(EWAHUtils.convertIndexSetToBitmap(removedCBits)), origBM.andNotCardinality(EWAHUtils.convertIndexSetToBitmap(removedCBits))==0);
}
}