public class SparseBooleanVector extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected int[] |
keys
Indicates the positions that hold the value "true"
|
Constructor and Description |
---|
SparseBooleanVector() |
SparseBooleanVector(boolean[] array) |
SparseBooleanVector(HashMap<Integer,Integer> hashmap) |
SparseBooleanVector(int size) |
Modifier and Type | Method and Description |
---|---|
int |
intersection(SparseBooleanVector other) |
double |
jaccard(SparseBooleanVector other)
Computes and return the Jaccard index with other SparseVector.
|
int |
size()
Return the number of (non-zero) elements in this vector.
|
String |
toString() |
int |
union(SparseBooleanVector other) |
public SparseBooleanVector(int size)
public SparseBooleanVector()
public SparseBooleanVector(boolean[] array)
array
- public double jaccard(SparseBooleanVector other)
other
- public int union(SparseBooleanVector other)
other
- public int intersection(SparseBooleanVector other)
other
- public int size()
Copyright © 2016. All rights reserved.