id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
63,900 | elki-project/elki | elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/projection/FeatureSelection.java | FeatureSelection.getAdapter | @SuppressWarnings("unchecked")
private static <V extends FeatureVector<F>, F> ArrayAdapter<F, ? super V> getAdapter(Factory<V, F> factory) {
if(factory instanceof NumberVector.Factory) {
return (ArrayAdapter<F, ? super V>) NumberVectorAdapter.STATIC;
}
return (ArrayAdapter<F, ? super V>) FeatureVect... | java | @SuppressWarnings("unchecked")
private static <V extends FeatureVector<F>, F> ArrayAdapter<F, ? super V> getAdapter(Factory<V, F> factory) {
if(factory instanceof NumberVector.Factory) {
return (ArrayAdapter<F, ? super V>) NumberVectorAdapter.STATIC;
}
return (ArrayAdapter<F, ? super V>) FeatureVect... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"<",
"V",
"extends",
"FeatureVector",
"<",
"F",
">",
",",
"F",
">",
"ArrayAdapter",
"<",
"F",
",",
"?",
"super",
"V",
">",
"getAdapter",
"(",
"Factory",
"<",
"V",
",",
"F",
">",
... | Choose the best adapter for this.
@param factory Object factory, for type inference
@param <V> Vector type
@param <F> Value type
@return Adapter | [
"Choose",
"the",
"best",
"adapter",
"for",
"this",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/projection/FeatureSelection.java#L112-L118 |
63,901 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/optics/FastOPTICS.java | FastOPTICS.expandClusterOrder | protected void expandClusterOrder(DBID ipt, ClusterOrder order, DistanceQuery<V> dq, FiniteProgress prog) {
UpdatableHeap<OPTICSHeapEntry> heap = new UpdatableHeap<>();
heap.add(new OPTICSHeapEntry(ipt, null, Double.POSITIVE_INFINITY));
while(!heap.isEmpty()) {
final OPTICSHeapEntry current = heap.pol... | java | protected void expandClusterOrder(DBID ipt, ClusterOrder order, DistanceQuery<V> dq, FiniteProgress prog) {
UpdatableHeap<OPTICSHeapEntry> heap = new UpdatableHeap<>();
heap.add(new OPTICSHeapEntry(ipt, null, Double.POSITIVE_INFINITY));
while(!heap.isEmpty()) {
final OPTICSHeapEntry current = heap.pol... | [
"protected",
"void",
"expandClusterOrder",
"(",
"DBID",
"ipt",
",",
"ClusterOrder",
"order",
",",
"DistanceQuery",
"<",
"V",
">",
"dq",
",",
"FiniteProgress",
"prog",
")",
"{",
"UpdatableHeap",
"<",
"OPTICSHeapEntry",
">",
"heap",
"=",
"new",
"UpdatableHeap",
... | OPTICS algorithm for processing a point, but with different density
estimates
@param ipt Point
@param order Cluster order (output)
@param dq Distance query
@param prog Progress for logging. | [
"OPTICS",
"algorithm",
"for",
"processing",
"a",
"point",
"but",
"with",
"different",
"density",
"estimates"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/optics/FastOPTICS.java#L181-L208 |
63,902 | elki-project/elki | elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskUpperTriangleMatrix.java | OnDiskUpperTriangleMatrix.resizeMatrix | public synchronized void resizeMatrix(int newsize) throws IOException {
if(newsize >= 0xFFFF) {
throw new RuntimeException("Matrix size is too big and will overflow the integer datatype.");
}
if(!array.isWritable()) {
throw new IOException("Can't resize a read-only array.");
}
array.resi... | java | public synchronized void resizeMatrix(int newsize) throws IOException {
if(newsize >= 0xFFFF) {
throw new RuntimeException("Matrix size is too big and will overflow the integer datatype.");
}
if(!array.isWritable()) {
throw new IOException("Can't resize a read-only array.");
}
array.resi... | [
"public",
"synchronized",
"void",
"resizeMatrix",
"(",
"int",
"newsize",
")",
"throws",
"IOException",
"{",
"if",
"(",
"newsize",
">=",
"0xFFFF",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Matrix size is too big and will overflow the integer datatype.\"",
")"... | Resize the matrix to cover newsize x newsize.
@param newsize New matrix size.
@throws IOException on IO errors | [
"Resize",
"the",
"matrix",
"to",
"cover",
"newsize",
"x",
"newsize",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskUpperTriangleMatrix.java#L102-L113 |
63,903 | elki-project/elki | elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskUpperTriangleMatrix.java | OnDiskUpperTriangleMatrix.computeOffset | private int computeOffset(int x, int y) {
if(y > x) {
return computeOffset(y, x);
}
return ((x * (x + 1)) >> 1) + y;
} | java | private int computeOffset(int x, int y) {
if(y > x) {
return computeOffset(y, x);
}
return ((x * (x + 1)) >> 1) + y;
} | [
"private",
"int",
"computeOffset",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"y",
">",
"x",
")",
"{",
"return",
"computeOffset",
"(",
"y",
",",
"x",
")",
";",
"}",
"return",
"(",
"(",
"x",
"*",
"(",
"x",
"+",
"1",
")",
")",
">>... | Compute the offset within the file.
@param x First coordinate
@param y Second coordinate
@return Linear offset | [
"Compute",
"the",
"offset",
"within",
"the",
"file",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskUpperTriangleMatrix.java#L132-L137 |
63,904 | elki-project/elki | elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArray.java | OnDiskArray.validateHeader | private void validateHeader(boolean validateRecordSize) throws IOException {
int readmagic = file.readInt();
// Validate magic number
if (readmagic != this.magic) {
file.close();
throw new IOException("Magic in LinearDiskCache does not match: " + readmagic + " instead of " + this.magic);
}
... | java | private void validateHeader(boolean validateRecordSize) throws IOException {
int readmagic = file.readInt();
// Validate magic number
if (readmagic != this.magic) {
file.close();
throw new IOException("Magic in LinearDiskCache does not match: " + readmagic + " instead of " + this.magic);
}
... | [
"private",
"void",
"validateHeader",
"(",
"boolean",
"validateRecordSize",
")",
"throws",
"IOException",
"{",
"int",
"readmagic",
"=",
"file",
".",
"readInt",
"(",
")",
";",
"// Validate magic number",
"if",
"(",
"readmagic",
"!=",
"this",
".",
"magic",
")",
"... | Validates the header and throws an IOException if the header is invalid. If
validateRecordSize is set to true the record size must match exactly the
stored record size within the files header, else the record size is read
from the header and used.
@param validateRecordSize
@throws IOException | [
"Validates",
"the",
"header",
"and",
"throws",
"an",
"IOException",
"if",
"the",
"header",
"is",
"invalid",
".",
"If",
"validateRecordSize",
"is",
"set",
"to",
"true",
"the",
"record",
"size",
"must",
"match",
"exactly",
"the",
"stored",
"record",
"size",
"w... | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArray.java#L252-L289 |
63,905 | elki-project/elki | elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArray.java | OnDiskArray.resizeFile | public synchronized void resizeFile(int newsize) throws IOException {
if (!writable) {
throw new IOException("File is not writeable!");
}
// update the number of records
this.numrecs = newsize;
file.seek(HEADER_POS_SIZE);
file.writeInt(numrecs);
// resize file
file.setLength(index... | java | public synchronized void resizeFile(int newsize) throws IOException {
if (!writable) {
throw new IOException("File is not writeable!");
}
// update the number of records
this.numrecs = newsize;
file.seek(HEADER_POS_SIZE);
file.writeInt(numrecs);
// resize file
file.setLength(index... | [
"public",
"synchronized",
"void",
"resizeFile",
"(",
"int",
"newsize",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"writable",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"File is not writeable!\"",
")",
";",
"}",
"// update the number of records",
"thi... | Resize file to the intended size
@param newsize New file size.
@throws IOException on IO errors | [
"Resize",
"file",
"to",
"the",
"intended",
"size"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArray.java#L324-L336 |
63,906 | elki-project/elki | elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArray.java | OnDiskArray.getExtraHeader | public synchronized ByteBuffer getExtraHeader() throws IOException {
final int size = headersize - INTERNAL_HEADER_SIZE;
final MapMode mode = writable ? MapMode.READ_WRITE : MapMode.READ_ONLY;
return file.getChannel().map(mode, INTERNAL_HEADER_SIZE, size);
} | java | public synchronized ByteBuffer getExtraHeader() throws IOException {
final int size = headersize - INTERNAL_HEADER_SIZE;
final MapMode mode = writable ? MapMode.READ_WRITE : MapMode.READ_ONLY;
return file.getChannel().map(mode, INTERNAL_HEADER_SIZE, size);
} | [
"public",
"synchronized",
"ByteBuffer",
"getExtraHeader",
"(",
")",
"throws",
"IOException",
"{",
"final",
"int",
"size",
"=",
"headersize",
"-",
"INTERNAL_HEADER_SIZE",
";",
"final",
"MapMode",
"mode",
"=",
"writable",
"?",
"MapMode",
".",
"READ_WRITE",
":",
"M... | Read the extra header data.
@return additional header data
@throws IOException on IO errors | [
"Read",
"the",
"extra",
"header",
"data",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArray.java#L372-L376 |
63,907 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java | MiniMax.run | public PointerPrototypeHierarchyRepresentationResult run(Database db, Relation<O> relation) {
DistanceQuery<O> dq = DatabaseUtil.precomputedDistanceQuery(db, relation, getDistanceFunction(), LOG);
final DBIDs ids = relation.getDBIDs();
final int size = ids.size();
// Initialize space for result:
Po... | java | public PointerPrototypeHierarchyRepresentationResult run(Database db, Relation<O> relation) {
DistanceQuery<O> dq = DatabaseUtil.precomputedDistanceQuery(db, relation, getDistanceFunction(), LOG);
final DBIDs ids = relation.getDBIDs();
final int size = ids.size();
// Initialize space for result:
Po... | [
"public",
"PointerPrototypeHierarchyRepresentationResult",
"run",
"(",
"Database",
"db",
",",
"Relation",
"<",
"O",
">",
"relation",
")",
"{",
"DistanceQuery",
"<",
"O",
">",
"dq",
"=",
"DatabaseUtil",
".",
"precomputedDistanceQuery",
"(",
"db",
",",
"relation",
... | Run the algorithm on a database.
@param db Database
@param relation Relation to process.
@return Hierarchical result | [
"Run",
"the",
"algorithm",
"on",
"a",
"database",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java#L91-L115 |
63,908 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java | MiniMax.initializeMatrices | protected static <O> void initializeMatrices(MatrixParadigm mat, ArrayModifiableDBIDs prots, DistanceQuery<O> dq) {
final DBIDArrayIter ix = mat.ix, iy = mat.iy;
final double[] distances = mat.matrix;
int pos = 0;
for(ix.seek(0); ix.valid(); ix.advance()) {
for(iy.seek(0); iy.getOffset() < ix.getO... | java | protected static <O> void initializeMatrices(MatrixParadigm mat, ArrayModifiableDBIDs prots, DistanceQuery<O> dq) {
final DBIDArrayIter ix = mat.ix, iy = mat.iy;
final double[] distances = mat.matrix;
int pos = 0;
for(ix.seek(0); ix.valid(); ix.advance()) {
for(iy.seek(0); iy.getOffset() < ix.getO... | [
"protected",
"static",
"<",
"O",
">",
"void",
"initializeMatrices",
"(",
"MatrixParadigm",
"mat",
",",
"ArrayModifiableDBIDs",
"prots",
",",
"DistanceQuery",
"<",
"O",
">",
"dq",
")",
"{",
"final",
"DBIDArrayIter",
"ix",
"=",
"mat",
".",
"ix",
",",
"iy",
"... | Initializes the inter-cluster distance matrix of possible merges
@param mat Matrix
@param dq The distance query | [
"Initializes",
"the",
"inter",
"-",
"cluster",
"distance",
"matrix",
"of",
"possible",
"merges"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java#L123-L135 |
63,909 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java | MiniMax.findMerge | protected static int findMerge(int end, MatrixParadigm mat, DBIDArrayMIter prots, PointerHierarchyRepresentationBuilder builder, Int2ObjectOpenHashMap<ModifiableDBIDs> clusters, DistanceQuery<?> dq) {
final DBIDArrayIter ix = mat.ix, iy = mat.iy;
final double[] distances = mat.matrix;
double mindist = Doubl... | java | protected static int findMerge(int end, MatrixParadigm mat, DBIDArrayMIter prots, PointerHierarchyRepresentationBuilder builder, Int2ObjectOpenHashMap<ModifiableDBIDs> clusters, DistanceQuery<?> dq) {
final DBIDArrayIter ix = mat.ix, iy = mat.iy;
final double[] distances = mat.matrix;
double mindist = Doubl... | [
"protected",
"static",
"int",
"findMerge",
"(",
"int",
"end",
",",
"MatrixParadigm",
"mat",
",",
"DBIDArrayMIter",
"prots",
",",
"PointerHierarchyRepresentationBuilder",
"builder",
",",
"Int2ObjectOpenHashMap",
"<",
"ModifiableDBIDs",
">",
"clusters",
",",
"DistanceQuer... | Find the best merge.
@param mat Matrix view
@param prots Prototypes
@param builder Result builder
@param clusters Current clusters
@param dq Distance query
@return x, for shrinking the working set. | [
"Find",
"the",
"best",
"merge",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java#L147-L178 |
63,910 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java | MiniMax.merge | protected static void merge(int size, MatrixParadigm mat, DBIDArrayMIter prots, PointerHierarchyRepresentationBuilder builder, Int2ObjectOpenHashMap<ModifiableDBIDs> clusters, DistanceQuery<?> dq, int x, int y) {
assert (y < x);
final DBIDArrayIter ix = mat.ix.seek(x), iy = mat.iy.seek(y);
final double[] di... | java | protected static void merge(int size, MatrixParadigm mat, DBIDArrayMIter prots, PointerHierarchyRepresentationBuilder builder, Int2ObjectOpenHashMap<ModifiableDBIDs> clusters, DistanceQuery<?> dq, int x, int y) {
assert (y < x);
final DBIDArrayIter ix = mat.ix.seek(x), iy = mat.iy.seek(y);
final double[] di... | [
"protected",
"static",
"void",
"merge",
"(",
"int",
"size",
",",
"MatrixParadigm",
"mat",
",",
"DBIDArrayMIter",
"prots",
",",
"PointerHierarchyRepresentationBuilder",
"builder",
",",
"Int2ObjectOpenHashMap",
"<",
"ModifiableDBIDs",
">",
"clusters",
",",
"DistanceQuery"... | Merges two clusters given by x, y, their points with smallest IDs, and y to
keep
@param size number of ids in the data set
@param mat distance matrix
@param prots calculated prototypes
@param builder Result builder
@param clusters the clusters
@param dq distance query of the data set
@param x first cluster to merge
@p... | [
"Merges",
"two",
"clusters",
"given",
"by",
"x",
"y",
"their",
"points",
"with",
"smallest",
"IDs",
"and",
"y",
"to",
"keep"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java#L193-L223 |
63,911 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java | MiniMax.updateMatrices | protected static <O> void updateMatrices(int size, MatrixParadigm mat, DBIDArrayMIter prots, PointerHierarchyRepresentationBuilder builder, Int2ObjectOpenHashMap<ModifiableDBIDs> clusters, DistanceQuery<O> dq, int c) {
final DBIDArrayIter ix = mat.ix, iy = mat.iy;
// c is the new cluster.
// Update entries ... | java | protected static <O> void updateMatrices(int size, MatrixParadigm mat, DBIDArrayMIter prots, PointerHierarchyRepresentationBuilder builder, Int2ObjectOpenHashMap<ModifiableDBIDs> clusters, DistanceQuery<O> dq, int c) {
final DBIDArrayIter ix = mat.ix, iy = mat.iy;
// c is the new cluster.
// Update entries ... | [
"protected",
"static",
"<",
"O",
">",
"void",
"updateMatrices",
"(",
"int",
"size",
",",
"MatrixParadigm",
"mat",
",",
"DBIDArrayMIter",
"prots",
",",
"PointerHierarchyRepresentationBuilder",
"builder",
",",
"Int2ObjectOpenHashMap",
"<",
"ModifiableDBIDs",
">",
"clust... | Update the entries of the matrices that contain a distance to c, the newly
merged cluster.
@param size number of ids in the data set
@param mat matrix paradigm
@param prots calculated prototypes
@param builder Result builder
@param clusters the clusters
@param dq distance query of the data set
@param c the cluster to ... | [
"Update",
"the",
"entries",
"of",
"the",
"matrices",
"that",
"contain",
"a",
"distance",
"to",
"c",
"the",
"newly",
"merged",
"cluster",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java#L237-L261 |
63,912 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java | MiniMax.updateEntry | protected static void updateEntry(MatrixParadigm mat, DBIDArrayMIter prots, Int2ObjectOpenHashMap<ModifiableDBIDs> clusters, DistanceQuery<?> dq, int x, int y) {
assert (y < x);
final DBIDArrayIter ix = mat.ix, iy = mat.iy;
final double[] distances = mat.matrix;
ModifiableDBIDs cx = clusters.get(x), cy ... | java | protected static void updateEntry(MatrixParadigm mat, DBIDArrayMIter prots, Int2ObjectOpenHashMap<ModifiableDBIDs> clusters, DistanceQuery<?> dq, int x, int y) {
assert (y < x);
final DBIDArrayIter ix = mat.ix, iy = mat.iy;
final double[] distances = mat.matrix;
ModifiableDBIDs cx = clusters.get(x), cy ... | [
"protected",
"static",
"void",
"updateEntry",
"(",
"MatrixParadigm",
"mat",
",",
"DBIDArrayMIter",
"prots",
",",
"Int2ObjectOpenHashMap",
"<",
"ModifiableDBIDs",
">",
"clusters",
",",
"DistanceQuery",
"<",
"?",
">",
"dq",
",",
"int",
"x",
",",
"int",
"y",
")",... | Update entry at x,y for distance matrix distances
@param mat distance matrix
@param prots calculated prototypes
@param clusters the clusters
@param dq distance query on the data set
@param x index of cluster, {@code x > y}
@param y index of cluster, {@code y < x} | [
"Update",
"entry",
"at",
"x",
"y",
"for",
"distance",
"matrix",
"distances"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java#L273-L302 |
63,913 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java | MiniMax.findMax | private static double findMax(DistanceQuery<?> dq, DBIDIter i, DBIDs cy, double maxDist, double minMaxDist) {
for(DBIDIter j = cy.iter(); j.valid(); j.advance()) {
double dist = dq.distance(i, j);
if(dist > maxDist) {
// Stop early, if we already know a better candidate.
if(dist >= minMa... | java | private static double findMax(DistanceQuery<?> dq, DBIDIter i, DBIDs cy, double maxDist, double minMaxDist) {
for(DBIDIter j = cy.iter(); j.valid(); j.advance()) {
double dist = dq.distance(i, j);
if(dist > maxDist) {
// Stop early, if we already know a better candidate.
if(dist >= minMa... | [
"private",
"static",
"double",
"findMax",
"(",
"DistanceQuery",
"<",
"?",
">",
"dq",
",",
"DBIDIter",
"i",
",",
"DBIDs",
"cy",
",",
"double",
"maxDist",
",",
"double",
"minMaxDist",
")",
"{",
"for",
"(",
"DBIDIter",
"j",
"=",
"cy",
".",
"iter",
"(",
... | Find the maximum distance of one object to a set.
@param dq Distance query
@param i Current object
@param cy Set of candidates
@param maxDist Known maximum to others
@param minMaxDist Early stopping threshold
@return Maximum distance | [
"Find",
"the",
"maximum",
"distance",
"of",
"one",
"object",
"to",
"a",
"set",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/MiniMax.java#L380-L392 |
63,914 | elki-project/elki | elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/SpatialPointLeafEntry.java | SpatialPointLeafEntry.writeExternal | @Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeInt(DBIDUtil.asInteger(id));
out.writeInt(values.length);
for(double v : values) {
out.writeDouble(v);
}
} | java | @Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeInt(DBIDUtil.asInteger(id));
out.writeInt(values.length);
for(double v : values) {
out.writeDouble(v);
}
} | [
"@",
"Override",
"public",
"void",
"writeExternal",
"(",
"ObjectOutput",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"writeInt",
"(",
"DBIDUtil",
".",
"asInteger",
"(",
"id",
")",
")",
";",
"out",
".",
"writeInt",
"(",
"values",
".",
"length",
... | Calls the super method and writes the values of this entry to the specified
stream.
@param out the stream to write the object to
@throws java.io.IOException Includes any I/O exceptions that may occur | [
"Calls",
"the",
"super",
"method",
"and",
"writes",
"the",
"values",
"of",
"this",
"entry",
"to",
"the",
"specified",
"stream",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/SpatialPointLeafEntry.java#L108-L115 |
63,915 | elki-project/elki | elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/SpatialPointLeafEntry.java | SpatialPointLeafEntry.readExternal | @Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
id = DBIDUtil.importInteger(in.read());
values = new double[in.readInt()];
for(int d = 0; d < values.length; d++) {
values[d] = in.readDouble();
}
} | java | @Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
id = DBIDUtil.importInteger(in.read());
values = new double[in.readInt()];
for(int d = 0; d < values.length; d++) {
values[d] = in.readDouble();
}
} | [
"@",
"Override",
"public",
"void",
"readExternal",
"(",
"ObjectInput",
"in",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"id",
"=",
"DBIDUtil",
".",
"importInteger",
"(",
"in",
".",
"read",
"(",
")",
")",
";",
"values",
"=",
"new",
"d... | Calls the super method and reads the values of this entry from the
specified input stream.
@param in the stream to read data from in order to restore the object
@throws java.io.IOException if I/O errors occur
@throws ClassNotFoundException If the class for an object being restored
cannot be found. | [
"Calls",
"the",
"super",
"method",
"and",
"reads",
"the",
"values",
"of",
"this",
"entry",
"from",
"the",
"specified",
"input",
"stream",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/SpatialPointLeafEntry.java#L126-L133 |
63,916 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/progress/IndefiniteProgress.java | IndefiniteProgress.appendToBuffer | @Override
public StringBuilder appendToBuffer(StringBuilder buf) {
buf.append(getTask());
buf.append(": ");
buf.append(getProcessed());
return buf;
} | java | @Override
public StringBuilder appendToBuffer(StringBuilder buf) {
buf.append(getTask());
buf.append(": ");
buf.append(getProcessed());
return buf;
} | [
"@",
"Override",
"public",
"StringBuilder",
"appendToBuffer",
"(",
"StringBuilder",
"buf",
")",
"{",
"buf",
".",
"append",
"(",
"getTask",
"(",
")",
")",
";",
"buf",
".",
"append",
"(",
"\": \"",
")",
";",
"buf",
".",
"append",
"(",
"getProcessed",
"(",
... | Serialize 'indefinite' progress. | [
"Serialize",
"indefinite",
"progress",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/progress/IndefiniteProgress.java#L60-L66 |
63,917 | elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/typeconversions/SplitNumberVectorFilter.java | SplitNumberVectorFilter.getInputTypeRestriction | private TypeInformation getInputTypeRestriction() {
// Find maximum dimension requested
int m = dims[0];
for(int i = 1; i < dims.length; i++) {
m = Math.max(dims[i], m);
}
return VectorFieldTypeInformation.typeRequest(NumberVector.class, m, Integer.MAX_VALUE);
} | java | private TypeInformation getInputTypeRestriction() {
// Find maximum dimension requested
int m = dims[0];
for(int i = 1; i < dims.length; i++) {
m = Math.max(dims[i], m);
}
return VectorFieldTypeInformation.typeRequest(NumberVector.class, m, Integer.MAX_VALUE);
} | [
"private",
"TypeInformation",
"getInputTypeRestriction",
"(",
")",
"{",
"// Find maximum dimension requested",
"int",
"m",
"=",
"dims",
"[",
"0",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"dims",
".",
"length",
";",
"i",
"++",
")",
"{",
... | The input type we use.
@return type information | [
"The",
"input",
"type",
"we",
"use",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/typeconversions/SplitNumberVectorFilter.java#L142-L149 |
63,918 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/LSDBC.java | LSDBC.isLocalMaximum | private boolean isLocalMaximum(double kdist, DBIDs neighbors, WritableDoubleDataStore kdists) {
for(DBIDIter it = neighbors.iter(); it.valid(); it.advance()) {
if(kdists.doubleValue(it) < kdist) {
return false;
}
}
return true;
} | java | private boolean isLocalMaximum(double kdist, DBIDs neighbors, WritableDoubleDataStore kdists) {
for(DBIDIter it = neighbors.iter(); it.valid(); it.advance()) {
if(kdists.doubleValue(it) < kdist) {
return false;
}
}
return true;
} | [
"private",
"boolean",
"isLocalMaximum",
"(",
"double",
"kdist",
",",
"DBIDs",
"neighbors",
",",
"WritableDoubleDataStore",
"kdists",
")",
"{",
"for",
"(",
"DBIDIter",
"it",
"=",
"neighbors",
".",
"iter",
"(",
")",
";",
"it",
".",
"valid",
"(",
")",
";",
... | Test if a point is a local density maximum.
@param kdist k-distance of current
@param neighbors Neighbor points
@param kdists kNN distances
@return {@code true} when the point is a local maximum | [
"Test",
"if",
"a",
"point",
"is",
"a",
"local",
"density",
"maximum",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/LSDBC.java#L222-L229 |
63,919 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/LSDBC.java | LSDBC.expandCluster | protected int expandCluster(final int clusterid, final WritableIntegerDataStore clusterids, final KNNQuery<O> knnq, final DBIDs neighbors, final double maxkdist, final FiniteProgress progress) {
int clustersize = 1; // initial seed!
final ArrayModifiableDBIDs activeSet = DBIDUtil.newArray();
activeSet.addDB... | java | protected int expandCluster(final int clusterid, final WritableIntegerDataStore clusterids, final KNNQuery<O> knnq, final DBIDs neighbors, final double maxkdist, final FiniteProgress progress) {
int clustersize = 1; // initial seed!
final ArrayModifiableDBIDs activeSet = DBIDUtil.newArray();
activeSet.addDB... | [
"protected",
"int",
"expandCluster",
"(",
"final",
"int",
"clusterid",
",",
"final",
"WritableIntegerDataStore",
"clusterids",
",",
"final",
"KNNQuery",
"<",
"O",
">",
"knnq",
",",
"final",
"DBIDs",
"neighbors",
",",
"final",
"double",
"maxkdist",
",",
"final",
... | Set-based expand cluster implementation.
@param clusterid ID of the current cluster.
@param clusterids Current object to cluster mapping.
@param knnq kNNQuery
@param neighbors Neighbors acquired by initial getNeighbors call.
@param maxkdist Maximum k-distance
@param progress Progress logging
@return cluster size | [
"Set",
"-",
"based",
"expand",
"cluster",
"implementation",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/LSDBC.java#L243-L273 |
63,920 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/LSDBC.java | LSDBC.fillDensities | private void fillDensities(KNNQuery<O> knnq, DBIDs ids, WritableDoubleDataStore dens) {
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Densities", ids.size(), LOG) : null;
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
final KNNList neighbors = knnq.getKNNForDBID(iter, k);
... | java | private void fillDensities(KNNQuery<O> knnq, DBIDs ids, WritableDoubleDataStore dens) {
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Densities", ids.size(), LOG) : null;
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
final KNNList neighbors = knnq.getKNNForDBID(iter, k);
... | [
"private",
"void",
"fillDensities",
"(",
"KNNQuery",
"<",
"O",
">",
"knnq",
",",
"DBIDs",
"ids",
",",
"WritableDoubleDataStore",
"dens",
")",
"{",
"FiniteProgress",
"prog",
"=",
"LOG",
".",
"isVerbose",
"(",
")",
"?",
"new",
"FiniteProgress",
"(",
"\"Densiti... | Collect all densities into an array for sorting.
@param knnq kNN query
@param ids DBIDs to process
@param dens Density storage | [
"Collect",
"all",
"densities",
"into",
"an",
"array",
"for",
"sorting",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/LSDBC.java#L282-L290 |
63,921 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/CLIQUE.java | CLIQUE.run | public Clustering<SubspaceModel> run(Relation<? extends NumberVector> relation) {
final int dimensionality = RelationUtil.dimensionality(relation);
StepProgress step = new StepProgress(2);
// 1. Identification of subspaces that contain clusters
step.beginStep(1, "Identification of subspaces that contai... | java | public Clustering<SubspaceModel> run(Relation<? extends NumberVector> relation) {
final int dimensionality = RelationUtil.dimensionality(relation);
StepProgress step = new StepProgress(2);
// 1. Identification of subspaces that contain clusters
step.beginStep(1, "Identification of subspaces that contai... | [
"public",
"Clustering",
"<",
"SubspaceModel",
">",
"run",
"(",
"Relation",
"<",
"?",
"extends",
"NumberVector",
">",
"relation",
")",
"{",
"final",
"int",
"dimensionality",
"=",
"RelationUtil",
".",
"dimensionality",
"(",
"relation",
")",
";",
"StepProgress",
... | Performs the CLIQUE algorithm on the given database.
@param relation Data relation to process
@return Clustering result | [
"Performs",
"the",
"CLIQUE",
"algorithm",
"on",
"the",
"given",
"database",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/CLIQUE.java#L134-L186 |
63,922 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/CLIQUE.java | CLIQUE.determineClusters | private List<Pair<Subspace, ModifiableDBIDs>> determineClusters(List<CLIQUESubspace> denseSubspaces) {
List<Pair<Subspace, ModifiableDBIDs>> clusters = new ArrayList<>();
for(CLIQUESubspace subspace : denseSubspaces) {
List<Pair<Subspace, ModifiableDBIDs>> clustersInSubspace = subspace.determineClusters(... | java | private List<Pair<Subspace, ModifiableDBIDs>> determineClusters(List<CLIQUESubspace> denseSubspaces) {
List<Pair<Subspace, ModifiableDBIDs>> clusters = new ArrayList<>();
for(CLIQUESubspace subspace : denseSubspaces) {
List<Pair<Subspace, ModifiableDBIDs>> clustersInSubspace = subspace.determineClusters(... | [
"private",
"List",
"<",
"Pair",
"<",
"Subspace",
",",
"ModifiableDBIDs",
">",
">",
"determineClusters",
"(",
"List",
"<",
"CLIQUESubspace",
">",
"denseSubspaces",
")",
"{",
"List",
"<",
"Pair",
"<",
"Subspace",
",",
"ModifiableDBIDs",
">",
">",
"clusters",
"... | Determines the clusters in the specified dense subspaces.
@param denseSubspaces the dense subspaces in reverse order by their
coverage
@return the clusters in the specified dense subspaces and the corresponding
cluster models | [
"Determines",
"the",
"clusters",
"in",
"the",
"specified",
"dense",
"subspaces",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/CLIQUE.java#L196-L207 |
63,923 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/CLIQUE.java | CLIQUE.findOneDimensionalDenseSubspaces | private List<CLIQUESubspace> findOneDimensionalDenseSubspaces(Relation<? extends NumberVector> database) {
List<CLIQUESubspace> denseSubspaceCandidates = findOneDimensionalDenseSubspaceCandidates(database);
return prune ? pruneDenseSubspaces(denseSubspaceCandidates) : denseSubspaceCandidates;
} | java | private List<CLIQUESubspace> findOneDimensionalDenseSubspaces(Relation<? extends NumberVector> database) {
List<CLIQUESubspace> denseSubspaceCandidates = findOneDimensionalDenseSubspaceCandidates(database);
return prune ? pruneDenseSubspaces(denseSubspaceCandidates) : denseSubspaceCandidates;
} | [
"private",
"List",
"<",
"CLIQUESubspace",
">",
"findOneDimensionalDenseSubspaces",
"(",
"Relation",
"<",
"?",
"extends",
"NumberVector",
">",
"database",
")",
"{",
"List",
"<",
"CLIQUESubspace",
">",
"denseSubspaceCandidates",
"=",
"findOneDimensionalDenseSubspaceCandidat... | Determines the one dimensional dense subspaces and performs a pruning if
this option is chosen.
@param database the database to run the algorithm on
@return the one dimensional dense subspaces reverse ordered by their
coverage | [
"Determines",
"the",
"one",
"dimensional",
"dense",
"subspaces",
"and",
"performs",
"a",
"pruning",
"if",
"this",
"option",
"is",
"chosen",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/CLIQUE.java#L217-L220 |
63,924 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/CLIQUE.java | CLIQUE.updateMinMax | private void updateMinMax(NumberVector featureVector, double[] minima, double[] maxima) {
assert (minima.length == featureVector.getDimensionality());
for(int d = 0; d < featureVector.getDimensionality(); d++) {
double v = featureVector.doubleValue(d);
if(v == v) { // Avoid NaN.
maxima[d] = ... | java | private void updateMinMax(NumberVector featureVector, double[] minima, double[] maxima) {
assert (minima.length == featureVector.getDimensionality());
for(int d = 0; d < featureVector.getDimensionality(); d++) {
double v = featureVector.doubleValue(d);
if(v == v) { // Avoid NaN.
maxima[d] = ... | [
"private",
"void",
"updateMinMax",
"(",
"NumberVector",
"featureVector",
",",
"double",
"[",
"]",
"minima",
",",
"double",
"[",
"]",
"maxima",
")",
"{",
"assert",
"(",
"minima",
".",
"length",
"==",
"featureVector",
".",
"getDimensionality",
"(",
")",
")",
... | Updates the minima and maxima array according to the specified feature
vector.
@param featureVector the feature vector
@param minima the array of minima
@param maxima the array of maxima | [
"Updates",
"the",
"minima",
"and",
"maxima",
"array",
"according",
"to",
"the",
"specified",
"feature",
"vector",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/CLIQUE.java#L304-L313 |
63,925 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/CLIQUE.java | CLIQUE.findOneDimensionalDenseSubspaceCandidates | private List<CLIQUESubspace> findOneDimensionalDenseSubspaceCandidates(Relation<? extends NumberVector> database) {
Collection<CLIQUEUnit> units = initOneDimensionalUnits(database);
// identify dense units
double total = database.size();
for(DBIDIter it = database.iterDBIDs(); it.valid(); it.advance()) ... | java | private List<CLIQUESubspace> findOneDimensionalDenseSubspaceCandidates(Relation<? extends NumberVector> database) {
Collection<CLIQUEUnit> units = initOneDimensionalUnits(database);
// identify dense units
double total = database.size();
for(DBIDIter it = database.iterDBIDs(); it.valid(); it.advance()) ... | [
"private",
"List",
"<",
"CLIQUESubspace",
">",
"findOneDimensionalDenseSubspaceCandidates",
"(",
"Relation",
"<",
"?",
"extends",
"NumberVector",
">",
"database",
")",
"{",
"Collection",
"<",
"CLIQUEUnit",
">",
"units",
"=",
"initOneDimensionalUnits",
"(",
"database",... | Determines the one-dimensional dense subspace candidates by making a pass
over the database.
@param database the database to run the algorithm on
@return the one-dimensional dense subspace candidates reverse ordered by
their coverage | [
"Determines",
"the",
"one",
"-",
"dimensional",
"dense",
"subspace",
"candidates",
"by",
"making",
"a",
"pass",
"over",
"the",
"database",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/CLIQUE.java#L323-L365 |
63,926 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/CLIQUE.java | CLIQUE.pruneDenseSubspaces | private List<CLIQUESubspace> pruneDenseSubspaces(List<CLIQUESubspace> denseSubspaces) {
int[][] means = computeMeans(denseSubspaces);
double[][] diffs = computeDiffs(denseSubspaces, means[0], means[1]);
double[] codeLength = new double[denseSubspaces.size()];
double minCL = Double.MAX_VALUE;
int min... | java | private List<CLIQUESubspace> pruneDenseSubspaces(List<CLIQUESubspace> denseSubspaces) {
int[][] means = computeMeans(denseSubspaces);
double[][] diffs = computeDiffs(denseSubspaces, means[0], means[1]);
double[] codeLength = new double[denseSubspaces.size()];
double minCL = Double.MAX_VALUE;
int min... | [
"private",
"List",
"<",
"CLIQUESubspace",
">",
"pruneDenseSubspaces",
"(",
"List",
"<",
"CLIQUESubspace",
">",
"denseSubspaces",
")",
"{",
"int",
"[",
"]",
"[",
"]",
"means",
"=",
"computeMeans",
"(",
"denseSubspaces",
")",
";",
"double",
"[",
"]",
"[",
"]... | Performs a MDL-based pruning of the specified dense subspaces as described
in the CLIQUE algorithm.
@param denseSubspaces the subspaces to be pruned sorted in reverse order by
their coverage
@return the subspaces which are not pruned reverse ordered by their
coverage | [
"Performs",
"a",
"MDL",
"-",
"based",
"pruning",
"of",
"the",
"specified",
"dense",
"subspaces",
"as",
"described",
"in",
"the",
"CLIQUE",
"algorithm",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/CLIQUE.java#L409-L427 |
63,927 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/CLIQUE.java | CLIQUE.computeMeans | private int[][] computeMeans(List<CLIQUESubspace> denseSubspaces) {
int n = denseSubspaces.size() - 1;
int[] mi = new int[n + 1], mp = new int[n + 1];
double resultMI = 0, resultMP = 0;
for(int i = 0; i < denseSubspaces.size(); i++) {
resultMI += denseSubspaces.get(i).getCoverage();
result... | java | private int[][] computeMeans(List<CLIQUESubspace> denseSubspaces) {
int n = denseSubspaces.size() - 1;
int[] mi = new int[n + 1], mp = new int[n + 1];
double resultMI = 0, resultMP = 0;
for(int i = 0; i < denseSubspaces.size(); i++) {
resultMI += denseSubspaces.get(i).getCoverage();
result... | [
"private",
"int",
"[",
"]",
"[",
"]",
"computeMeans",
"(",
"List",
"<",
"CLIQUESubspace",
">",
"denseSubspaces",
")",
"{",
"int",
"n",
"=",
"denseSubspaces",
".",
"size",
"(",
")",
"-",
"1",
";",
"int",
"[",
"]",
"mi",
"=",
"new",
"int",
"[",
"n",
... | The specified sorted list of dense subspaces is divided into the selected
set I and the pruned set P. For each set the mean of the cover fractions is
computed.
@param denseSubspaces the dense subspaces in reverse order by their
coverage
@return the mean of the cover fractions, the first value is the mean of the
select... | [
"The",
"specified",
"sorted",
"list",
"of",
"dense",
"subspaces",
"is",
"divided",
"into",
"the",
"selected",
"set",
"I",
"and",
"the",
"pruned",
"set",
"P",
".",
"For",
"each",
"set",
"the",
"mean",
"of",
"the",
"cover",
"fractions",
"is",
"computed",
"... | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/CLIQUE.java#L439-L455 |
63,928 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/CLIQUE.java | CLIQUE.computeDiffs | private double[][] computeDiffs(List<CLIQUESubspace> denseSubspaces, int[] mi, int[] mp) {
int n = denseSubspaces.size() - 1;
double[] diff_mi = new double[n + 1], diff_mp = new double[n + 1];
double resultMI = 0, resultMP = 0;
for(int i = 0; i < denseSubspaces.size(); i++) {
double diffMI = Mat... | java | private double[][] computeDiffs(List<CLIQUESubspace> denseSubspaces, int[] mi, int[] mp) {
int n = denseSubspaces.size() - 1;
double[] diff_mi = new double[n + 1], diff_mp = new double[n + 1];
double resultMI = 0, resultMP = 0;
for(int i = 0; i < denseSubspaces.size(); i++) {
double diffMI = Mat... | [
"private",
"double",
"[",
"]",
"[",
"]",
"computeDiffs",
"(",
"List",
"<",
"CLIQUESubspace",
">",
"denseSubspaces",
",",
"int",
"[",
"]",
"mi",
",",
"int",
"[",
"]",
"mp",
")",
"{",
"int",
"n",
"=",
"denseSubspaces",
".",
"size",
"(",
")",
"-",
"1"... | The specified sorted list of dense subspaces is divided into the selected
set I and the pruned set P. For each set the difference from the specified
mean values is computed.
@param denseSubspaces denseSubspaces the dense subspaces in reverse order
by their coverage
@param mi the mean of the selected sets I
@param mp t... | [
"The",
"specified",
"sorted",
"list",
"of",
"dense",
"subspaces",
"is",
"divided",
"into",
"the",
"selected",
"set",
"I",
"and",
"the",
"pruned",
"set",
"P",
".",
"For",
"each",
"set",
"the",
"difference",
"from",
"the",
"specified",
"mean",
"values",
"is"... | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/CLIQUE.java#L470-L487 |
63,929 | elki-project/elki | elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/datasource/bundle/SingleObjectBundle.java | SingleObjectBundle.append | public void append(SimpleTypeInformation<?> meta, Object data) {
this.meta.add(meta);
this.contents.add(data);
} | java | public void append(SimpleTypeInformation<?> meta, Object data) {
this.meta.add(meta);
this.contents.add(data);
} | [
"public",
"void",
"append",
"(",
"SimpleTypeInformation",
"<",
"?",
">",
"meta",
",",
"Object",
"data",
")",
"{",
"this",
".",
"meta",
".",
"add",
"(",
"meta",
")",
";",
"this",
".",
"contents",
".",
"add",
"(",
"data",
")",
";",
"}"
] | Append a single representation to the object.
@param meta Meta for the representation
@param data Data to append | [
"Append",
"a",
"single",
"representation",
"to",
"the",
"object",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/datasource/bundle/SingleObjectBundle.java#L143-L146 |
63,930 | elki-project/elki | elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/BitVector.java | BitVector.contains | public boolean contains(long[] bitset) {
for(int i = 0; i < bitset.length; i++) {
final long b = bitset[i];
if(i >= bits.length && b != 0L) {
return false;
}
if((b & bits[i]) != b) {
return false;
}
}
return true;
} | java | public boolean contains(long[] bitset) {
for(int i = 0; i < bitset.length; i++) {
final long b = bitset[i];
if(i >= bits.length && b != 0L) {
return false;
}
if((b & bits[i]) != b) {
return false;
}
}
return true;
} | [
"public",
"boolean",
"contains",
"(",
"long",
"[",
"]",
"bitset",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"bitset",
".",
"length",
";",
"i",
"++",
")",
"{",
"final",
"long",
"b",
"=",
"bitset",
"[",
"i",
"]",
";",
"if",
"("... | Returns whether this BitVector contains all bits that are set to true in
the specified BitSet.
@param bitset the bits to inspect in this BitVector
@return true if this BitVector contains all bits that are set to true in
the specified BitSet, false otherwise | [
"Returns",
"whether",
"this",
"BitVector",
"contains",
"all",
"bits",
"that",
"are",
"set",
"to",
"true",
"in",
"the",
"specified",
"BitSet",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/BitVector.java#L177-L188 |
63,931 | elki-project/elki | elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/BitVector.java | BitVector.jaccardSimilarity | public double jaccardSimilarity(BitVector v2) {
return BitsUtil.intersectionSize(bits, v2.bits) / (double) BitsUtil.unionSize(bits, v2.bits);
} | java | public double jaccardSimilarity(BitVector v2) {
return BitsUtil.intersectionSize(bits, v2.bits) / (double) BitsUtil.unionSize(bits, v2.bits);
} | [
"public",
"double",
"jaccardSimilarity",
"(",
"BitVector",
"v2",
")",
"{",
"return",
"BitsUtil",
".",
"intersectionSize",
"(",
"bits",
",",
"v2",
".",
"bits",
")",
"/",
"(",
"double",
")",
"BitsUtil",
".",
"unionSize",
"(",
"bits",
",",
"v2",
".",
"bits"... | Compute the Jaccard similarity of two bit vectors.
@param v2 Second bit vector
@return Jaccard similarity (intersection / union) | [
"Compute",
"the",
"Jaccard",
"similarity",
"of",
"two",
"bit",
"vectors",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/BitVector.java#L214-L216 |
63,932 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.writeShort | public static int writeShort(byte[] array, int offset, int v) {
array[offset + 0] = (byte) (v >>> 8);
array[offset + 1] = (byte) (v >>> 0);
return SIZE_SHORT;
} | java | public static int writeShort(byte[] array, int offset, int v) {
array[offset + 0] = (byte) (v >>> 8);
array[offset + 1] = (byte) (v >>> 0);
return SIZE_SHORT;
} | [
"public",
"static",
"int",
"writeShort",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
",",
"int",
"v",
")",
"{",
"array",
"[",
"offset",
"+",
"0",
"]",
"=",
"(",
"byte",
")",
"(",
"v",
">>>",
"8",
")",
";",
"array",
"[",
"offset",
"+",... | Write a short to the byte array at the given offset.
@param array Array to write to
@param offset Offset to write to
@param v data
@return number of bytes written | [
"Write",
"a",
"short",
"to",
"the",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L106-L110 |
63,933 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.writeInt | public static int writeInt(byte[] array, int offset, int v) {
array[offset + 0] = (byte) (v >>> 24);
array[offset + 1] = (byte) (v >>> 16);
array[offset + 2] = (byte) (v >>> 8);
array[offset + 3] = (byte) (v >>> 0);
return SIZE_INT;
} | java | public static int writeInt(byte[] array, int offset, int v) {
array[offset + 0] = (byte) (v >>> 24);
array[offset + 1] = (byte) (v >>> 16);
array[offset + 2] = (byte) (v >>> 8);
array[offset + 3] = (byte) (v >>> 0);
return SIZE_INT;
} | [
"public",
"static",
"int",
"writeInt",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
",",
"int",
"v",
")",
"{",
"array",
"[",
"offset",
"+",
"0",
"]",
"=",
"(",
"byte",
")",
"(",
"v",
">>>",
"24",
")",
";",
"array",
"[",
"offset",
"+",
... | Write an integer to the byte array at the given offset.
@param array Array to write to
@param offset Offset to write to
@param v data
@return number of bytes written | [
"Write",
"an",
"integer",
"to",
"the",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L120-L126 |
63,934 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.writeLong | public static int writeLong(byte[] array, int offset, long v) {
array[offset + 0] = (byte) (v >>> 56);
array[offset + 1] = (byte) (v >>> 48);
array[offset + 2] = (byte) (v >>> 40);
array[offset + 3] = (byte) (v >>> 32);
array[offset + 4] = (byte) (v >>> 24);
array[offset + 5] = (byte) (v >>> 16)... | java | public static int writeLong(byte[] array, int offset, long v) {
array[offset + 0] = (byte) (v >>> 56);
array[offset + 1] = (byte) (v >>> 48);
array[offset + 2] = (byte) (v >>> 40);
array[offset + 3] = (byte) (v >>> 32);
array[offset + 4] = (byte) (v >>> 24);
array[offset + 5] = (byte) (v >>> 16)... | [
"public",
"static",
"int",
"writeLong",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
",",
"long",
"v",
")",
"{",
"array",
"[",
"offset",
"+",
"0",
"]",
"=",
"(",
"byte",
")",
"(",
"v",
">>>",
"56",
")",
";",
"array",
"[",
"offset",
"+"... | Write a long to the byte array at the given offset.
@param array Array to write to
@param offset Offset to write to
@param v data
@return number of bytes written | [
"Write",
"a",
"long",
"to",
"the",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L136-L146 |
63,935 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.writeFloat | public static int writeFloat(byte[] array, int offset, float v) {
return writeInt(array, offset, Float.floatToIntBits(v));
} | java | public static int writeFloat(byte[] array, int offset, float v) {
return writeInt(array, offset, Float.floatToIntBits(v));
} | [
"public",
"static",
"int",
"writeFloat",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
",",
"float",
"v",
")",
"{",
"return",
"writeInt",
"(",
"array",
",",
"offset",
",",
"Float",
".",
"floatToIntBits",
"(",
"v",
")",
")",
";",
"}"
] | Write a float to the byte array at the given offset.
@param array Array to write to
@param offset Offset to write to
@param v data
@return number of bytes written | [
"Write",
"a",
"float",
"to",
"the",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L156-L158 |
63,936 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.writeDouble | public static int writeDouble(byte[] array, int offset, double v) {
return writeLong(array, offset, Double.doubleToLongBits(v));
} | java | public static int writeDouble(byte[] array, int offset, double v) {
return writeLong(array, offset, Double.doubleToLongBits(v));
} | [
"public",
"static",
"int",
"writeDouble",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
",",
"double",
"v",
")",
"{",
"return",
"writeLong",
"(",
"array",
",",
"offset",
",",
"Double",
".",
"doubleToLongBits",
"(",
"v",
")",
")",
";",
"}"
] | Write a double to the byte array at the given offset.
@param array Array to write to
@param offset Offset to write to
@param v data
@return number of bytes written | [
"Write",
"a",
"double",
"to",
"the",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L168-L170 |
63,937 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.readShort | public static short readShort(byte[] array, int offset) {
// First make integers to resolve signed vs. unsigned issues.
int b0 = array[offset + 0] & 0xFF;
int b1 = array[offset + 1] & 0xFF;
return (short) ((b0 << 8) + (b1 << 0));
} | java | public static short readShort(byte[] array, int offset) {
// First make integers to resolve signed vs. unsigned issues.
int b0 = array[offset + 0] & 0xFF;
int b1 = array[offset + 1] & 0xFF;
return (short) ((b0 << 8) + (b1 << 0));
} | [
"public",
"static",
"short",
"readShort",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
")",
"{",
"// First make integers to resolve signed vs. unsigned issues.",
"int",
"b0",
"=",
"array",
"[",
"offset",
"+",
"0",
"]",
"&",
"0xFF",
";",
"int",
"b1",
... | Read a short from the byte array at the given offset.
@param array Array to read from
@param offset Offset to read at
@return (signed) short | [
"Read",
"a",
"short",
"from",
"the",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L179-L184 |
63,938 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.readUnsignedShort | public static int readUnsignedShort(byte[] array, int offset) {
// First make integers to resolve signed vs. unsigned issues.
int b0 = array[offset + 0] & 0xFF;
int b1 = array[offset + 1] & 0xFF;
return ((b0 << 8) + (b1 << 0));
} | java | public static int readUnsignedShort(byte[] array, int offset) {
// First make integers to resolve signed vs. unsigned issues.
int b0 = array[offset + 0] & 0xFF;
int b1 = array[offset + 1] & 0xFF;
return ((b0 << 8) + (b1 << 0));
} | [
"public",
"static",
"int",
"readUnsignedShort",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
")",
"{",
"// First make integers to resolve signed vs. unsigned issues.",
"int",
"b0",
"=",
"array",
"[",
"offset",
"+",
"0",
"]",
"&",
"0xFF",
";",
"int",
"... | Read an unsigned short from the byte array at the given offset.
@param array Array to read from
@param offset Offset to read at
@return short | [
"Read",
"an",
"unsigned",
"short",
"from",
"the",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L193-L198 |
63,939 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.readInt | public static int readInt(byte[] array, int offset) {
// First make integers to resolve signed vs. unsigned issues.
int b0 = array[offset + 0] & 0xFF;
int b1 = array[offset + 1] & 0xFF;
int b2 = array[offset + 2] & 0xFF;
int b3 = array[offset + 3] & 0xFF;
return ((b0 << 24) + (b1 << 16) + (b2 <<... | java | public static int readInt(byte[] array, int offset) {
// First make integers to resolve signed vs. unsigned issues.
int b0 = array[offset + 0] & 0xFF;
int b1 = array[offset + 1] & 0xFF;
int b2 = array[offset + 2] & 0xFF;
int b3 = array[offset + 3] & 0xFF;
return ((b0 << 24) + (b1 << 16) + (b2 <<... | [
"public",
"static",
"int",
"readInt",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
")",
"{",
"// First make integers to resolve signed vs. unsigned issues.",
"int",
"b0",
"=",
"array",
"[",
"offset",
"+",
"0",
"]",
"&",
"0xFF",
";",
"int",
"b1",
"="... | Read an integer from the byte array at the given offset.
@param array Array to read from
@param offset Offset to read at
@return data | [
"Read",
"an",
"integer",
"from",
"the",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L207-L214 |
63,940 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.readLong | public static long readLong(byte[] array, int offset) {
// First make integers to resolve signed vs. unsigned issues.
long b0 = array[offset + 0];
long b1 = array[offset + 1] & 0xFF;
long b2 = array[offset + 2] & 0xFF;
long b3 = array[offset + 3] & 0xFF;
long b4 = array[offset + 4] & 0xFF;
i... | java | public static long readLong(byte[] array, int offset) {
// First make integers to resolve signed vs. unsigned issues.
long b0 = array[offset + 0];
long b1 = array[offset + 1] & 0xFF;
long b2 = array[offset + 2] & 0xFF;
long b3 = array[offset + 3] & 0xFF;
long b4 = array[offset + 4] & 0xFF;
i... | [
"public",
"static",
"long",
"readLong",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
")",
"{",
"// First make integers to resolve signed vs. unsigned issues.",
"long",
"b0",
"=",
"array",
"[",
"offset",
"+",
"0",
"]",
";",
"long",
"b1",
"=",
"array",
... | Read a long from the byte array at the given offset.
@param array Array to read from
@param offset Offset to read at
@return data | [
"Read",
"a",
"long",
"from",
"the",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L223-L234 |
63,941 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.writeUnsignedVarint | public static void writeUnsignedVarint(ByteBuffer buffer, int val) {
// Extra bytes have the high bit set
while((val & 0x7F) != val) {
buffer.put((byte) ((val & 0x7F) | 0x80));
val >>>= 7;
}
// Last byte doesn't have high bit set
buffer.put((byte) (val & 0x7F));
} | java | public static void writeUnsignedVarint(ByteBuffer buffer, int val) {
// Extra bytes have the high bit set
while((val & 0x7F) != val) {
buffer.put((byte) ((val & 0x7F) | 0x80));
val >>>= 7;
}
// Last byte doesn't have high bit set
buffer.put((byte) (val & 0x7F));
} | [
"public",
"static",
"void",
"writeUnsignedVarint",
"(",
"ByteBuffer",
"buffer",
",",
"int",
"val",
")",
"{",
"// Extra bytes have the high bit set",
"while",
"(",
"(",
"val",
"&",
"0x7F",
")",
"!=",
"val",
")",
"{",
"buffer",
".",
"put",
"(",
"(",
"byte",
... | Write an unsigned integer using a variable-length encoding.
Data is always written in 7-bit little-endian, where the 8th bit is the
continuation flag.
@param buffer Buffer to write to
@param val number to write | [
"Write",
"an",
"unsigned",
"integer",
"using",
"a",
"variable",
"-",
"length",
"encoding",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L647-L655 |
63,942 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.writeUnsignedVarintLong | public static void writeUnsignedVarintLong(ByteBuffer buffer, long val) {
// Extra bytes have the high bit set
while((val & 0x7F) != val) {
buffer.put((byte) ((val & 0x7F) | 0x80));
val >>>= 7;
}
// Last byte doesn't have high bit set
buffer.put((byte) (val & 0x7F));
} | java | public static void writeUnsignedVarintLong(ByteBuffer buffer, long val) {
// Extra bytes have the high bit set
while((val & 0x7F) != val) {
buffer.put((byte) ((val & 0x7F) | 0x80));
val >>>= 7;
}
// Last byte doesn't have high bit set
buffer.put((byte) (val & 0x7F));
} | [
"public",
"static",
"void",
"writeUnsignedVarintLong",
"(",
"ByteBuffer",
"buffer",
",",
"long",
"val",
")",
"{",
"// Extra bytes have the high bit set",
"while",
"(",
"(",
"val",
"&",
"0x7F",
")",
"!=",
"val",
")",
"{",
"buffer",
".",
"put",
"(",
"(",
"byte... | Write an unsigned long using a variable-length encoding.
Data is always written in 7-bit little-endian, where the 8th bit is the
continuation flag.
Note that for integers, this will result in the same encoding as
{@link #writeUnsignedVarint}
@param buffer Buffer to write to
@param val number to write | [
"Write",
"an",
"unsigned",
"long",
"using",
"a",
"variable",
"-",
"length",
"encoding",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L669-L677 |
63,943 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.writeString | public static void writeString(ByteBuffer buffer, String s) throws IOException {
if(s == null) {
s = ""; // Which will be written as Varint 0 = single byte 0.
}
ByteArrayUtil.STRING_SERIALIZER.toByteBuffer(buffer, s);
} | java | public static void writeString(ByteBuffer buffer, String s) throws IOException {
if(s == null) {
s = ""; // Which will be written as Varint 0 = single byte 0.
}
ByteArrayUtil.STRING_SERIALIZER.toByteBuffer(buffer, s);
} | [
"public",
"static",
"void",
"writeString",
"(",
"ByteBuffer",
"buffer",
",",
"String",
"s",
")",
"throws",
"IOException",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"s",
"=",
"\"\"",
";",
"// Which will be written as Varint 0 = single byte 0.",
"}",
"ByteArray... | Write a string to the buffer.
See {@link StringSerializer} for details.
@param buffer Buffer to write to
@param s String to write | [
"Write",
"a",
"string",
"to",
"the",
"buffer",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L687-L692 |
63,944 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.readUnsignedVarint | public static int readUnsignedVarint(ByteBuffer buffer) throws IOException {
int val = 0;
int bits = 0;
while(true) {
final int data = buffer.get();
val |= (data & 0x7F) << bits;
if((data & 0x80) == 0) {
return val;
}
bits += 7;
if(bits > 35) {
throw new I... | java | public static int readUnsignedVarint(ByteBuffer buffer) throws IOException {
int val = 0;
int bits = 0;
while(true) {
final int data = buffer.get();
val |= (data & 0x7F) << bits;
if((data & 0x80) == 0) {
return val;
}
bits += 7;
if(bits > 35) {
throw new I... | [
"public",
"static",
"int",
"readUnsignedVarint",
"(",
"ByteBuffer",
"buffer",
")",
"throws",
"IOException",
"{",
"int",
"val",
"=",
"0",
";",
"int",
"bits",
"=",
"0",
";",
"while",
"(",
"true",
")",
"{",
"final",
"int",
"data",
"=",
"buffer",
".",
"get... | Read an unsigned integer.
@param buffer Buffer to read from
@return Integer value | [
"Read",
"an",
"unsigned",
"integer",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L775-L789 |
63,945 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.unmapByteBuffer | public static void unmapByteBuffer(final MappedByteBuffer map) {
if(map == null) {
return;
}
map.force();
try {
if(Runtime.class.getDeclaredMethod("version") != null)
return; // At later Java, the hack below will not work anymore.
}
catch(NoSuchMethodException e) {
// T... | java | public static void unmapByteBuffer(final MappedByteBuffer map) {
if(map == null) {
return;
}
map.force();
try {
if(Runtime.class.getDeclaredMethod("version") != null)
return; // At later Java, the hack below will not work anymore.
}
catch(NoSuchMethodException e) {
// T... | [
"public",
"static",
"void",
"unmapByteBuffer",
"(",
"final",
"MappedByteBuffer",
"map",
")",
"{",
"if",
"(",
"map",
"==",
"null",
")",
"{",
"return",
";",
"}",
"map",
".",
"force",
"(",
")",
";",
"try",
"{",
"if",
"(",
"Runtime",
".",
"class",
".",
... | Unmap a byte buffer.
@param map Byte buffer to unmap. | [
"Unmap",
"a",
"byte",
"buffer",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L842-L881 |
63,946 | elki-project/elki | addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/Parallel3DRenderer.java | Parallel3DRenderer.sortAxes | private void sortAxes() {
for(int d = 0; d < shared.dim; d++) {
double dist = shared.camera.squaredDistanceFromCamera(shared.layout.getNode(d).getX(), shared.layout.getNode(d).getY());
axes[d].first = -dist;
axes[d].second = d;
}
Arrays.sort(axes);
for(int i = 0; i < shared.dim; i++) {... | java | private void sortAxes() {
for(int d = 0; d < shared.dim; d++) {
double dist = shared.camera.squaredDistanceFromCamera(shared.layout.getNode(d).getX(), shared.layout.getNode(d).getY());
axes[d].first = -dist;
axes[d].second = d;
}
Arrays.sort(axes);
for(int i = 0; i < shared.dim; i++) {... | [
"private",
"void",
"sortAxes",
"(",
")",
"{",
"for",
"(",
"int",
"d",
"=",
"0",
";",
"d",
"<",
"shared",
".",
"dim",
";",
"d",
"++",
")",
"{",
"double",
"dist",
"=",
"shared",
".",
"camera",
".",
"squaredDistanceFromCamera",
"(",
"shared",
".",
"la... | Depth-sort the axes. | [
"Depth",
"-",
"sort",
"the",
"axes",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/Parallel3DRenderer.java#L453-L463 |
63,947 | elki-project/elki | addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/Parallel3DRenderer.java | Parallel3DRenderer.sortEdges | private IntIntPair[] sortEdges(int[] dindex) {
IntIntPair[] edgesort = new IntIntPair[shared.layout.edges.size()];
int e = 0;
for(Layout.Edge edge : shared.layout.edges) {
int i1 = dindex[edge.dim1], i2 = dindex[edge.dim2];
edgesort[e] = new IntIntPair(Math.min(i1, i2), e);
e++;
}
... | java | private IntIntPair[] sortEdges(int[] dindex) {
IntIntPair[] edgesort = new IntIntPair[shared.layout.edges.size()];
int e = 0;
for(Layout.Edge edge : shared.layout.edges) {
int i1 = dindex[edge.dim1], i2 = dindex[edge.dim2];
edgesort[e] = new IntIntPair(Math.min(i1, i2), e);
e++;
}
... | [
"private",
"IntIntPair",
"[",
"]",
"sortEdges",
"(",
"int",
"[",
"]",
"dindex",
")",
"{",
"IntIntPair",
"[",
"]",
"edgesort",
"=",
"new",
"IntIntPair",
"[",
"shared",
".",
"layout",
".",
"edges",
".",
"size",
"(",
")",
"]",
";",
"int",
"e",
"=",
"0... | Sort the edges for rendering.
FIXME: THIS STILL HAS ERRORS SOMETIME!
@param dindex depth index of axes.
@return Sorted array of (minaxis, edgeid) | [
"Sort",
"the",
"edges",
"for",
"rendering",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/Parallel3DRenderer.java#L473-L483 |
63,948 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/em/TwoPassMultivariateGaussianModel.java | TwoPassMultivariateGaussianModel.finalizeFirstPassE | @Override
public void finalizeFirstPassE() {
double s = 1. / wsum;
for(int i = 0; i < mean.length; i++) {
mean[i] *= s;
}
} | java | @Override
public void finalizeFirstPassE() {
double s = 1. / wsum;
for(int i = 0; i < mean.length; i++) {
mean[i] *= s;
}
} | [
"@",
"Override",
"public",
"void",
"finalizeFirstPassE",
"(",
")",
"{",
"double",
"s",
"=",
"1.",
"/",
"wsum",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"mean",
".",
"length",
";",
"i",
"++",
")",
"{",
"mean",
"[",
"i",
"]",
"*=",
... | Finish computation of the mean. | [
"Finish",
"computation",
"of",
"the",
"mean",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/em/TwoPassMultivariateGaussianModel.java#L155-L161 |
63,949 | elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/normalization/columnwise/AttributeWiseMeanNormalization.java | AttributeWiseMeanNormalization.restore | private double restore(int d, double val) {
d = (mean.length == 1) ? 0 : d;
return val * mean[d];
} | java | private double restore(int d, double val) {
d = (mean.length == 1) ? 0 : d;
return val * mean[d];
} | [
"private",
"double",
"restore",
"(",
"int",
"d",
",",
"double",
"val",
")",
"{",
"d",
"=",
"(",
"mean",
".",
"length",
"==",
"1",
")",
"?",
"0",
":",
"d",
";",
"return",
"val",
"*",
"mean",
"[",
"d",
"]",
";",
"}"
] | Restore a single dimension.
@param d Dimension
@param val Value
@return Normalized value | [
"Restore",
"a",
"single",
"dimension",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/normalization/columnwise/AttributeWiseMeanNormalization.java#L162-L165 |
63,950 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/OUTRES.java | OUTRES.run | public OutlierResult run(Relation<? extends NumberVector> relation) {
final DBIDs ids = relation.getDBIDs();
WritableDoubleDataStore ranks = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_STATIC);
DoubleMinMax minmax = new DoubleMinMax();
KernelDensityEstimator kernel = new KernelDensityEst... | java | public OutlierResult run(Relation<? extends NumberVector> relation) {
final DBIDs ids = relation.getDBIDs();
WritableDoubleDataStore ranks = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_STATIC);
DoubleMinMax minmax = new DoubleMinMax();
KernelDensityEstimator kernel = new KernelDensityEst... | [
"public",
"OutlierResult",
"run",
"(",
"Relation",
"<",
"?",
"extends",
"NumberVector",
">",
"relation",
")",
"{",
"final",
"DBIDs",
"ids",
"=",
"relation",
".",
"getDBIDs",
"(",
")",
";",
"WritableDoubleDataStore",
"ranks",
"=",
"DataStoreUtil",
".",
"makeDou... | Main loop for OUTRES
@param relation Relation to process
@return Outlier detection result | [
"Main",
"loop",
"for",
"OUTRES"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/OUTRES.java#L118-L139 |
63,951 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/OUTRES.java | OUTRES.outresScore | public double outresScore(final int s, long[] subspace, DBIDRef id, KernelDensityEstimator kernel, DBIDs cands) {
double score = 1.0; // Initial score is 1.0
final SubspaceEuclideanDistanceFunction df = new SubspaceEuclideanDistanceFunction(subspace);
MeanVariance meanv = new MeanVariance();
ModifiableD... | java | public double outresScore(final int s, long[] subspace, DBIDRef id, KernelDensityEstimator kernel, DBIDs cands) {
double score = 1.0; // Initial score is 1.0
final SubspaceEuclideanDistanceFunction df = new SubspaceEuclideanDistanceFunction(subspace);
MeanVariance meanv = new MeanVariance();
ModifiableD... | [
"public",
"double",
"outresScore",
"(",
"final",
"int",
"s",
",",
"long",
"[",
"]",
"subspace",
",",
"DBIDRef",
"id",
",",
"KernelDensityEstimator",
"kernel",
",",
"DBIDs",
"cands",
")",
"{",
"double",
"score",
"=",
"1.0",
";",
"// Initial score is 1.0",
"fi... | Main loop of OUTRES. Run for each object
@param s start dimension
@param subspace Current subspace
@param id Current object ID
@param kernel Kernel
@param cands neighbor candidates
@return Score | [
"Main",
"loop",
"of",
"OUTRES",
".",
"Run",
"for",
"each",
"object"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/OUTRES.java#L151-L186 |
63,952 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/OUTRES.java | OUTRES.initialRange | private DoubleDBIDList initialRange(DBIDRef obj, DBIDs cands, PrimitiveDistanceFunction<? super NumberVector> df, double eps, KernelDensityEstimator kernel, ModifiableDoubleDBIDList n) {
n.clear();
NumberVector o = kernel.relation.get(obj);
final double twoeps = eps * 2;
int matches = 0;
for(DBIDIte... | java | private DoubleDBIDList initialRange(DBIDRef obj, DBIDs cands, PrimitiveDistanceFunction<? super NumberVector> df, double eps, KernelDensityEstimator kernel, ModifiableDoubleDBIDList n) {
n.clear();
NumberVector o = kernel.relation.get(obj);
final double twoeps = eps * 2;
int matches = 0;
for(DBIDIte... | [
"private",
"DoubleDBIDList",
"initialRange",
"(",
"DBIDRef",
"obj",
",",
"DBIDs",
"cands",
",",
"PrimitiveDistanceFunction",
"<",
"?",
"super",
"NumberVector",
">",
"df",
",",
"double",
"eps",
",",
"KernelDensityEstimator",
"kernel",
",",
"ModifiableDoubleDBIDList",
... | Initial range query.
@param obj Object
@param cands Candidates
@param df Distance function
@param eps Epsilon radius
@param kernel Kernel
@param n Output buffer
@return Neighbors | [
"Initial",
"range",
"query",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/OUTRES.java#L199-L215 |
63,953 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/OUTRES.java | OUTRES.subsetNeighborhoodQuery | private DoubleDBIDList subsetNeighborhoodQuery(DoubleDBIDList neighc, DBIDRef dbid, PrimitiveDistanceFunction<? super NumberVector> df, double adjustedEps, KernelDensityEstimator kernel, ModifiableDoubleDBIDList n) {
n.clear();
NumberVector query = kernel.relation.get(dbid);
for(DoubleDBIDListIter neighbor ... | java | private DoubleDBIDList subsetNeighborhoodQuery(DoubleDBIDList neighc, DBIDRef dbid, PrimitiveDistanceFunction<? super NumberVector> df, double adjustedEps, KernelDensityEstimator kernel, ModifiableDoubleDBIDList n) {
n.clear();
NumberVector query = kernel.relation.get(dbid);
for(DoubleDBIDListIter neighbor ... | [
"private",
"DoubleDBIDList",
"subsetNeighborhoodQuery",
"(",
"DoubleDBIDList",
"neighc",
",",
"DBIDRef",
"dbid",
",",
"PrimitiveDistanceFunction",
"<",
"?",
"super",
"NumberVector",
">",
"df",
",",
"double",
"adjustedEps",
",",
"KernelDensityEstimator",
"kernel",
",",
... | Refine neighbors within a subset.
@param neighc Neighbor candidates
@param dbid Query object
@param df distance function
@param adjustedEps Epsilon range
@param kernel Kernel
@param n Output list
@return Neighbors of neighbor object | [
"Refine",
"neighbors",
"within",
"a",
"subset",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/OUTRES.java#L228-L239 |
63,954 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/OUTRES.java | OUTRES.relevantSubspace | protected boolean relevantSubspace(long[] subspace, DoubleDBIDList neigh, KernelDensityEstimator kernel) {
final double crit = K_S_CRITICAL001 / FastMath.sqrt(neigh.size() - 2);
double[] data = new double[neigh.size()];
Relation<? extends NumberVector> relation = kernel.relation;
for(int dim = BitsUtil... | java | protected boolean relevantSubspace(long[] subspace, DoubleDBIDList neigh, KernelDensityEstimator kernel) {
final double crit = K_S_CRITICAL001 / FastMath.sqrt(neigh.size() - 2);
double[] data = new double[neigh.size()];
Relation<? extends NumberVector> relation = kernel.relation;
for(int dim = BitsUtil... | [
"protected",
"boolean",
"relevantSubspace",
"(",
"long",
"[",
"]",
"subspace",
",",
"DoubleDBIDList",
"neigh",
",",
"KernelDensityEstimator",
"kernel",
")",
"{",
"final",
"double",
"crit",
"=",
"K_S_CRITICAL001",
"/",
"FastMath",
".",
"sqrt",
"(",
"neigh",
".",
... | Subspace relevance test.
@param subspace Subspace to test
@param neigh Neighbor list
@param kernel Kernel density estimator
@return relevance test result | [
"Subspace",
"relevance",
"test",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/OUTRES.java#L249-L277 |
63,955 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/Mean.java | Mean.of | public static double of(double... data) {
double sum = 0.;
for(double v : data) {
sum += v;
}
return sum / data.length;
} | java | public static double of(double... data) {
double sum = 0.;
for(double v : data) {
sum += v;
}
return sum / data.length;
} | [
"public",
"static",
"double",
"of",
"(",
"double",
"...",
"data",
")",
"{",
"double",
"sum",
"=",
"0.",
";",
"for",
"(",
"double",
"v",
":",
"data",
")",
"{",
"sum",
"+=",
"v",
";",
"}",
"return",
"sum",
"/",
"data",
".",
"length",
";",
"}"
] | Static helper function.
@param data Data to compute the mean for.
@return Mean | [
"Static",
"helper",
"function",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/Mean.java#L185-L191 |
63,956 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/Mean.java | Mean.highPrecision | @Reference(authors = "P. M. Neely", //
title = "Comparison of Several Algorithms for Computation of Means, Standard Deviations and Correlation Coefficients", //
booktitle = "Communications of the ACM 9(7), 1966", //
url = "https://doi.org/10.1145/365719.365958", //
bibkey = "doi:10.1145/365719.3... | java | @Reference(authors = "P. M. Neely", //
title = "Comparison of Several Algorithms for Computation of Means, Standard Deviations and Correlation Coefficients", //
booktitle = "Communications of the ACM 9(7), 1966", //
url = "https://doi.org/10.1145/365719.365958", //
bibkey = "doi:10.1145/365719.3... | [
"@",
"Reference",
"(",
"authors",
"=",
"\"P. M. Neely\"",
",",
"//",
"title",
"=",
"\"Comparison of Several Algorithms for Computation of Means, Standard Deviations and Correlation Coefficients\"",
",",
"//",
"booktitle",
"=",
"\"Communications of the ACM 9(7), 1966\"",
",",
"//",
... | Static helper function, with extra precision
@param data Data to compute the mean for.
@return Mean | [
"Static",
"helper",
"function",
"with",
"extra",
"precision"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/Mean.java#L199-L217 |
63,957 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/AbstractMTree.java | AbstractMTree.insertAll | public void insertAll(List<E> entries) {
if(!initialized && !entries.isEmpty()) {
initialize(entries.get(0));
}
for(E entry : entries) {
insert(entry, false);
}
} | java | public void insertAll(List<E> entries) {
if(!initialized && !entries.isEmpty()) {
initialize(entries.get(0));
}
for(E entry : entries) {
insert(entry, false);
}
} | [
"public",
"void",
"insertAll",
"(",
"List",
"<",
"E",
">",
"entries",
")",
"{",
"if",
"(",
"!",
"initialized",
"&&",
"!",
"entries",
".",
"isEmpty",
"(",
")",
")",
"{",
"initialize",
"(",
"entries",
".",
"get",
"(",
"0",
")",
")",
";",
"}",
"for"... | Bulk insert.
@param entries Entries to insert | [
"Bulk",
"insert",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/AbstractMTree.java#L199-L206 |
63,958 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/AbstractMTree.java | AbstractMTree.getSortedEntries | protected final List<DoubleIntPair> getSortedEntries(N node, DBID q) {
List<DoubleIntPair> result = new ArrayList<>();
for(int i = 0; i < node.getNumEntries(); i++) {
E entry = node.getEntry(i);
double distance = distance(entry.getRoutingObjectID(), q);
double radius = entry.getCoveringRadius... | java | protected final List<DoubleIntPair> getSortedEntries(N node, DBID q) {
List<DoubleIntPair> result = new ArrayList<>();
for(int i = 0; i < node.getNumEntries(); i++) {
E entry = node.getEntry(i);
double distance = distance(entry.getRoutingObjectID(), q);
double radius = entry.getCoveringRadius... | [
"protected",
"final",
"List",
"<",
"DoubleIntPair",
">",
"getSortedEntries",
"(",
"N",
"node",
",",
"DBID",
"q",
")",
"{",
"List",
"<",
"DoubleIntPair",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";... | Sorts the entries of the specified node according to their minimum distance
to the specified object.
@param node the node
@param q the id of the object
@return a list of the sorted entries | [
"Sorts",
"the",
"entries",
"of",
"the",
"specified",
"node",
"according",
"to",
"their",
"minimum",
"distance",
"to",
"the",
"specified",
"object",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/AbstractMTree.java#L221-L235 |
63,959 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/AbstractMTree.java | AbstractMTree.distance | public final double distance(E e1, E e2) {
return distance(e1.getRoutingObjectID(), e2.getRoutingObjectID());
} | java | public final double distance(E e1, E e2) {
return distance(e1.getRoutingObjectID(), e2.getRoutingObjectID());
} | [
"public",
"final",
"double",
"distance",
"(",
"E",
"e1",
",",
"E",
"e2",
")",
"{",
"return",
"distance",
"(",
"e1",
".",
"getRoutingObjectID",
"(",
")",
",",
"e2",
".",
"getRoutingObjectID",
"(",
")",
")",
";",
"}"
] | Returns the distance between the routing object of two entries.
@param e1 First entry
@param e2 Second entry
@return the distance between the two routing objects | [
"Returns",
"the",
"distance",
"between",
"the",
"routing",
"object",
"of",
"two",
"entries",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/AbstractMTree.java#L253-L255 |
63,960 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/ProbabilityWeightedMoments.java | ProbabilityWeightedMoments.alphaPWM | public static <A> double[] alphaPWM(A data, NumberArrayAdapter<?, A> adapter, final int nmom) {
final int n = adapter.size(data);
final double[] xmom = new double[nmom];
double weight = 1. / n;
for(int i = 0; i < n; i++) {
final double val = adapter.getDouble(data, i);
xmom[0] += weight * va... | java | public static <A> double[] alphaPWM(A data, NumberArrayAdapter<?, A> adapter, final int nmom) {
final int n = adapter.size(data);
final double[] xmom = new double[nmom];
double weight = 1. / n;
for(int i = 0; i < n; i++) {
final double val = adapter.getDouble(data, i);
xmom[0] += weight * va... | [
"public",
"static",
"<",
"A",
">",
"double",
"[",
"]",
"alphaPWM",
"(",
"A",
"data",
",",
"NumberArrayAdapter",
"<",
"?",
",",
"A",
">",
"adapter",
",",
"final",
"int",
"nmom",
")",
"{",
"final",
"int",
"n",
"=",
"adapter",
".",
"size",
"(",
"data"... | Compute the alpha_r factors using the method of probability-weighted
moments.
@param data <b>Presorted</b> data array.
@param adapter Array adapter.
@param nmom Number of moments to compute
@return Alpha moments (0-indexed) | [
"Compute",
"the",
"alpha_r",
"factors",
"using",
"the",
"method",
"of",
"probability",
"-",
"weighted",
"moments",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/ProbabilityWeightedMoments.java#L71-L84 |
63,961 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/ProbabilityWeightedMoments.java | ProbabilityWeightedMoments.alphaBetaPWM | public static <A> double[] alphaBetaPWM(A data, NumberArrayAdapter<?, A> adapter, final int nmom) {
final int n = adapter.size(data);
final double[] xmom = new double[nmom << 1];
double aweight = 1. / n, bweight = aweight;
for(int i = 0; i < n; i++) {
final double val = adapter.getDouble(data, i);... | java | public static <A> double[] alphaBetaPWM(A data, NumberArrayAdapter<?, A> adapter, final int nmom) {
final int n = adapter.size(data);
final double[] xmom = new double[nmom << 1];
double aweight = 1. / n, bweight = aweight;
for(int i = 0; i < n; i++) {
final double val = adapter.getDouble(data, i);... | [
"public",
"static",
"<",
"A",
">",
"double",
"[",
"]",
"alphaBetaPWM",
"(",
"A",
"data",
",",
"NumberArrayAdapter",
"<",
"?",
",",
"A",
">",
"adapter",
",",
"final",
"int",
"nmom",
")",
"{",
"final",
"int",
"n",
"=",
"adapter",
".",
"size",
"(",
"d... | Compute the alpha_r and beta_r factors in parallel using the method of
probability-weighted moments. Usually cheaper than computing them
separately.
@param data <b>Presorted</b> data array.
@param adapter Array adapter.
@param nmom Number of moments to compute
@return Alpha and Beta moments (0-indexed, interleaved) | [
"Compute",
"the",
"alpha_r",
"and",
"beta_r",
"factors",
"in",
"parallel",
"using",
"the",
"method",
"of",
"probability",
"-",
"weighted",
"moments",
".",
"Usually",
"cheaper",
"than",
"computing",
"them",
"separately",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/ProbabilityWeightedMoments.java#L120-L136 |
63,962 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/ProbabilityWeightedMoments.java | ProbabilityWeightedMoments.samLMR | public static <A> double[] samLMR(A sorted, NumberArrayAdapter<?, A> adapter, int nmom) {
final int n = adapter.size(sorted);
final double[] sum = new double[nmom];
nmom = n < nmom ? n : nmom;
// Estimate probability weighted moments (unbiased)
for(int i = 0; i < n; i++) {
double term = adapte... | java | public static <A> double[] samLMR(A sorted, NumberArrayAdapter<?, A> adapter, int nmom) {
final int n = adapter.size(sorted);
final double[] sum = new double[nmom];
nmom = n < nmom ? n : nmom;
// Estimate probability weighted moments (unbiased)
for(int i = 0; i < n; i++) {
double term = adapte... | [
"public",
"static",
"<",
"A",
">",
"double",
"[",
"]",
"samLMR",
"(",
"A",
"sorted",
",",
"NumberArrayAdapter",
"<",
"?",
",",
"A",
">",
"adapter",
",",
"int",
"nmom",
")",
"{",
"final",
"int",
"n",
"=",
"adapter",
".",
"size",
"(",
"sorted",
")",
... | Compute the sample L-Moments using probability weighted moments.
@param sorted <b>Presorted</b> data array.
@param adapter Array adapter.
@param nmom Number of moments to compute
@return Array containing Lambda1, Lambda2, Tau3 ... TauN | [
"Compute",
"the",
"sample",
"L",
"-",
"Moments",
"using",
"probability",
"weighted",
"moments",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/ProbabilityWeightedMoments.java#L146-L183 |
63,963 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/ProbabilityWeightedMoments.java | ProbabilityWeightedMoments.normalizeLMR | private static void normalizeLMR(double[] sum, int nmom) {
for(int k = nmom - 1; k >= 1; --k) {
double p = ((k & 1) == 0) ? +1 : -1;
double temp = p * sum[0];
for(int i = 0; i < k; i++) {
double ai = i + 1.;
p *= -(k + ai) * (k - i) / (ai * ai);
temp += p * sum[i + 1];
... | java | private static void normalizeLMR(double[] sum, int nmom) {
for(int k = nmom - 1; k >= 1; --k) {
double p = ((k & 1) == 0) ? +1 : -1;
double temp = p * sum[0];
for(int i = 0; i < k; i++) {
double ai = i + 1.;
p *= -(k + ai) * (k - i) / (ai * ai);
temp += p * sum[i + 1];
... | [
"private",
"static",
"void",
"normalizeLMR",
"(",
"double",
"[",
"]",
"sum",
",",
"int",
"nmom",
")",
"{",
"for",
"(",
"int",
"k",
"=",
"nmom",
"-",
"1",
";",
"k",
">=",
"1",
";",
"--",
"k",
")",
"{",
"double",
"p",
"=",
"(",
"(",
"k",
"&",
... | Normalize the moments
@param sum Sums
@param nmom Number of moments | [
"Normalize",
"the",
"moments"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/ProbabilityWeightedMoments.java#L191-L202 |
63,964 | elki-project/elki | elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/FPGrowth.java | FPGrowth.countItemSupport | private int[] countItemSupport(final Relation<BitVector> relation, final int dim) {
final int[] counts = new int[dim];
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Finding frequent 1-items", relation.size(), LOG) : null;
for(DBIDIter iditer = relation.iterDBIDs(); iditer.valid(); iditer.advan... | java | private int[] countItemSupport(final Relation<BitVector> relation, final int dim) {
final int[] counts = new int[dim];
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Finding frequent 1-items", relation.size(), LOG) : null;
for(DBIDIter iditer = relation.iterDBIDs(); iditer.valid(); iditer.advan... | [
"private",
"int",
"[",
"]",
"countItemSupport",
"(",
"final",
"Relation",
"<",
"BitVector",
">",
"relation",
",",
"final",
"int",
"dim",
")",
"{",
"final",
"int",
"[",
"]",
"counts",
"=",
"new",
"int",
"[",
"dim",
"]",
";",
"FiniteProgress",
"prog",
"=... | Count the support of each 1-item.
@param relation Data
@param dim Maximum dimensionality
@return Item counts | [
"Count",
"the",
"support",
"of",
"each",
"1",
"-",
"item",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/FPGrowth.java#L194-L207 |
63,965 | elki-project/elki | elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/FPGrowth.java | FPGrowth.buildFPTree | private FPTree buildFPTree(final Relation<BitVector> relation, int[] iidx, final int items) {
FPTree tree = new FPTree(items);
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Building FP-tree", relation.size(), LOG) : null;
int[] buf = new int[items];
for(DBIDIter iditer = relation.iterDBIDs... | java | private FPTree buildFPTree(final Relation<BitVector> relation, int[] iidx, final int items) {
FPTree tree = new FPTree(items);
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Building FP-tree", relation.size(), LOG) : null;
int[] buf = new int[items];
for(DBIDIter iditer = relation.iterDBIDs... | [
"private",
"FPTree",
"buildFPTree",
"(",
"final",
"Relation",
"<",
"BitVector",
">",
"relation",
",",
"int",
"[",
"]",
"iidx",
",",
"final",
"int",
"items",
")",
"{",
"FPTree",
"tree",
"=",
"new",
"FPTree",
"(",
"items",
")",
";",
"FiniteProgress",
"prog... | Build the actual FP-tree structure.
@param relation Data
@param iidx Inverse index (dimension to item rank)
@param items Number of items
@return FP-tree | [
"Build",
"the",
"actual",
"FP",
"-",
"tree",
"structure",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/FPGrowth.java#L217-L241 |
63,966 | elki-project/elki | elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/associationrules/AssociationRule.java | AssociationRule.appendTo | public StringBuilder appendTo(StringBuilder buf, VectorFieldTypeInformation<BitVector> meta) {
this.antecedent.appendTo(buf, meta);
buf.append(" --> ");
this.consequent.appendItemsTo(buf, meta);
buf.append(": ");
buf.append(union.getSupport());
buf.append(" : ");
buf.append(this.measure);
... | java | public StringBuilder appendTo(StringBuilder buf, VectorFieldTypeInformation<BitVector> meta) {
this.antecedent.appendTo(buf, meta);
buf.append(" --> ");
this.consequent.appendItemsTo(buf, meta);
buf.append(": ");
buf.append(union.getSupport());
buf.append(" : ");
buf.append(this.measure);
... | [
"public",
"StringBuilder",
"appendTo",
"(",
"StringBuilder",
"buf",
",",
"VectorFieldTypeInformation",
"<",
"BitVector",
">",
"meta",
")",
"{",
"this",
".",
"antecedent",
".",
"appendTo",
"(",
"buf",
",",
"meta",
")",
";",
"buf",
".",
"append",
"(",
"\" --> ... | Append to a string buffer.
@param buf Buffer
@param meta Relation metadata (for labels)
@return String buffer for chaining. | [
"Append",
"to",
"a",
"string",
"buffer",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/associationrules/AssociationRule.java#L123-L132 |
63,967 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/ClusterContingencyTable.java | ClusterContingencyTable.process | public void process(Clustering<?> result1, Clustering<?> result2) {
// Get the clusters
final List<? extends Cluster<?>> cs1 = result1.getAllClusters();
final List<? extends Cluster<?>> cs2 = result2.getAllClusters();
// Initialize
size1 = cs1.size();
size2 = cs2.size();
contingency = new i... | java | public void process(Clustering<?> result1, Clustering<?> result2) {
// Get the clusters
final List<? extends Cluster<?>> cs1 = result1.getAllClusters();
final List<? extends Cluster<?>> cs2 = result2.getAllClusters();
// Initialize
size1 = cs1.size();
size2 = cs2.size();
contingency = new i... | [
"public",
"void",
"process",
"(",
"Clustering",
"<",
"?",
">",
"result1",
",",
"Clustering",
"<",
"?",
">",
"result2",
")",
"{",
"// Get the clusters",
"final",
"List",
"<",
"?",
"extends",
"Cluster",
"<",
"?",
">",
">",
"cs1",
"=",
"result1",
".",
"ge... | Process two clustering results.
@param result1 First clustering
@param result2 Second clustering | [
"Process",
"two",
"clustering",
"results",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/ClusterContingencyTable.java#L117-L161 |
63,968 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/meta/FeatureBagging.java | FeatureBagging.randomSubspace | private long[] randomSubspace(final int alldim, final int mindim, final int maxdim, final Random rand) {
long[] dimset = BitsUtil.zero(alldim);
// Fill with all dimensions
int[] dims = new int[alldim];
for(int d = 0; d < alldim; d++) {
dims[d] = d;
}
// Target dimensionality:
int subdi... | java | private long[] randomSubspace(final int alldim, final int mindim, final int maxdim, final Random rand) {
long[] dimset = BitsUtil.zero(alldim);
// Fill with all dimensions
int[] dims = new int[alldim];
for(int d = 0; d < alldim; d++) {
dims[d] = d;
}
// Target dimensionality:
int subdi... | [
"private",
"long",
"[",
"]",
"randomSubspace",
"(",
"final",
"int",
"alldim",
",",
"final",
"int",
"mindim",
",",
"final",
"int",
"maxdim",
",",
"final",
"Random",
"rand",
")",
"{",
"long",
"[",
"]",
"dimset",
"=",
"BitsUtil",
".",
"zero",
"(",
"alldim... | Choose a random subspace.
@param alldim Number of total dimensions
@param mindim Minimum number to choose
@param maxdim Maximum number to choose
@return Subspace as bits. | [
"Choose",
"a",
"random",
"subspace",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/meta/FeatureBagging.java#L224-L240 |
63,969 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGCheckbox.java | SVGCheckbox.renderCheckBox | public Element renderCheckBox(SVGPlot svgp, double x, double y, double size) {
// create check
final Element checkmark = SVGEffects.makeCheckmark(svgp);
checkmark.setAttribute(SVGConstants.SVG_TRANSFORM_ATTRIBUTE, "scale(" + (size / 12) + ") translate(" + x + " " + y + ")");
if(!checked) {
checkma... | java | public Element renderCheckBox(SVGPlot svgp, double x, double y, double size) {
// create check
final Element checkmark = SVGEffects.makeCheckmark(svgp);
checkmark.setAttribute(SVGConstants.SVG_TRANSFORM_ATTRIBUTE, "scale(" + (size / 12) + ") translate(" + x + " " + y + ")");
if(!checked) {
checkma... | [
"public",
"Element",
"renderCheckBox",
"(",
"SVGPlot",
"svgp",
",",
"double",
"x",
",",
"double",
"y",
",",
"double",
"size",
")",
"{",
"// create check",
"final",
"Element",
"checkmark",
"=",
"SVGEffects",
".",
"makeCheckmark",
"(",
"svgp",
")",
";",
"check... | Render the SVG checkbox to a plot
@param svgp Plot to draw to
@param x X offset
@param y Y offset
@param size Size factor
@return Container element | [
"Render",
"the",
"SVG",
"checkbox",
"to",
"a",
"plot"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGCheckbox.java#L84-L125 |
63,970 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGCheckbox.java | SVGCheckbox.fireSwitchEvent | protected void fireSwitchEvent(ChangeEvent evt) {
Object[] listeners = listenerList.getListenerList();
for(int i = 1; i < listeners.length; i += 2) {
if(listeners[i - 1] == ChangeListener.class) {
((ChangeListener) listeners[i]).stateChanged(evt);
}
}
} | java | protected void fireSwitchEvent(ChangeEvent evt) {
Object[] listeners = listenerList.getListenerList();
for(int i = 1; i < listeners.length; i += 2) {
if(listeners[i - 1] == ChangeListener.class) {
((ChangeListener) listeners[i]).stateChanged(evt);
}
}
} | [
"protected",
"void",
"fireSwitchEvent",
"(",
"ChangeEvent",
"evt",
")",
"{",
"Object",
"[",
"]",
"listeners",
"=",
"listenerList",
".",
"getListenerList",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"listeners",
".",
"length",
";",
... | Fire the event to listeners
@param evt Event to fire | [
"Fire",
"the",
"event",
"to",
"listeners"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGCheckbox.java#L159-L166 |
63,971 | elki-project/elki | elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/vafile/PartialVAFile.java | PartialVAFile.calculateSelectivityCoeffs | protected static void calculateSelectivityCoeffs(List<DoubleObjPair<DAFile>> daFiles, NumberVector query, double epsilon) {
final int dimensions = query.getDimensionality();
double[] lowerVals = new double[dimensions];
double[] upperVals = new double[dimensions];
VectorApproximation queryApprox = calcu... | java | protected static void calculateSelectivityCoeffs(List<DoubleObjPair<DAFile>> daFiles, NumberVector query, double epsilon) {
final int dimensions = query.getDimensionality();
double[] lowerVals = new double[dimensions];
double[] upperVals = new double[dimensions];
VectorApproximation queryApprox = calcu... | [
"protected",
"static",
"void",
"calculateSelectivityCoeffs",
"(",
"List",
"<",
"DoubleObjPair",
"<",
"DAFile",
">",
">",
"daFiles",
",",
"NumberVector",
"query",
",",
"double",
"epsilon",
")",
"{",
"final",
"int",
"dimensions",
"=",
"query",
".",
"getDimensional... | Calculate selectivity coefficients.
@param daFiles List of files to use
@param query Query vector
@param epsilon Epsilon radius | [
"Calculate",
"selectivity",
"coefficients",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/vafile/PartialVAFile.java#L264-L287 |
63,972 | elki-project/elki | elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/vafile/PartialVAFile.java | PartialVAFile.calculatePartialApproximation | protected static VectorApproximation calculatePartialApproximation(DBID id, NumberVector dv, List<DoubleObjPair<DAFile>> daFiles) {
int[] approximation = new int[dv.getDimensionality()];
for(int i = 0; i < daFiles.size(); i++) {
double val = dv.doubleValue(i);
double[] borders = daFiles.get(i).secon... | java | protected static VectorApproximation calculatePartialApproximation(DBID id, NumberVector dv, List<DoubleObjPair<DAFile>> daFiles) {
int[] approximation = new int[dv.getDimensionality()];
for(int i = 0; i < daFiles.size(); i++) {
double val = dv.doubleValue(i);
double[] borders = daFiles.get(i).secon... | [
"protected",
"static",
"VectorApproximation",
"calculatePartialApproximation",
"(",
"DBID",
"id",
",",
"NumberVector",
"dv",
",",
"List",
"<",
"DoubleObjPair",
"<",
"DAFile",
">",
">",
"daFiles",
")",
"{",
"int",
"[",
"]",
"approximation",
"=",
"new",
"int",
"... | Calculate partial vector approximation.
@param id Object ID
@param dv Object vector
@param daFiles List of approximations to use
@return Vector approximation | [
"Calculate",
"partial",
"vector",
"approximation",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/vafile/PartialVAFile.java#L297-L321 |
63,973 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java | LinearEquationSystem.solutionToString | public String solutionToString(int fractionDigits) {
if(!isSolvable()) {
throw new IllegalStateException("System is not solvable!");
}
DecimalFormat nf = new DecimalFormat();
nf.setMinimumFractionDigits(fractionDigits);
nf.setMaximumFractionDigits(fractionDigits);
nf.setDecimalFormatSymbo... | java | public String solutionToString(int fractionDigits) {
if(!isSolvable()) {
throw new IllegalStateException("System is not solvable!");
}
DecimalFormat nf = new DecimalFormat();
nf.setMinimumFractionDigits(fractionDigits);
nf.setMaximumFractionDigits(fractionDigits);
nf.setDecimalFormatSymbo... | [
"public",
"String",
"solutionToString",
"(",
"int",
"fractionDigits",
")",
"{",
"if",
"(",
"!",
"isSolvable",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"System is not solvable!\"",
")",
";",
"}",
"DecimalFormat",
"nf",
"=",
"new",
"De... | Returns a string representation of the solution of this equation system.
@param fractionDigits precision
@return a string representation of the solution of this equation system | [
"Returns",
"a",
"string",
"representation",
"of",
"the",
"solution",
"of",
"this",
"equation",
"system",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java#L347-L384 |
63,974 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java | LinearEquationSystem.reducedRowEchelonForm | private void reducedRowEchelonForm(int method) {
final int rows = coeff.length;
final int cols = coeff[0].length;
int k = -1; // denotes current position on diagonal
int pivotRow; // row index of pivot element
int pivotCol; // column index of pivot element
double pivot; // value of pivot elemen... | java | private void reducedRowEchelonForm(int method) {
final int rows = coeff.length;
final int cols = coeff[0].length;
int k = -1; // denotes current position on diagonal
int pivotRow; // row index of pivot element
int pivotCol; // column index of pivot element
double pivot; // value of pivot elemen... | [
"private",
"void",
"reducedRowEchelonForm",
"(",
"int",
"method",
")",
"{",
"final",
"int",
"rows",
"=",
"coeff",
".",
"length",
";",
"final",
"int",
"cols",
"=",
"coeff",
"[",
"0",
"]",
".",
"length",
";",
"int",
"k",
"=",
"-",
"1",
";",
"// denotes... | Brings this linear equation system into reduced row echelon form with
choice of pivot method.
@param method the pivot search method to use | [
"Brings",
"this",
"linear",
"equation",
"system",
"into",
"reduced",
"row",
"echelon",
"form",
"with",
"choice",
"of",
"pivot",
"method",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java#L392-L463 |
63,975 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java | LinearEquationSystem.nonZeroPivotSearch | private IntIntPair nonZeroPivotSearch(int k) {
int i, j;
double absValue;
for(i = k; i < coeff.length; i++) {
for(j = k; j < coeff[0].length; j++) {
// compute absolute value of
// current entry in absValue
absValue = Math.abs(coeff[row[i]][col[j]]);
// check if absVa... | java | private IntIntPair nonZeroPivotSearch(int k) {
int i, j;
double absValue;
for(i = k; i < coeff.length; i++) {
for(j = k; j < coeff[0].length; j++) {
// compute absolute value of
// current entry in absValue
absValue = Math.abs(coeff[row[i]][col[j]]);
// check if absVa... | [
"private",
"IntIntPair",
"nonZeroPivotSearch",
"(",
"int",
"k",
")",
"{",
"int",
"i",
",",
"j",
";",
"double",
"absValue",
";",
"for",
"(",
"i",
"=",
"k",
";",
"i",
"<",
"coeff",
".",
"length",
";",
"i",
"++",
")",
"{",
"for",
"(",
"j",
"=",
"k... | Method for trivial pivot search, searches for non-zero entry.
@param k search starts at entry (k,k)
@return the position of the found pivot element | [
"Method",
"for",
"trivial",
"pivot",
"search",
"searches",
"for",
"non",
"-",
"zero",
"entry",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java#L501-L518 |
63,976 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java | LinearEquationSystem.permutePivot | private void permutePivot(IntIntPair pos1, IntIntPair pos2) {
int r1 = pos1.first;
int c1 = pos1.second;
int r2 = pos2.first;
int c2 = pos2.second;
int index;
index = row[r2];
row[r2] = row[r1];
row[r1] = index;
index = col[c2];
col[c2] = col[c1];
col[c1] = index;
} | java | private void permutePivot(IntIntPair pos1, IntIntPair pos2) {
int r1 = pos1.first;
int c1 = pos1.second;
int r2 = pos2.first;
int c2 = pos2.second;
int index;
index = row[r2];
row[r2] = row[r1];
row[r1] = index;
index = col[c2];
col[c2] = col[c1];
col[c1] = index;
} | [
"private",
"void",
"permutePivot",
"(",
"IntIntPair",
"pos1",
",",
"IntIntPair",
"pos2",
")",
"{",
"int",
"r1",
"=",
"pos1",
".",
"first",
";",
"int",
"c1",
"=",
"pos1",
".",
"second",
";",
"int",
"r2",
"=",
"pos2",
".",
"first",
";",
"int",
"c2",
... | permutes two matrix rows and two matrix columns
@param pos1 the fist position for the permutation
@param pos2 the second position for the permutation | [
"permutes",
"two",
"matrix",
"rows",
"and",
"two",
"matrix",
"columns"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java#L526-L538 |
63,977 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java | LinearEquationSystem.pivotOperation | private void pivotOperation(int k) {
double pivot = coeff[row[k]][col[k]];
// pivot row: set pivot to 1
coeff[row[k]][col[k]] = 1;
for(int i = k + 1; i < coeff[k].length; i++) {
coeff[row[k]][col[i]] /= pivot;
}
rhs[row[k]] /= pivot;
if(LOG.isDebugging()) {
StringBuilder msg = ... | java | private void pivotOperation(int k) {
double pivot = coeff[row[k]][col[k]];
// pivot row: set pivot to 1
coeff[row[k]][col[k]] = 1;
for(int i = k + 1; i < coeff[k].length; i++) {
coeff[row[k]][col[i]] /= pivot;
}
rhs[row[k]] /= pivot;
if(LOG.isDebugging()) {
StringBuilder msg = ... | [
"private",
"void",
"pivotOperation",
"(",
"int",
"k",
")",
"{",
"double",
"pivot",
"=",
"coeff",
"[",
"row",
"[",
"k",
"]",
"]",
"[",
"col",
"[",
"k",
"]",
"]",
";",
"// pivot row: set pivot to 1",
"coeff",
"[",
"row",
"[",
"k",
"]",
"]",
"[",
"col... | performs a pivot operation
@param k pivoting takes place below (k,k) | [
"performs",
"a",
"pivot",
"operation"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java#L545-L587 |
63,978 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java | LinearEquationSystem.solve | private void solve(int method) throws NullPointerException {
// solution exists
if(solved) {
return;
}
// bring in reduced row echelon form
if(!reducedRowEchelonForm) {
reducedRowEchelonForm(method);
}
if(!isSolvable(method)) {
if(LOG.isDebugging()) {
LOG.debugFin... | java | private void solve(int method) throws NullPointerException {
// solution exists
if(solved) {
return;
}
// bring in reduced row echelon form
if(!reducedRowEchelonForm) {
reducedRowEchelonForm(method);
}
if(!isSolvable(method)) {
if(LOG.isDebugging()) {
LOG.debugFin... | [
"private",
"void",
"solve",
"(",
"int",
"method",
")",
"throws",
"NullPointerException",
"{",
"// solution exists",
"if",
"(",
"solved",
")",
"{",
"return",
";",
"}",
"// bring in reduced row echelon form",
"if",
"(",
"!",
"reducedRowEchelonForm",
")",
"{",
"reduc... | solves linear system with the chosen method
@param method the pivot search method | [
"solves",
"linear",
"system",
"with",
"the",
"chosen",
"method"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java#L594-L664 |
63,979 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java | LinearEquationSystem.isSolvable | private boolean isSolvable(int method) throws NullPointerException {
if(solved) {
return solvable;
}
if(!reducedRowEchelonForm) {
reducedRowEchelonForm(method);
}
// test if rank(coeff) == rank(coeff|rhs)
for(int i = rank; i < rhs.length; i++) {
if(Math.abs(rhs[row[i]]) > DEL... | java | private boolean isSolvable(int method) throws NullPointerException {
if(solved) {
return solvable;
}
if(!reducedRowEchelonForm) {
reducedRowEchelonForm(method);
}
// test if rank(coeff) == rank(coeff|rhs)
for(int i = rank; i < rhs.length; i++) {
if(Math.abs(rhs[row[i]]) > DEL... | [
"private",
"boolean",
"isSolvable",
"(",
"int",
"method",
")",
"throws",
"NullPointerException",
"{",
"if",
"(",
"solved",
")",
"{",
"return",
"solvable",
";",
"}",
"if",
"(",
"!",
"reducedRowEchelonForm",
")",
"{",
"reducedRowEchelonForm",
"(",
"method",
")",... | Checks solvability of this linear equation system with the chosen method.
@param method the pivot search method
@return true if linear system in solvable | [
"Checks",
"solvability",
"of",
"this",
"linear",
"equation",
"system",
"with",
"the",
"chosen",
"method",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java#L672-L691 |
63,980 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java | LinearEquationSystem.maxIntegerDigits | private int[] maxIntegerDigits(double[][] values) {
int[] digits = new int[values[0].length];
for(int j = 0; j < values[0].length; j++) {
for(double[] value : values) {
digits[j] = Math.max(digits[j], integerDigits(value[j]));
}
}
return digits;
} | java | private int[] maxIntegerDigits(double[][] values) {
int[] digits = new int[values[0].length];
for(int j = 0; j < values[0].length; j++) {
for(double[] value : values) {
digits[j] = Math.max(digits[j], integerDigits(value[j]));
}
}
return digits;
} | [
"private",
"int",
"[",
"]",
"maxIntegerDigits",
"(",
"double",
"[",
"]",
"[",
"]",
"values",
")",
"{",
"int",
"[",
"]",
"digits",
"=",
"new",
"int",
"[",
"values",
"[",
"0",
"]",
".",
"length",
"]",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
... | Returns the maximum integer digits in each column of the specified values.
@param values the values array
@return the maximum integer digits in each column of the specified values | [
"Returns",
"the",
"maximum",
"integer",
"digits",
"in",
"each",
"column",
"of",
"the",
"specified",
"values",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java#L699-L707 |
63,981 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java | LinearEquationSystem.maxIntegerDigits | private int maxIntegerDigits(double[] values) {
int digits = 0;
for(double value : values) {
digits = Math.max(digits, integerDigits(value));
}
return digits;
} | java | private int maxIntegerDigits(double[] values) {
int digits = 0;
for(double value : values) {
digits = Math.max(digits, integerDigits(value));
}
return digits;
} | [
"private",
"int",
"maxIntegerDigits",
"(",
"double",
"[",
"]",
"values",
")",
"{",
"int",
"digits",
"=",
"0",
";",
"for",
"(",
"double",
"value",
":",
"values",
")",
"{",
"digits",
"=",
"Math",
".",
"max",
"(",
"digits",
",",
"integerDigits",
"(",
"v... | Returns the maximum integer digits of the specified values.
@param values the values array
@return the maximum integer digits of the specified values | [
"Returns",
"the",
"maximum",
"integer",
"digits",
"of",
"the",
"specified",
"values",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java#L715-L721 |
63,982 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java | LinearEquationSystem.integerDigits | private int integerDigits(double d) {
double value = Math.abs(d);
if(value < 10) {
return 1;
}
return (int) FastMath.log10(value) + 1;
} | java | private int integerDigits(double d) {
double value = Math.abs(d);
if(value < 10) {
return 1;
}
return (int) FastMath.log10(value) + 1;
} | [
"private",
"int",
"integerDigits",
"(",
"double",
"d",
")",
"{",
"double",
"value",
"=",
"Math",
".",
"abs",
"(",
"d",
")",
";",
"if",
"(",
"value",
"<",
"10",
")",
"{",
"return",
"1",
";",
"}",
"return",
"(",
"int",
")",
"FastMath",
".",
"log10"... | Returns the integer digits of the specified double value.
@param d the double value
@return the integer digits of the specified double value | [
"Returns",
"the",
"integer",
"digits",
"of",
"the",
"specified",
"double",
"value",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java#L729-L735 |
63,983 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java | LinearEquationSystem.format | private void format(NumberFormat nf, StringBuilder buffer, double value, int maxIntegerDigits) {
if(value >= 0) {
buffer.append(" + ");
}
else {
buffer.append(" - ");
}
int digits = maxIntegerDigits - integerDigits(value);
for(int d = 0; d < digits; d++) {
buffer.append(' ');
... | java | private void format(NumberFormat nf, StringBuilder buffer, double value, int maxIntegerDigits) {
if(value >= 0) {
buffer.append(" + ");
}
else {
buffer.append(" - ");
}
int digits = maxIntegerDigits - integerDigits(value);
for(int d = 0; d < digits; d++) {
buffer.append(' ');
... | [
"private",
"void",
"format",
"(",
"NumberFormat",
"nf",
",",
"StringBuilder",
"buffer",
",",
"double",
"value",
",",
"int",
"maxIntegerDigits",
")",
"{",
"if",
"(",
"value",
">=",
"0",
")",
"{",
"buffer",
".",
"append",
"(",
"\" + \"",
")",
";",
"}",
"... | Helper method for output of equations and solution. Appends the specified
double value to the given string buffer according the number format and the
maximum number of integer digits.
@param nf the number format
@param buffer the string buffer to append the value to
@param value the value to append
@param maxIntegerDi... | [
"Helper",
"method",
"for",
"output",
"of",
"equations",
"and",
"solution",
".",
"Appends",
"the",
"specified",
"double",
"value",
"to",
"the",
"given",
"string",
"buffer",
"according",
"the",
"number",
"format",
"and",
"the",
"maximum",
"number",
"of",
"intege... | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java#L747-L759 |
63,984 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/KMedoidsPAM.java | KMedoidsPAM.initialMedoids | protected ArrayModifiableDBIDs initialMedoids(DistanceQuery<V> distQ, DBIDs ids) {
if(getLogger().isStatistics()) {
getLogger().statistics(new StringStatistic(getClass().getName() + ".initialization", initializer.toString()));
}
Duration initd = getLogger().newDuration(getClass().getName() + ".initial... | java | protected ArrayModifiableDBIDs initialMedoids(DistanceQuery<V> distQ, DBIDs ids) {
if(getLogger().isStatistics()) {
getLogger().statistics(new StringStatistic(getClass().getName() + ".initialization", initializer.toString()));
}
Duration initd = getLogger().newDuration(getClass().getName() + ".initial... | [
"protected",
"ArrayModifiableDBIDs",
"initialMedoids",
"(",
"DistanceQuery",
"<",
"V",
">",
"distQ",
",",
"DBIDs",
"ids",
")",
"{",
"if",
"(",
"getLogger",
"(",
")",
".",
"isStatistics",
"(",
")",
")",
"{",
"getLogger",
"(",
")",
".",
"statistics",
"(",
... | Choose the initial medoids.
@param distQ Distance query
@param ids IDs to choose from
@return Initial medoids | [
"Choose",
"the",
"initial",
"medoids",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/KMedoidsPAM.java#L163-L174 |
63,985 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/pairsegments/Segments.java | Segments.getTotalClusterCount | public int getTotalClusterCount() {
int clusterCount = 0;
for(int i = 0; i < numclusters.length; i++) {
clusterCount += numclusters[i];
}
return clusterCount;
} | java | public int getTotalClusterCount() {
int clusterCount = 0;
for(int i = 0; i < numclusters.length; i++) {
clusterCount += numclusters[i];
}
return clusterCount;
} | [
"public",
"int",
"getTotalClusterCount",
"(",
")",
"{",
"int",
"clusterCount",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numclusters",
".",
"length",
";",
"i",
"++",
")",
"{",
"clusterCount",
"+=",
"numclusters",
"[",
"i",
"]",... | Return the sum of all clusters
@return sum of all cluster counts | [
"Return",
"the",
"sum",
"of",
"all",
"clusters"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/pairsegments/Segments.java#L343-L351 |
63,986 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/pairsegments/Segments.java | Segments.getHighestClusterCount | public int getHighestClusterCount() {
int maxClusters = 0;
for(int i = 0; i < numclusters.length; i++) {
maxClusters = Math.max(maxClusters, numclusters[i]);
}
return maxClusters;
} | java | public int getHighestClusterCount() {
int maxClusters = 0;
for(int i = 0; i < numclusters.length; i++) {
maxClusters = Math.max(maxClusters, numclusters[i]);
}
return maxClusters;
} | [
"public",
"int",
"getHighestClusterCount",
"(",
")",
"{",
"int",
"maxClusters",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numclusters",
".",
"length",
";",
"i",
"++",
")",
"{",
"maxClusters",
"=",
"Math",
".",
"max",
"(",
"ma... | Returns the highest number of Clusters in the clusterings
@return highest cluster count | [
"Returns",
"the",
"highest",
"number",
"of",
"Clusters",
"in",
"the",
"clusterings"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/pairsegments/Segments.java#L358-L365 |
63,987 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/initialization/LABInitialMeans.java | LABInitialMeans.getMinDist | protected static double getMinDist(DBIDArrayIter j, DistanceQuery<?> distQ, DBIDArrayIter mi, WritableDoubleDataStore mindist) {
double prev = mindist.doubleValue(j);
if(Double.isNaN(prev)) { // NaN = unknown
prev = Double.POSITIVE_INFINITY;
for(mi.seek(0); mi.valid(); mi.advance()) {
double... | java | protected static double getMinDist(DBIDArrayIter j, DistanceQuery<?> distQ, DBIDArrayIter mi, WritableDoubleDataStore mindist) {
double prev = mindist.doubleValue(j);
if(Double.isNaN(prev)) { // NaN = unknown
prev = Double.POSITIVE_INFINITY;
for(mi.seek(0); mi.valid(); mi.advance()) {
double... | [
"protected",
"static",
"double",
"getMinDist",
"(",
"DBIDArrayIter",
"j",
",",
"DistanceQuery",
"<",
"?",
">",
"distQ",
",",
"DBIDArrayIter",
"mi",
",",
"WritableDoubleDataStore",
"mindist",
")",
"{",
"double",
"prev",
"=",
"mindist",
".",
"doubleValue",
"(",
... | Get the minimum distance to previous medoids.
@param j current object
@param distQ distance query
@param mi medoid iterator
@param mindist distance storage
@return minimum distance | [
"Get",
"the",
"minimum",
"distance",
"to",
"previous",
"medoids",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/initialization/LABInitialMeans.java#L214-L225 |
63,988 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/initialization/LABInitialMeans.java | LABInitialMeans.shuffle | private static void shuffle(ArrayModifiableDBIDs ids, int ssize, int end, Random random) {
ssize = ssize < end ? ssize : end; // Guard for choosing from tiny sets
for(int i = 1; i < ssize; i++) {
ids.swap(i - 1, i + random.nextInt(end - i));
}
} | java | private static void shuffle(ArrayModifiableDBIDs ids, int ssize, int end, Random random) {
ssize = ssize < end ? ssize : end; // Guard for choosing from tiny sets
for(int i = 1; i < ssize; i++) {
ids.swap(i - 1, i + random.nextInt(end - i));
}
} | [
"private",
"static",
"void",
"shuffle",
"(",
"ArrayModifiableDBIDs",
"ids",
",",
"int",
"ssize",
",",
"int",
"end",
",",
"Random",
"random",
")",
"{",
"ssize",
"=",
"ssize",
"<",
"end",
"?",
"ssize",
":",
"end",
";",
"// Guard for choosing from tiny sets",
"... | Partial Fisher-Yates shuffle.
@param ids IDs to shuffle
@param ssize sample size to generate
@param end Valid range
@param random Random generator | [
"Partial",
"Fisher",
"-",
"Yates",
"shuffle",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/initialization/LABInitialMeans.java#L235-L240 |
63,989 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/scales/Scales.java | Scales.calcScales | public static LinearScale[] calcScales(Relation<? extends SpatialComparable> rel) {
int dim = RelationUtil.dimensionality(rel);
DoubleMinMax[] minmax = DoubleMinMax.newArray(dim);
LinearScale[] scales = new LinearScale[dim];
// analyze data
for(DBIDIter iditer = rel.iterDBIDs(); iditer.valid(); idi... | java | public static LinearScale[] calcScales(Relation<? extends SpatialComparable> rel) {
int dim = RelationUtil.dimensionality(rel);
DoubleMinMax[] minmax = DoubleMinMax.newArray(dim);
LinearScale[] scales = new LinearScale[dim];
// analyze data
for(DBIDIter iditer = rel.iterDBIDs(); iditer.valid(); idi... | [
"public",
"static",
"LinearScale",
"[",
"]",
"calcScales",
"(",
"Relation",
"<",
"?",
"extends",
"SpatialComparable",
">",
"rel",
")",
"{",
"int",
"dim",
"=",
"RelationUtil",
".",
"dimensionality",
"(",
"rel",
")",
";",
"DoubleMinMax",
"[",
"]",
"minmax",
... | Compute a linear scale for each dimension.
@param rel Relation
@return Scales, indexed starting with 0 (like Vector, not database
objects!) | [
"Compute",
"a",
"linear",
"scale",
"for",
"each",
"dimension",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/scales/Scales.java#L55-L91 |
63,990 | elki-project/elki | elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/Eclat.java | Eclat.run | public FrequentItemsetsResult run(Database db, final Relation<BitVector> relation) {
// TODO: implement with resizable arrays, to not need dim.
final int dim = RelationUtil.dimensionality(relation);
final VectorFieldTypeInformation<BitVector> meta = RelationUtil.assumeVectorField(relation);
// Compute a... | java | public FrequentItemsetsResult run(Database db, final Relation<BitVector> relation) {
// TODO: implement with resizable arrays, to not need dim.
final int dim = RelationUtil.dimensionality(relation);
final VectorFieldTypeInformation<BitVector> meta = RelationUtil.assumeVectorField(relation);
// Compute a... | [
"public",
"FrequentItemsetsResult",
"run",
"(",
"Database",
"db",
",",
"final",
"Relation",
"<",
"BitVector",
">",
"relation",
")",
"{",
"// TODO: implement with resizable arrays, to not need dim.",
"final",
"int",
"dim",
"=",
"RelationUtil",
".",
"dimensionality",
"(",... | Run the Eclat algorithm
@param db Database to process
@param relation Bit vector relation
@return Frequent patterns found | [
"Run",
"the",
"Eclat",
"algorithm"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/Eclat.java#L109-L134 |
63,991 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/ClassTree.java | ClassTree.build | public static TreeNode build(List<Class<?>> choices, String rootpkg) {
MutableTreeNode root = new PackageNode(rootpkg, rootpkg);
HashMap<String, MutableTreeNode> lookup = new HashMap<>();
if(rootpkg != null) {
lookup.put(rootpkg, root);
}
lookup.put("de.lmu.ifi.dbs.elki", root);
lookup.put... | java | public static TreeNode build(List<Class<?>> choices, String rootpkg) {
MutableTreeNode root = new PackageNode(rootpkg, rootpkg);
HashMap<String, MutableTreeNode> lookup = new HashMap<>();
if(rootpkg != null) {
lookup.put(rootpkg, root);
}
lookup.put("de.lmu.ifi.dbs.elki", root);
lookup.put... | [
"public",
"static",
"TreeNode",
"build",
"(",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"choices",
",",
"String",
"rootpkg",
")",
"{",
"MutableTreeNode",
"root",
"=",
"new",
"PackageNode",
"(",
"rootpkg",
",",
"rootpkg",
")",
";",
"HashMap",
"<",
"String... | Build the class tree for a given set of choices.
@param choices Class choices
@param rootpkg Root package name (to strip / hide)
@return Root node. | [
"Build",
"the",
"class",
"tree",
"for",
"a",
"given",
"set",
"of",
"choices",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/ClassTree.java#L58-L109 |
63,992 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/ClassTree.java | ClassTree.simplifyTree | private static MutableTreeNode simplifyTree(MutableTreeNode cur, String prefix) {
if(cur instanceof PackageNode) {
PackageNode node = (PackageNode) cur;
if(node.getChildCount() == 1) {
String newprefix = (prefix != null) ? prefix + "." + (String) node.getUserObject() : (String) node.getUserObjec... | java | private static MutableTreeNode simplifyTree(MutableTreeNode cur, String prefix) {
if(cur instanceof PackageNode) {
PackageNode node = (PackageNode) cur;
if(node.getChildCount() == 1) {
String newprefix = (prefix != null) ? prefix + "." + (String) node.getUserObject() : (String) node.getUserObjec... | [
"private",
"static",
"MutableTreeNode",
"simplifyTree",
"(",
"MutableTreeNode",
"cur",
",",
"String",
"prefix",
")",
"{",
"if",
"(",
"cur",
"instanceof",
"PackageNode",
")",
"{",
"PackageNode",
"node",
"=",
"(",
"PackageNode",
")",
"cur",
";",
"if",
"(",
"no... | Simplify the tree.
@param cur Current node
@param prefix Prefix to add
@return Replacement node | [
"Simplify",
"the",
"tree",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/ClassTree.java#L118-L146 |
63,993 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/ClassListParameter.java | ClassListParameter.formatValue | protected String formatValue(List<Class<? extends C>> val) {
StringBuilder buf = new StringBuilder(50 + val.size() * 25);
String pkgname = restrictionClass.getPackage().getName();
for(Class<? extends C> c : val) {
if(buf.length() > 0) {
buf.append(LIST_SEP);
}
String name = c.getNa... | java | protected String formatValue(List<Class<? extends C>> val) {
StringBuilder buf = new StringBuilder(50 + val.size() * 25);
String pkgname = restrictionClass.getPackage().getName();
for(Class<? extends C> c : val) {
if(buf.length() > 0) {
buf.append(LIST_SEP);
}
String name = c.getNa... | [
"protected",
"String",
"formatValue",
"(",
"List",
"<",
"Class",
"<",
"?",
"extends",
"C",
">",
">",
"val",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
"50",
"+",
"val",
".",
"size",
"(",
")",
"*",
"25",
")",
";",
"String",
... | Format as string.
@param val Value to format
@return String | [
"Format",
"as",
"string",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/ClassListParameter.java#L97-L109 |
63,994 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPanel.java | LogPanel.publish | protected void publish(final LogRecord record) {
if(record instanceof ProgressLogRecord) {
ProgressLogRecord preg = (ProgressLogRecord) record;
Progress prog = preg.getProgress();
JProgressBar pbar = getOrCreateProgressBar(prog);
updateProgressBar(prog, pbar);
if(prog.isComplete()) {
... | java | protected void publish(final LogRecord record) {
if(record instanceof ProgressLogRecord) {
ProgressLogRecord preg = (ProgressLogRecord) record;
Progress prog = preg.getProgress();
JProgressBar pbar = getOrCreateProgressBar(prog);
updateProgressBar(prog, pbar);
if(prog.isComplete()) {
... | [
"protected",
"void",
"publish",
"(",
"final",
"LogRecord",
"record",
")",
"{",
"if",
"(",
"record",
"instanceof",
"ProgressLogRecord",
")",
"{",
"ProgressLogRecord",
"preg",
"=",
"(",
"ProgressLogRecord",
")",
"record",
";",
"Progress",
"prog",
"=",
"preg",
".... | Publish a logging record.
@param record Log record to publish | [
"Publish",
"a",
"logging",
"record",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPanel.java#L94-L110 |
63,995 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPanel.java | LogPanel.publishTextRecord | private void publishTextRecord(final LogRecord record) {
try {
logpane.publish(record);
}
catch(Exception e) {
throw new RuntimeException("Error writing a log-like message.", e);
}
} | java | private void publishTextRecord(final LogRecord record) {
try {
logpane.publish(record);
}
catch(Exception e) {
throw new RuntimeException("Error writing a log-like message.", e);
}
} | [
"private",
"void",
"publishTextRecord",
"(",
"final",
"LogRecord",
"record",
")",
"{",
"try",
"{",
"logpane",
".",
"publish",
"(",
"record",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Error writing a ... | Publish a text record to the pane
@param record Record to publish | [
"Publish",
"a",
"text",
"record",
"to",
"the",
"pane"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPanel.java#L117-L124 |
63,996 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPanel.java | LogPanel.getOrCreateProgressBar | private JProgressBar getOrCreateProgressBar(Progress prog) {
JProgressBar pbar = pbarmap.get(prog);
// Add a new progress bar.
if(pbar == null) {
synchronized(pbarmap) {
if(prog instanceof FiniteProgress) {
pbar = new JProgressBar(0, ((FiniteProgress) prog).getTotal());
pba... | java | private JProgressBar getOrCreateProgressBar(Progress prog) {
JProgressBar pbar = pbarmap.get(prog);
// Add a new progress bar.
if(pbar == null) {
synchronized(pbarmap) {
if(prog instanceof FiniteProgress) {
pbar = new JProgressBar(0, ((FiniteProgress) prog).getTotal());
pba... | [
"private",
"JProgressBar",
"getOrCreateProgressBar",
"(",
"Progress",
"prog",
")",
"{",
"JProgressBar",
"pbar",
"=",
"pbarmap",
".",
"get",
"(",
"prog",
")",
";",
"// Add a new progress bar.",
"if",
"(",
"pbar",
"==",
"null",
")",
"{",
"synchronized",
"(",
"pb... | Get an existing or create a new progress bar.
@param prog Progress
@return Associated progress bar. | [
"Get",
"an",
"existing",
"or",
"create",
"a",
"new",
"progress",
"bar",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPanel.java#L132-L159 |
63,997 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPanel.java | LogPanel.updateProgressBar | private void updateProgressBar(Progress prog, JProgressBar pbar) {
if(prog instanceof FiniteProgress) {
pbar.setValue(((FiniteProgress) prog).getProcessed());
pbar.setString(((FiniteProgress) prog).toString());
}
else if(prog instanceof IndefiniteProgress) {
pbar.setValue(((IndefiniteProgr... | java | private void updateProgressBar(Progress prog, JProgressBar pbar) {
if(prog instanceof FiniteProgress) {
pbar.setValue(((FiniteProgress) prog).getProcessed());
pbar.setString(((FiniteProgress) prog).toString());
}
else if(prog instanceof IndefiniteProgress) {
pbar.setValue(((IndefiniteProgr... | [
"private",
"void",
"updateProgressBar",
"(",
"Progress",
"prog",
",",
"JProgressBar",
"pbar",
")",
"{",
"if",
"(",
"prog",
"instanceof",
"FiniteProgress",
")",
"{",
"pbar",
".",
"setValue",
"(",
"(",
"(",
"FiniteProgress",
")",
"prog",
")",
".",
"getProcesse... | Update a progress bar
@param prog Progress
@param pbar Associated progress bar | [
"Update",
"a",
"progress",
"bar"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPanel.java#L167-L184 |
63,998 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPanel.java | LogPanel.removeProgressBar | private void removeProgressBar(Progress prog, JProgressBar pbar) {
synchronized(pbarmap) {
pbarmap.remove(prog);
SwingUtilities.invokeLater(() -> removeProgressBar(pbar));
}
} | java | private void removeProgressBar(Progress prog, JProgressBar pbar) {
synchronized(pbarmap) {
pbarmap.remove(prog);
SwingUtilities.invokeLater(() -> removeProgressBar(pbar));
}
} | [
"private",
"void",
"removeProgressBar",
"(",
"Progress",
"prog",
",",
"JProgressBar",
"pbar",
")",
"{",
"synchronized",
"(",
"pbarmap",
")",
"{",
"pbarmap",
".",
"remove",
"(",
"prog",
")",
";",
"SwingUtilities",
".",
"invokeLater",
"(",
"(",
")",
"->",
"r... | Remove a progress bar
@param prog Progress
@param pbar Associated progress bar | [
"Remove",
"a",
"progress",
"bar"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPanel.java#L192-L197 |
63,999 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPanel.java | LogPanel.clear | public void clear() {
logpane.clear();
synchronized(pbarmap) {
for(Entry<Progress, JProgressBar> ent : pbarmap.entrySet()) {
super.remove(ent.getValue());
pbarmap.remove(ent.getKey());
}
}
} | java | public void clear() {
logpane.clear();
synchronized(pbarmap) {
for(Entry<Progress, JProgressBar> ent : pbarmap.entrySet()) {
super.remove(ent.getValue());
pbarmap.remove(ent.getKey());
}
}
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"logpane",
".",
"clear",
"(",
")",
";",
"synchronized",
"(",
"pbarmap",
")",
"{",
"for",
"(",
"Entry",
"<",
"Progress",
",",
"JProgressBar",
">",
"ent",
":",
"pbarmap",
".",
"entrySet",
"(",
")",
")",
"{",
... | Clear the current contents. | [
"Clear",
"the",
"current",
"contents",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPanel.java#L202-L210 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.