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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
64,000 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/LazyCanvasResizer.java | LazyCanvasResizer.componentResized | @Override
public void componentResized(ComponentEvent e) {
if (e.getComponent() == component) {
double newRatio = getCurrentRatio();
if (Math.abs(newRatio - activeRatio) > threshold) {
activeRatio = newRatio;
executeResize(newRatio);
}
}
} | java | @Override
public void componentResized(ComponentEvent e) {
if (e.getComponent() == component) {
double newRatio = getCurrentRatio();
if (Math.abs(newRatio - activeRatio) > threshold) {
activeRatio = newRatio;
executeResize(newRatio);
}
}
} | [
"@",
"Override",
"public",
"void",
"componentResized",
"(",
"ComponentEvent",
"e",
")",
"{",
"if",
"(",
"e",
".",
"getComponent",
"(",
")",
"==",
"component",
")",
"{",
"double",
"newRatio",
"=",
"getCurrentRatio",
"(",
")",
";",
"if",
"(",
"Math",
".",
... | React to a component resize event. | [
"React",
"to",
"a",
"component",
"resize",
"event",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/LazyCanvasResizer.java#L79-L88 |
64,001 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/MessageFormatter.java | MessageFormatter.format | @Override
public String format(LogRecord record) {
String msg = record.getMessage();
if(msg.length() > 0) {
if (record instanceof ProgressLogRecord) {
return msg;
}
if(msg.endsWith(OutputStreamLogger.NEWLINE)) {
return msg;
}
}
return msg + OutputStreamLogger.NE... | java | @Override
public String format(LogRecord record) {
String msg = record.getMessage();
if(msg.length() > 0) {
if (record instanceof ProgressLogRecord) {
return msg;
}
if(msg.endsWith(OutputStreamLogger.NEWLINE)) {
return msg;
}
}
return msg + OutputStreamLogger.NE... | [
"@",
"Override",
"public",
"String",
"format",
"(",
"LogRecord",
"record",
")",
"{",
"String",
"msg",
"=",
"record",
".",
"getMessage",
"(",
")",
";",
"if",
"(",
"msg",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"if",
"(",
"record",
"instanceof",
... | Retrieves the message as it is set in the given LogRecord. | [
"Retrieves",
"the",
"message",
"as",
"it",
"is",
"set",
"in",
"the",
"given",
"LogRecord",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/MessageFormatter.java#L46-L58 |
64,002 | elki-project/elki | elki-classification/src/main/java/de/lmu/ifi/dbs/elki/algorithm/classification/AbstractClassifier.java | AbstractClassifier.alignLabels | protected double[] alignLabels(List<ClassLabel> l1, double[] d1, Collection<ClassLabel> l2) {
assert (l1.size() == d1.length);
if(l1 == l2) {
return d1.clone();
}
double[] d2 = new double[l2.size()];
Iterator<ClassLabel> i2 = l2.iterator();
for(int i = 0; i2.hasNext();) {
ClassLabel ... | java | protected double[] alignLabels(List<ClassLabel> l1, double[] d1, Collection<ClassLabel> l2) {
assert (l1.size() == d1.length);
if(l1 == l2) {
return d1.clone();
}
double[] d2 = new double[l2.size()];
Iterator<ClassLabel> i2 = l2.iterator();
for(int i = 0; i2.hasNext();) {
ClassLabel ... | [
"protected",
"double",
"[",
"]",
"alignLabels",
"(",
"List",
"<",
"ClassLabel",
">",
"l1",
",",
"double",
"[",
"]",
"d1",
",",
"Collection",
"<",
"ClassLabel",
">",
"l2",
")",
"{",
"assert",
"(",
"l1",
".",
"size",
"(",
")",
"==",
"d1",
".",
"lengt... | Align the labels for a label query.
@param l1 List of reference labels
@param d1 Probabilities for these labels
@param l2 List of requested labels
@return Probabilities in desired output order | [
"Align",
"the",
"labels",
"for",
"a",
"label",
"query",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-classification/src/main/java/de/lmu/ifi/dbs/elki/algorithm/classification/AbstractClassifier.java#L57-L73 |
64,003 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/initialization/PredefinedInitialMeans.java | PredefinedInitialMeans.setInitialClusters | public void setInitialClusters(List<? extends Cluster<? extends MeanModel>> initialMeans) {
double[][] vecs = new double[initialMeans.size()][];
for(int i = 0; i < vecs.length; i++) {
vecs[i] = initialMeans.get(i).getModel().getMean();
}
this.initialMeans = vecs;
} | java | public void setInitialClusters(List<? extends Cluster<? extends MeanModel>> initialMeans) {
double[][] vecs = new double[initialMeans.size()][];
for(int i = 0; i < vecs.length; i++) {
vecs[i] = initialMeans.get(i).getModel().getMean();
}
this.initialMeans = vecs;
} | [
"public",
"void",
"setInitialClusters",
"(",
"List",
"<",
"?",
"extends",
"Cluster",
"<",
"?",
"extends",
"MeanModel",
">",
">",
"initialMeans",
")",
"{",
"double",
"[",
"]",
"[",
"]",
"vecs",
"=",
"new",
"double",
"[",
"initialMeans",
".",
"size",
"(",
... | Set the initial means.
Important notice: Use with care - the means are <em>not copied</em>!
@param initialMeans initial means. | [
"Set",
"the",
"initial",
"means",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/initialization/PredefinedInitialMeans.java#L77-L83 |
64,004 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/LoggingUtil.java | LoggingUtil.exception | public static void exception(String message, Throwable e) {
if(message == null && e != null) {
message = e.getMessage();
}
logExpensive(Level.SEVERE, message, e);
} | java | public static void exception(String message, Throwable e) {
if(message == null && e != null) {
message = e.getMessage();
}
logExpensive(Level.SEVERE, message, e);
} | [
"public",
"static",
"void",
"exception",
"(",
"String",
"message",
",",
"Throwable",
"e",
")",
"{",
"if",
"(",
"message",
"==",
"null",
"&&",
"e",
"!=",
"null",
")",
"{",
"message",
"=",
"e",
".",
"getMessage",
"(",
")",
";",
"}",
"logExpensive",
"("... | Static version to log a severe exception.
@param message Exception message, may be null (defaults to e.getMessage())
@param e causing exception | [
"Static",
"version",
"to",
"log",
"a",
"severe",
"exception",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/LoggingUtil.java#L108-L113 |
64,005 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/LoggingUtil.java | LoggingUtil.warning | public static void warning(String message, Throwable e) {
if(message == null && e != null) {
message = e.getMessage();
}
logExpensive(Level.WARNING, message, e);
} | java | public static void warning(String message, Throwable e) {
if(message == null && e != null) {
message = e.getMessage();
}
logExpensive(Level.WARNING, message, e);
} | [
"public",
"static",
"void",
"warning",
"(",
"String",
"message",
",",
"Throwable",
"e",
")",
"{",
"if",
"(",
"message",
"==",
"null",
"&&",
"e",
"!=",
"null",
")",
"{",
"message",
"=",
"e",
".",
"getMessage",
"(",
")",
";",
"}",
"logExpensive",
"(",
... | Static version to log a warning message.
@param message Warning message, may be null (defaults to e.getMessage())
@param e causing exception | [
"Static",
"version",
"to",
"log",
"a",
"warning",
"message",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/LoggingUtil.java#L130-L135 |
64,006 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/LoggingUtil.java | LoggingUtil.message | public static void message(String message, Throwable e) {
if(message == null && e != null) {
message = e.getMessage();
}
logExpensive(Level.INFO, message, e);
} | java | public static void message(String message, Throwable e) {
if(message == null && e != null) {
message = e.getMessage();
}
logExpensive(Level.INFO, message, e);
} | [
"public",
"static",
"void",
"message",
"(",
"String",
"message",
",",
"Throwable",
"e",
")",
"{",
"if",
"(",
"message",
"==",
"null",
"&&",
"e",
"!=",
"null",
")",
"{",
"message",
"=",
"e",
".",
"getMessage",
"(",
")",
";",
"}",
"logExpensive",
"(",
... | Static version to log a 'info' message.
@param message Warning message, may be null (defaults to e.getMessage())
@param e causing exception | [
"Static",
"version",
"to",
"log",
"a",
"info",
"message",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/LoggingUtil.java#L152-L157 |
64,007 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/LoggingUtil.java | LoggingUtil.inferCaller | private static final String[] inferCaller() {
StackTraceElement[] stack = (new Throwable()).getStackTrace();
int ix = 0;
while(ix < stack.length) {
StackTraceElement frame = stack[ix];
if(!frame.getClassName().equals(LoggingUtil.class.getCanonicalName())) {
return new String[] { frame.g... | java | private static final String[] inferCaller() {
StackTraceElement[] stack = (new Throwable()).getStackTrace();
int ix = 0;
while(ix < stack.length) {
StackTraceElement frame = stack[ix];
if(!frame.getClassName().equals(LoggingUtil.class.getCanonicalName())) {
return new String[] { frame.g... | [
"private",
"static",
"final",
"String",
"[",
"]",
"inferCaller",
"(",
")",
"{",
"StackTraceElement",
"[",
"]",
"stack",
"=",
"(",
"new",
"Throwable",
"(",
")",
")",
".",
"getStackTrace",
"(",
")",
";",
"int",
"ix",
"=",
"0",
";",
"while",
"(",
"ix",
... | Infer which class has called the logging helper.
While this looks like duplicated code from ELKILogRecord, it is needed here
to find an appropriate Logger (and check the logging level) for the calling
class, not just to log the right class and method name.
@return calling class name and calling method name | [
"Infer",
"which",
"class",
"has",
"called",
"the",
"logging",
"helper",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/LoggingUtil.java#L168-L181 |
64,008 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/MathUtil.java | MathUtil.binomialCoefficient | public static long binomialCoefficient(long n, long k) {
final long m = Math.max(k, n - k);
double temp = 1;
for(long i = n, j = 1; i > m; i--, j++) {
temp = temp * i / j;
}
return (long) temp;
} | java | public static long binomialCoefficient(long n, long k) {
final long m = Math.max(k, n - k);
double temp = 1;
for(long i = n, j = 1; i > m; i--, j++) {
temp = temp * i / j;
}
return (long) temp;
} | [
"public",
"static",
"long",
"binomialCoefficient",
"(",
"long",
"n",
",",
"long",
"k",
")",
"{",
"final",
"long",
"m",
"=",
"Math",
".",
"max",
"(",
"k",
",",
"n",
"-",
"k",
")",
";",
"double",
"temp",
"=",
"1",
";",
"for",
"(",
"long",
"i",
"=... | Binomial coefficient, also known as "n choose k".
@param n Total number of samples. n > 0
@param k Number of elements to choose. <code>n >= k</code>,
<code>k >= 0</code>
@return n! / (k! * (n-k)!) | [
"Binomial",
"coefficient",
"also",
"known",
"as",
"n",
"choose",
"k",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/MathUtil.java#L237-L244 |
64,009 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/MathUtil.java | MathUtil.approximateBinomialCoefficient | public static double approximateBinomialCoefficient(int n, int k) {
final int m = max(k, n - k);
long temp = 1;
for(int i = n, j = 1; i > m; i--, j++) {
temp = temp * i / j;
}
return temp;
} | java | public static double approximateBinomialCoefficient(int n, int k) {
final int m = max(k, n - k);
long temp = 1;
for(int i = n, j = 1; i > m; i--, j++) {
temp = temp * i / j;
}
return temp;
} | [
"public",
"static",
"double",
"approximateBinomialCoefficient",
"(",
"int",
"n",
",",
"int",
"k",
")",
"{",
"final",
"int",
"m",
"=",
"max",
"(",
"k",
",",
"n",
"-",
"k",
")",
";",
"long",
"temp",
"=",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"n",
... | Binomial coefficent, also known as "n choose k").
@param n Total number of samples. n > 0
@param k Number of elements to choose. <code>n >= k</code>,
<code>k >= 0</code>
@return n! / (k! * (n-k)!) | [
"Binomial",
"coefficent",
"also",
"known",
"as",
"n",
"choose",
"k",
")",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/MathUtil.java#L269-L276 |
64,010 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/MathUtil.java | MathUtil.sequence | public static int[] sequence(int start, int end) {
if(start >= end) {
return EMPTY_INTS;
}
int[] ret = new int[end - start];
for(int j = 0; start < end; start++, j++) {
ret[j] = start;
}
return ret;
} | java | public static int[] sequence(int start, int end) {
if(start >= end) {
return EMPTY_INTS;
}
int[] ret = new int[end - start];
for(int j = 0; start < end; start++, j++) {
ret[j] = start;
}
return ret;
} | [
"public",
"static",
"int",
"[",
"]",
"sequence",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"if",
"(",
"start",
">=",
"end",
")",
"{",
"return",
"EMPTY_INTS",
";",
"}",
"int",
"[",
"]",
"ret",
"=",
"new",
"int",
"[",
"end",
"-",
"start",
... | Generate an array of integers.
@param start First integer
@param end Last integer (exclusive!)
@return Array of integers of length end-start | [
"Generate",
"an",
"array",
"of",
"integers",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/MathUtil.java#L596-L605 |
64,011 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/KNNDistancesSampler.java | KNNDistancesSampler.run | public KNNDistanceOrderResult run(Database database, Relation<O> relation) {
final DistanceQuery<O> distanceQuery = database.getDistanceQuery(relation, getDistanceFunction());
final KNNQuery<O> knnQuery = database.getKNNQuery(distanceQuery, k + 1);
final int size = (int) ((sample <= 1.) ? Math.ceil(relatio... | java | public KNNDistanceOrderResult run(Database database, Relation<O> relation) {
final DistanceQuery<O> distanceQuery = database.getDistanceQuery(relation, getDistanceFunction());
final KNNQuery<O> knnQuery = database.getKNNQuery(distanceQuery, k + 1);
final int size = (int) ((sample <= 1.) ? Math.ceil(relatio... | [
"public",
"KNNDistanceOrderResult",
"run",
"(",
"Database",
"database",
",",
"Relation",
"<",
"O",
">",
"relation",
")",
"{",
"final",
"DistanceQuery",
"<",
"O",
">",
"distanceQuery",
"=",
"database",
".",
"getDistanceQuery",
"(",
"relation",
",",
"getDistanceFu... | Provides an order of the kNN-distances for all objects within the specified
database.
@param database Database
@param relation Relation
@return Result | [
"Provides",
"an",
"order",
"of",
"the",
"kNN",
"-",
"distances",
"for",
"all",
"objects",
"within",
"the",
"specified",
"database",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/KNNDistancesSampler.java#L137-L155 |
64,012 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/AbstractRangeQueryNeighborPredicate.java | AbstractRangeQueryNeighborPredicate.preprocess | public DataStore<M> preprocess(Class<? super M> modelcls, Relation<O> relation, RangeQuery<O> query) {
WritableDataStore<M> storage = DataStoreUtil.makeStorage(relation.getDBIDs(), DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, modelcls);
Duration time = getLogger().newDuration(this.getClass().getName... | java | public DataStore<M> preprocess(Class<? super M> modelcls, Relation<O> relation, RangeQuery<O> query) {
WritableDataStore<M> storage = DataStoreUtil.makeStorage(relation.getDBIDs(), DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, modelcls);
Duration time = getLogger().newDuration(this.getClass().getName... | [
"public",
"DataStore",
"<",
"M",
">",
"preprocess",
"(",
"Class",
"<",
"?",
"super",
"M",
">",
"modelcls",
",",
"Relation",
"<",
"O",
">",
"relation",
",",
"RangeQuery",
"<",
"O",
">",
"query",
")",
"{",
"WritableDataStore",
"<",
"M",
">",
"storage",
... | Perform the preprocessing step.
@param modelcls Class of models
@param relation Data relation
@param query Range query
@return Precomputed models | [
"Perform",
"the",
"preprocessing",
"step",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/AbstractRangeQueryNeighborPredicate.java#L94-L107 |
64,013 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/AbstractFullProjection.java | AbstractFullProjection.projectScaledToDataSpace | @Override
public <NV extends NumberVector> NV projectScaledToDataSpace(double[] v, NumberVector.Factory<NV> factory) {
final int dim = v.length;
double[] vec = new double[dim];
for(int d = 0; d < dim; d++) {
vec[d] = scales[d].getUnscaled(v[d]);
}
return factory.newNumberVector(vec);
} | java | @Override
public <NV extends NumberVector> NV projectScaledToDataSpace(double[] v, NumberVector.Factory<NV> factory) {
final int dim = v.length;
double[] vec = new double[dim];
for(int d = 0; d < dim; d++) {
vec[d] = scales[d].getUnscaled(v[d]);
}
return factory.newNumberVector(vec);
} | [
"@",
"Override",
"public",
"<",
"NV",
"extends",
"NumberVector",
">",
"NV",
"projectScaledToDataSpace",
"(",
"double",
"[",
"]",
"v",
",",
"NumberVector",
".",
"Factory",
"<",
"NV",
">",
"factory",
")",
"{",
"final",
"int",
"dim",
"=",
"v",
".",
"length"... | Project a vector from scaled space to data space.
@param <NV> Vector type
@param v vector in scaled space
@param factory Object factory
@return vector in data space | [
"Project",
"a",
"vector",
"from",
"scaled",
"space",
"to",
"data",
"space",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/AbstractFullProjection.java#L163-L171 |
64,014 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/AbstractFullProjection.java | AbstractFullProjection.projectRenderToDataSpace | @Override
public <NV extends NumberVector> NV projectRenderToDataSpace(double[] v, NumberVector.Factory<NV> prototype) {
final int dim = v.length;
double[] vec = projectRenderToScaled(v);
// Not calling {@link #projectScaledToDataSpace} to avoid extra copy of
// vector.
for(int d = 0; d < dim; d++... | java | @Override
public <NV extends NumberVector> NV projectRenderToDataSpace(double[] v, NumberVector.Factory<NV> prototype) {
final int dim = v.length;
double[] vec = projectRenderToScaled(v);
// Not calling {@link #projectScaledToDataSpace} to avoid extra copy of
// vector.
for(int d = 0; d < dim; d++... | [
"@",
"Override",
"public",
"<",
"NV",
"extends",
"NumberVector",
">",
"NV",
"projectRenderToDataSpace",
"(",
"double",
"[",
"]",
"v",
",",
"NumberVector",
".",
"Factory",
"<",
"NV",
">",
"prototype",
")",
"{",
"final",
"int",
"dim",
"=",
"v",
".",
"lengt... | Project a vector from rendering space to data space.
@param <NV> Vector type
@param v vector in rendering space
@param prototype Object factory
@return vector in data space | [
"Project",
"a",
"vector",
"from",
"rendering",
"space",
"to",
"data",
"space",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/AbstractFullProjection.java#L181-L191 |
64,015 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/AbstractFullProjection.java | AbstractFullProjection.projectRelativeScaledToDataSpace | @Override
public <NV extends NumberVector> NV projectRelativeScaledToDataSpace(double[] v, NumberVector.Factory<NV> prototype) {
final int dim = v.length;
double[] vec = new double[dim];
for(int d = 0; d < dim; d++) {
vec[d] = scales[d].getRelativeUnscaled(v[d]);
}
return prototype.newNumber... | java | @Override
public <NV extends NumberVector> NV projectRelativeScaledToDataSpace(double[] v, NumberVector.Factory<NV> prototype) {
final int dim = v.length;
double[] vec = new double[dim];
for(int d = 0; d < dim; d++) {
vec[d] = scales[d].getRelativeUnscaled(v[d]);
}
return prototype.newNumber... | [
"@",
"Override",
"public",
"<",
"NV",
"extends",
"NumberVector",
">",
"NV",
"projectRelativeScaledToDataSpace",
"(",
"double",
"[",
"]",
"v",
",",
"NumberVector",
".",
"Factory",
"<",
"NV",
">",
"prototype",
")",
"{",
"final",
"int",
"dim",
"=",
"v",
".",
... | Project a relative vector from scaled space to data space.
@param <NV> Vector type
@param v relative vector in scaled space
@param prototype Object factory
@return relative vector in data space | [
"Project",
"a",
"relative",
"vector",
"from",
"scaled",
"space",
"to",
"data",
"space",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/AbstractFullProjection.java#L201-L209 |
64,016 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/PointerHierarchyRepresentationBuilder.java | PointerHierarchyRepresentationBuilder.complete | public PointerHierarchyRepresentationResult complete() {
if(csize != null) {
csize.destroy();
csize = null;
}
if(mergecount != ids.size() - 1) {
LOG.warning(mergecount + " merges were added to the hierarchy, expected " + (ids.size() - 1));
}
if(prototypes != null) {
return ne... | java | public PointerHierarchyRepresentationResult complete() {
if(csize != null) {
csize.destroy();
csize = null;
}
if(mergecount != ids.size() - 1) {
LOG.warning(mergecount + " merges were added to the hierarchy, expected " + (ids.size() - 1));
}
if(prototypes != null) {
return ne... | [
"public",
"PointerHierarchyRepresentationResult",
"complete",
"(",
")",
"{",
"if",
"(",
"csize",
"!=",
"null",
")",
"{",
"csize",
".",
"destroy",
"(",
")",
";",
"csize",
"=",
"null",
";",
"}",
"if",
"(",
"mergecount",
"!=",
"ids",
".",
"size",
"(",
")"... | Finalize the result.
@return Completed result | [
"Finalize",
"the",
"result",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/PointerHierarchyRepresentationBuilder.java#L153-L165 |
64,017 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/PointerHierarchyRepresentationBuilder.java | PointerHierarchyRepresentationBuilder.getSize | public int getSize(DBIDRef id) {
if(csize == null) {
csize = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, 1);
}
return csize.intValue(id);
} | java | public int getSize(DBIDRef id) {
if(csize == null) {
csize = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, 1);
}
return csize.intValue(id);
} | [
"public",
"int",
"getSize",
"(",
"DBIDRef",
"id",
")",
"{",
"if",
"(",
"csize",
"==",
"null",
")",
"{",
"csize",
"=",
"DataStoreUtil",
".",
"makeIntegerStorage",
"(",
"ids",
",",
"DataStoreFactory",
".",
"HINT_HOT",
"|",
"DataStoreFactory",
".",
"HINT_TEMP",... | Get the cluster size of the current object.
@param id Object id
@return Cluster size (initially 1). | [
"Get",
"the",
"cluster",
"size",
"of",
"the",
"current",
"object",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/PointerHierarchyRepresentationBuilder.java#L173-L178 |
64,018 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/PointerHierarchyRepresentationBuilder.java | PointerHierarchyRepresentationBuilder.setSize | public void setSize(DBIDRef id, int size) {
if(csize == null) {
csize = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, 1);
}
csize.putInt(id, size);
} | java | public void setSize(DBIDRef id, int size) {
if(csize == null) {
csize = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, 1);
}
csize.putInt(id, size);
} | [
"public",
"void",
"setSize",
"(",
"DBIDRef",
"id",
",",
"int",
"size",
")",
"{",
"if",
"(",
"csize",
"==",
"null",
")",
"{",
"csize",
"=",
"DataStoreUtil",
".",
"makeIntegerStorage",
"(",
"ids",
",",
"DataStoreFactory",
".",
"HINT_HOT",
"|",
"DataStoreFact... | Set the cluster size of an object.
@param id Object to set
@param size Cluster size | [
"Set",
"the",
"cluster",
"size",
"of",
"an",
"object",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/PointerHierarchyRepresentationBuilder.java#L186-L191 |
64,019 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/spatial/SOF.java | SOF.run | public OutlierResult run(Database database, Relation<N> spatial, Relation<O> relation) {
final NeighborSetPredicate npred = getNeighborSetPredicateFactory().instantiate(database, spatial);
DistanceQuery<O> distFunc = getNonSpatialDistanceFunction().instantiate(relation);
WritableDoubleDataStore lrds = Data... | java | public OutlierResult run(Database database, Relation<N> spatial, Relation<O> relation) {
final NeighborSetPredicate npred = getNeighborSetPredicateFactory().instantiate(database, spatial);
DistanceQuery<O> distFunc = getNonSpatialDistanceFunction().instantiate(relation);
WritableDoubleDataStore lrds = Data... | [
"public",
"OutlierResult",
"run",
"(",
"Database",
"database",
",",
"Relation",
"<",
"N",
">",
"spatial",
",",
"Relation",
"<",
"O",
">",
"relation",
")",
"{",
"final",
"NeighborSetPredicate",
"npred",
"=",
"getNeighborSetPredicateFactory",
"(",
")",
".",
"ins... | The main run method
@param database Database to use (actually unused)
@param spatial Relation for neighborhood
@param relation Attributes to evaluate
@return Outlier result | [
"The",
"main",
"run",
"method"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/spatial/SOF.java#L103-L148 |
64,020 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/HandlerList.java | HandlerList.insertHandler | public void insertHandler(Class<?> restrictionClass, H handler) {
// note that the handlers list is kept in a list that is traversed in
// backwards order.
handlers.add(new Pair<Class<?>, H>(restrictionClass, handler));
} | java | public void insertHandler(Class<?> restrictionClass, H handler) {
// note that the handlers list is kept in a list that is traversed in
// backwards order.
handlers.add(new Pair<Class<?>, H>(restrictionClass, handler));
} | [
"public",
"void",
"insertHandler",
"(",
"Class",
"<",
"?",
">",
"restrictionClass",
",",
"H",
"handler",
")",
"{",
"// note that the handlers list is kept in a list that is traversed in",
"// backwards order.",
"handlers",
".",
"add",
"(",
"new",
"Pair",
"<",
"Class",
... | Insert a handler to the beginning of the stack.
@param restrictionClass restriction class
@param handler handler | [
"Insert",
"a",
"handler",
"to",
"the",
"beginning",
"of",
"the",
"stack",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/HandlerList.java#L51-L55 |
64,021 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/HandlerList.java | HandlerList.getHandler | public H getHandler(Object o) {
if(o == null) {
return null;
}
// note that we start at the end of the list.
ListIterator<Pair<Class<?>, H>> iter = handlers.listIterator(handlers.size());
while(iter.hasPrevious()) {
Pair<Class<?>, H> pair = iter.previous();
try {
// if we c... | java | public H getHandler(Object o) {
if(o == null) {
return null;
}
// note that we start at the end of the list.
ListIterator<Pair<Class<?>, H>> iter = handlers.listIterator(handlers.size());
while(iter.hasPrevious()) {
Pair<Class<?>, H> pair = iter.previous();
try {
// if we c... | [
"public",
"H",
"getHandler",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// note that we start at the end of the list.",
"ListIterator",
"<",
"Pair",
"<",
"Class",
"<",
"?",
">",
",",
"H",
">",
">",
... | Find a matching handler for the given object
@param o object to find handler for
@return handler for the object. null if no handler was found. | [
"Find",
"a",
"matching",
"handler",
"for",
"the",
"given",
"object"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/HandlerList.java#L63-L81 |
64,022 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java | Logging.getLogger | public synchronized static Logging getLogger(final String name) {
Logging logger = loggers.get(name);
if(logger == null) {
logger = new Logging(Logger.getLogger(name));
loggers.put(name, logger);
}
return logger;
} | java | public synchronized static Logging getLogger(final String name) {
Logging logger = loggers.get(name);
if(logger == null) {
logger = new Logging(Logger.getLogger(name));
loggers.put(name, logger);
}
return logger;
} | [
"public",
"synchronized",
"static",
"Logging",
"getLogger",
"(",
"final",
"String",
"name",
")",
"{",
"Logging",
"logger",
"=",
"loggers",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"logger",
"==",
"null",
")",
"{",
"logger",
"=",
"new",
"Logging",
... | Retrieve logging utility for a particular class.
@param name Class name
@return Logger | [
"Retrieve",
"logging",
"utility",
"for",
"a",
"particular",
"class",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java#L156-L163 |
64,023 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java | Logging.log | public void log(java.util.logging.Level level, CharSequence message) {
LogRecord rec = new ELKILogRecord(level, message);
logger.log(rec);
} | java | public void log(java.util.logging.Level level, CharSequence message) {
LogRecord rec = new ELKILogRecord(level, message);
logger.log(rec);
} | [
"public",
"void",
"log",
"(",
"java",
".",
"util",
".",
"logging",
".",
"Level",
"level",
",",
"CharSequence",
"message",
")",
"{",
"LogRecord",
"rec",
"=",
"new",
"ELKILogRecord",
"(",
"level",
",",
"message",
")",
";",
"logger",
".",
"log",
"(",
"rec... | Log a log message at the given level.
@param level Level to log at.
@param message Message to log. | [
"Log",
"a",
"log",
"message",
"at",
"the",
"given",
"level",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java#L257-L260 |
64,024 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java | Logging.error | public void error(CharSequence message, Throwable e) {
log(Level.SEVERE, message, e);
} | java | public void error(CharSequence message, Throwable e) {
log(Level.SEVERE, message, e);
} | [
"public",
"void",
"error",
"(",
"CharSequence",
"message",
",",
"Throwable",
"e",
")",
"{",
"log",
"(",
"Level",
".",
"SEVERE",
",",
"message",
",",
"e",
")",
";",
"}"
] | Log a message at the 'severe' level.
@param message Warning log message.
@param e Exception | [
"Log",
"a",
"message",
"at",
"the",
"severe",
"level",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java#L290-L292 |
64,025 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java | Logging.warning | public void warning(CharSequence message, Throwable e) {
log(Level.WARNING, message, e);
} | java | public void warning(CharSequence message, Throwable e) {
log(Level.WARNING, message, e);
} | [
"public",
"void",
"warning",
"(",
"CharSequence",
"message",
",",
"Throwable",
"e",
")",
"{",
"log",
"(",
"Level",
".",
"WARNING",
",",
"message",
",",
"e",
")",
";",
"}"
] | Log a message at the 'warning' level.
@param message Warning log message.
@param e Exception | [
"Log",
"a",
"message",
"at",
"the",
"warning",
"level",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java#L309-L311 |
64,026 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java | Logging.statistics | public void statistics(CharSequence message, Throwable e) {
log(Level.STATISTICS, message, e);
} | java | public void statistics(CharSequence message, Throwable e) {
log(Level.STATISTICS, message, e);
} | [
"public",
"void",
"statistics",
"(",
"CharSequence",
"message",
",",
"Throwable",
"e",
")",
"{",
"log",
"(",
"Level",
".",
"STATISTICS",
",",
"message",
",",
"e",
")",
";",
"}"
] | Log a message at the 'STATISTICS' level.
You should check isTime() before building the message.
@param message Informational log message.
@param e Exception | [
"Log",
"a",
"message",
"at",
"the",
"STATISTICS",
"level",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java#L330-L332 |
64,027 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java | Logging.veryverbose | public void veryverbose(CharSequence message, Throwable e) {
log(Level.VERYVERBOSE, message, e);
} | java | public void veryverbose(CharSequence message, Throwable e) {
log(Level.VERYVERBOSE, message, e);
} | [
"public",
"void",
"veryverbose",
"(",
"CharSequence",
"message",
",",
"Throwable",
"e",
")",
"{",
"log",
"(",
"Level",
".",
"VERYVERBOSE",
",",
"message",
",",
"e",
")",
";",
"}"
] | Log a message at the 'veryverbose' level.
You should check isVeryVerbose() before building the message.
@param message Informational log message.
@param e Exception | [
"Log",
"a",
"message",
"at",
"the",
"veryverbose",
"level",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java#L399-L401 |
64,028 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java | Logging.exception | public void exception(CharSequence message, Throwable e) {
log(Level.SEVERE, message, e);
} | java | public void exception(CharSequence message, Throwable e) {
log(Level.SEVERE, message, e);
} | [
"public",
"void",
"exception",
"(",
"CharSequence",
"message",
",",
"Throwable",
"e",
")",
"{",
"log",
"(",
"Level",
".",
"SEVERE",
",",
"message",
",",
"e",
")",
";",
"}"
] | Log a message with exception at the 'severe' level.
@param message Error log message.
@param e Exception | [
"Log",
"a",
"message",
"with",
"exception",
"at",
"the",
"severe",
"level",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java#L581-L583 |
64,029 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java | Logging.exception | public void exception(Throwable e) {
final String msg = e.getMessage();
log(Level.SEVERE, msg != null ? msg : "An exception occurred.", e);
} | java | public void exception(Throwable e) {
final String msg = e.getMessage();
log(Level.SEVERE, msg != null ? msg : "An exception occurred.", e);
} | [
"public",
"void",
"exception",
"(",
"Throwable",
"e",
")",
"{",
"final",
"String",
"msg",
"=",
"e",
".",
"getMessage",
"(",
")",
";",
"log",
"(",
"Level",
".",
"SEVERE",
",",
"msg",
"!=",
"null",
"?",
"msg",
":",
"\"An exception occurred.\"",
",",
"e",... | Log an exception at the 'severe' level.
@param e Exception | [
"Log",
"an",
"exception",
"at",
"the",
"severe",
"level",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java#L590-L593 |
64,030 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java | Logging.statistics | public void statistics(Statistic stats) {
if(stats != null) {
log(Level.STATISTICS, stats.getKey() + ": " + stats.formatValue());
}
} | java | public void statistics(Statistic stats) {
if(stats != null) {
log(Level.STATISTICS, stats.getKey() + ": " + stats.formatValue());
}
} | [
"public",
"void",
"statistics",
"(",
"Statistic",
"stats",
")",
"{",
"if",
"(",
"stats",
"!=",
"null",
")",
"{",
"log",
"(",
"Level",
".",
"STATISTICS",
",",
"stats",
".",
"getKey",
"(",
")",
"+",
"\": \"",
"+",
"stats",
".",
"formatValue",
"(",
")",... | Log a statistics object.
@param stats Statistics object to report. | [
"Log",
"a",
"statistics",
"object",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java#L690-L694 |
64,031 | elki-project/elki | elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/data/synthetic/bymodel/GeneratorMain.java | GeneratorMain.generate | public MultipleObjectsBundle generate() {
// we actually need some clusters.
if(generators.isEmpty()) {
throw new AbortException("No clusters specified.");
}
// Assert that cluster dimensions agree.
final int dim = generators.get(0).getDim();
for(GeneratorInterface c : generators) {
... | java | public MultipleObjectsBundle generate() {
// we actually need some clusters.
if(generators.isEmpty()) {
throw new AbortException("No clusters specified.");
}
// Assert that cluster dimensions agree.
final int dim = generators.get(0).getDim();
for(GeneratorInterface c : generators) {
... | [
"public",
"MultipleObjectsBundle",
"generate",
"(",
")",
"{",
"// we actually need some clusters.",
"if",
"(",
"generators",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"AbortException",
"(",
"\"No clusters specified.\"",
")",
";",
"}",
"// Assert that cluster... | Main loop to generate data set.
@return Generated data set | [
"Main",
"loop",
"to",
"generate",
"data",
"set",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/data/synthetic/bymodel/GeneratorMain.java#L112-L169 |
64,032 | elki-project/elki | elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/data/synthetic/bymodel/GeneratorMain.java | GeneratorMain.initLabelsAndModels | private void initLabelsAndModels(ArrayList<GeneratorInterface> generators, ClassLabel[] labels, Model[] models, Pattern reassign) {
int existingclusters = 0;
if(reassign != null) {
for(int i = 0; i < labels.length; i++) {
final GeneratorInterface curclus = generators.get(i);
if(!reassign.m... | java | private void initLabelsAndModels(ArrayList<GeneratorInterface> generators, ClassLabel[] labels, Model[] models, Pattern reassign) {
int existingclusters = 0;
if(reassign != null) {
for(int i = 0; i < labels.length; i++) {
final GeneratorInterface curclus = generators.get(i);
if(!reassign.m... | [
"private",
"void",
"initLabelsAndModels",
"(",
"ArrayList",
"<",
"GeneratorInterface",
">",
"generators",
",",
"ClassLabel",
"[",
"]",
"labels",
",",
"Model",
"[",
"]",
"models",
",",
"Pattern",
"reassign",
")",
"{",
"int",
"existingclusters",
"=",
"0",
";",
... | Initialize cluster labels and models.
Clusters that are set to "reassign" will have their labels set to null, or
if there is only one possible reassignment, to this target label.
@param generators Cluster generators
@param labels Labels (output)
@param models Models (output)
@param reassign Pattern for clusters to re... | [
"Initialize",
"cluster",
"labels",
"and",
"models",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/data/synthetic/bymodel/GeneratorMain.java#L360-L396 |
64,033 | elki-project/elki | elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/database/relation/RelationUtil.java | RelationUtil.assumeVectorField | public static <V extends FeatureVector<?>> VectorFieldTypeInformation<V> assumeVectorField(Relation<V> relation) {
try {
return ((VectorFieldTypeInformation<V>) relation.getDataTypeInformation());
}
catch(Exception e) {
throw new UnsupportedOperationException("Expected a vector field, got type i... | java | public static <V extends FeatureVector<?>> VectorFieldTypeInformation<V> assumeVectorField(Relation<V> relation) {
try {
return ((VectorFieldTypeInformation<V>) relation.getDataTypeInformation());
}
catch(Exception e) {
throw new UnsupportedOperationException("Expected a vector field, got type i... | [
"public",
"static",
"<",
"V",
"extends",
"FeatureVector",
"<",
"?",
">",
">",
"VectorFieldTypeInformation",
"<",
"V",
">",
"assumeVectorField",
"(",
"Relation",
"<",
"V",
">",
"relation",
")",
"{",
"try",
"{",
"return",
"(",
"(",
"VectorFieldTypeInformation",
... | Get the vector field type information from a relation.
@param relation relation
@param <V> Vector type
@return Vector field type information | [
"Get",
"the",
"vector",
"field",
"type",
"information",
"from",
"a",
"relation",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/database/relation/RelationUtil.java#L66-L73 |
64,034 | elki-project/elki | elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/database/relation/RelationUtil.java | RelationUtil.getNumberVectorFactory | public static <V extends NumberVector> NumberVector.Factory<V> getNumberVectorFactory(Relation<V> relation) {
final VectorFieldTypeInformation<V> type = assumeVectorField(relation);
@SuppressWarnings("unchecked")
final NumberVector.Factory<V> factory = (NumberVector.Factory<V>) type.getFactory();
return... | java | public static <V extends NumberVector> NumberVector.Factory<V> getNumberVectorFactory(Relation<V> relation) {
final VectorFieldTypeInformation<V> type = assumeVectorField(relation);
@SuppressWarnings("unchecked")
final NumberVector.Factory<V> factory = (NumberVector.Factory<V>) type.getFactory();
return... | [
"public",
"static",
"<",
"V",
"extends",
"NumberVector",
">",
"NumberVector",
".",
"Factory",
"<",
"V",
">",
"getNumberVectorFactory",
"(",
"Relation",
"<",
"V",
">",
"relation",
")",
"{",
"final",
"VectorFieldTypeInformation",
"<",
"V",
">",
"type",
"=",
"a... | Get the number vector factory of a database relation.
@param relation relation
@param <V> Vector type
@return Vector field type information | [
"Get",
"the",
"number",
"vector",
"factory",
"of",
"a",
"database",
"relation",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/database/relation/RelationUtil.java#L82-L87 |
64,035 | elki-project/elki | elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/database/relation/RelationUtil.java | RelationUtil.dimensionality | public static int dimensionality(Relation<? extends SpatialComparable> relation) {
final SimpleTypeInformation<? extends SpatialComparable> type = relation.getDataTypeInformation();
if(type instanceof FieldTypeInformation) {
return ((FieldTypeInformation) type).getDimensionality();
}
return -1;
... | java | public static int dimensionality(Relation<? extends SpatialComparable> relation) {
final SimpleTypeInformation<? extends SpatialComparable> type = relation.getDataTypeInformation();
if(type instanceof FieldTypeInformation) {
return ((FieldTypeInformation) type).getDimensionality();
}
return -1;
... | [
"public",
"static",
"int",
"dimensionality",
"(",
"Relation",
"<",
"?",
"extends",
"SpatialComparable",
">",
"relation",
")",
"{",
"final",
"SimpleTypeInformation",
"<",
"?",
"extends",
"SpatialComparable",
">",
"type",
"=",
"relation",
".",
"getDataTypeInformation"... | Get the dimensionality of a database relation.
@param relation relation
@return Database dimensionality | [
"Get",
"the",
"dimensionality",
"of",
"a",
"database",
"relation",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/database/relation/RelationUtil.java#L95-L101 |
64,036 | elki-project/elki | elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/database/relation/RelationUtil.java | RelationUtil.computeMinMax | public static double[][] computeMinMax(Relation<? extends NumberVector> relation) {
int dim = RelationUtil.dimensionality(relation);
double[] mins = new double[dim], maxs = new double[dim];
for(int i = 0; i < dim; i++) {
mins[i] = Double.MAX_VALUE;
maxs[i] = -Double.MAX_VALUE;
}
for(DBID... | java | public static double[][] computeMinMax(Relation<? extends NumberVector> relation) {
int dim = RelationUtil.dimensionality(relation);
double[] mins = new double[dim], maxs = new double[dim];
for(int i = 0; i < dim; i++) {
mins[i] = Double.MAX_VALUE;
maxs[i] = -Double.MAX_VALUE;
}
for(DBID... | [
"public",
"static",
"double",
"[",
"]",
"[",
"]",
"computeMinMax",
"(",
"Relation",
"<",
"?",
"extends",
"NumberVector",
">",
"relation",
")",
"{",
"int",
"dim",
"=",
"RelationUtil",
".",
"dimensionality",
"(",
"relation",
")",
";",
"double",
"[",
"]",
"... | Determines the minimum and maximum values in each dimension of all objects
stored in the given database.
@param relation the database storing the objects
@return Minimum and Maximum vector for the hyperrectangle | [
"Determines",
"the",
"minimum",
"and",
"maximum",
"values",
"in",
"each",
"dimension",
"of",
"all",
"objects",
"stored",
"in",
"the",
"given",
"database",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/database/relation/RelationUtil.java#L110-L126 |
64,037 | elki-project/elki | elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/database/relation/RelationUtil.java | RelationUtil.getColumnLabel | public static <V extends SpatialComparable> String getColumnLabel(Relation<? extends V> rel, int col) {
SimpleTypeInformation<? extends V> type = rel.getDataTypeInformation();
if(!(type instanceof VectorFieldTypeInformation)) {
return "Column " + col;
}
final VectorFieldTypeInformation<?> vtype = ... | java | public static <V extends SpatialComparable> String getColumnLabel(Relation<? extends V> rel, int col) {
SimpleTypeInformation<? extends V> type = rel.getDataTypeInformation();
if(!(type instanceof VectorFieldTypeInformation)) {
return "Column " + col;
}
final VectorFieldTypeInformation<?> vtype = ... | [
"public",
"static",
"<",
"V",
"extends",
"SpatialComparable",
">",
"String",
"getColumnLabel",
"(",
"Relation",
"<",
"?",
"extends",
"V",
">",
"rel",
",",
"int",
"col",
")",
"{",
"SimpleTypeInformation",
"<",
"?",
"extends",
"V",
">",
"type",
"=",
"rel",
... | Get the column name or produce a generic label "Column XY".
@param rel Relation
@param col Column
@param <V> Vector type
@return Label | [
"Get",
"the",
"column",
"name",
"or",
"produce",
"a",
"generic",
"label",
"Column",
"XY",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/database/relation/RelationUtil.java#L162-L170 |
64,038 | elki-project/elki | elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/database/relation/RelationUtil.java | RelationUtil.relationUglyVectorCast | @SuppressWarnings("unchecked")
public static <V extends NumberVector, T extends NumberVector> Relation<V> relationUglyVectorCast(Relation<T> database) {
return (Relation<V>) database;
} | java | @SuppressWarnings("unchecked")
public static <V extends NumberVector, T extends NumberVector> Relation<V> relationUglyVectorCast(Relation<T> database) {
return (Relation<V>) database;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"V",
"extends",
"NumberVector",
",",
"T",
"extends",
"NumberVector",
">",
"Relation",
"<",
"V",
">",
"relationUglyVectorCast",
"(",
"Relation",
"<",
"T",
">",
"database",
")",
"{",
... | An ugly vector type cast unavoidable in some situations due to Generics.
@param <V> Base vector type
@param <T> Derived vector type (is actually V, too)
@param database Database
@return Database | [
"An",
"ugly",
"vector",
"type",
"cast",
"unavoidable",
"in",
"some",
"situations",
"due",
"to",
"Generics",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/database/relation/RelationUtil.java#L180-L183 |
64,039 | elki-project/elki | elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/knn/AbstractMaterializeKNNPreprocessor.java | AbstractMaterializeKNNPreprocessor.get | public KNNList get(DBIDRef id) {
if(storage == null) {
if(getLogger().isDebugging()) {
getLogger().debug("Running kNN preprocessor: " + this.getClass());
}
preprocess();
}
return storage.get(id);
} | java | public KNNList get(DBIDRef id) {
if(storage == null) {
if(getLogger().isDebugging()) {
getLogger().debug("Running kNN preprocessor: " + this.getClass());
}
preprocess();
}
return storage.get(id);
} | [
"public",
"KNNList",
"get",
"(",
"DBIDRef",
"id",
")",
"{",
"if",
"(",
"storage",
"==",
"null",
")",
"{",
"if",
"(",
"getLogger",
"(",
")",
".",
"isDebugging",
"(",
")",
")",
"{",
"getLogger",
"(",
")",
".",
"debug",
"(",
"\"Running kNN preprocessor: \... | Get the k nearest neighbors.
@param id Object ID
@return Neighbors | [
"Get",
"the",
"k",
"nearest",
"neighbors",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/knn/AbstractMaterializeKNNPreprocessor.java#L111-L119 |
64,040 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/COPAC.java | COPAC.run | public Clustering<DimensionModel> run(Database database, Relation<V> relation) {
COPACNeighborPredicate.Instance npred = new COPACNeighborPredicate<V>(settings).instantiate(database, relation);
CorePredicate.Instance<DBIDs> cpred = new MinPtsCorePredicate(settings.minpts).instantiate(database);
Clustering<M... | java | public Clustering<DimensionModel> run(Database database, Relation<V> relation) {
COPACNeighborPredicate.Instance npred = new COPACNeighborPredicate<V>(settings).instantiate(database, relation);
CorePredicate.Instance<DBIDs> cpred = new MinPtsCorePredicate(settings.minpts).instantiate(database);
Clustering<M... | [
"public",
"Clustering",
"<",
"DimensionModel",
">",
"run",
"(",
"Database",
"database",
",",
"Relation",
"<",
"V",
">",
"relation",
")",
"{",
"COPACNeighborPredicate",
".",
"Instance",
"npred",
"=",
"new",
"COPACNeighborPredicate",
"<",
"V",
">",
"(",
"setting... | Run the COPAC algorithm.
@param database Database
@param relation Vector field relation
@return COPAC clustering | [
"Run",
"the",
"COPAC",
"algorithm",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/COPAC.java#L112-L128 |
64,041 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/pairsegments/Segment.java | Segment.getUnpairedClusteringIndex | public int getUnpairedClusteringIndex() {
for(int index = 0; index < clusterIds.length; index++) {
if(clusterIds[index] == UNCLUSTERED) {
return index;
}
}
return -1;
} | java | public int getUnpairedClusteringIndex() {
for(int index = 0; index < clusterIds.length; index++) {
if(clusterIds[index] == UNCLUSTERED) {
return index;
}
}
return -1;
} | [
"public",
"int",
"getUnpairedClusteringIndex",
"(",
")",
"{",
"for",
"(",
"int",
"index",
"=",
"0",
";",
"index",
"<",
"clusterIds",
".",
"length",
";",
"index",
"++",
")",
"{",
"if",
"(",
"clusterIds",
"[",
"index",
"]",
"==",
"UNCLUSTERED",
")",
"{",... | Returns the index of the first clustering having an unpaired cluster, or -1
no unpaired cluster exists.
@return clustering id or -1 | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"clustering",
"having",
"an",
"unpaired",
"cluster",
"or",
"-",
"1",
"no",
"unpaired",
"cluster",
"exists",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/pairsegments/Segment.java#L132-L139 |
64,042 | elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/set/AbstractSetDistanceFunction.java | AbstractSetDistanceFunction.isNull | protected static boolean isNull(Object val) {
return (val == null) || STRING_NULL.equals(val) || DOUBLE_NULL.equals(val) || INTEGER_NULL.equals(val);
} | java | protected static boolean isNull(Object val) {
return (val == null) || STRING_NULL.equals(val) || DOUBLE_NULL.equals(val) || INTEGER_NULL.equals(val);
} | [
"protected",
"static",
"boolean",
"isNull",
"(",
"Object",
"val",
")",
"{",
"return",
"(",
"val",
"==",
"null",
")",
"||",
"STRING_NULL",
".",
"equals",
"(",
"val",
")",
"||",
"DOUBLE_NULL",
".",
"equals",
"(",
"val",
")",
"||",
"INTEGER_NULL",
".",
"e... | Test a value for null.
TODO: delegate to {@link FeatureVector} instead?
@param val Value
@return true when null | [
"Test",
"a",
"value",
"for",
"null",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/set/AbstractSetDistanceFunction.java#L58-L60 |
64,043 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/WrongParameterValueException.java | WrongParameterValueException.formatCause | private static String formatCause(Throwable cause) {
if(cause == null) {
return "";
}
String message = cause.getMessage();
return "\n" + (message != null ? message : cause.toString());
} | java | private static String formatCause(Throwable cause) {
if(cause == null) {
return "";
}
String message = cause.getMessage();
return "\n" + (message != null ? message : cause.toString());
} | [
"private",
"static",
"String",
"formatCause",
"(",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"cause",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"String",
"message",
"=",
"cause",
".",
"getMessage",
"(",
")",
";",
"return",
"\"\\n\"",
"+",
"(... | Format the error cause.
@param cause Error cause.
@return String representation | [
"Format",
"the",
"error",
"cause",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/WrongParameterValueException.java#L96-L102 |
64,044 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/textwriter/TextWriterStream.java | TextWriterStream.getWriterFor | public TextWriterWriterInterface<?> getWriterFor(Object o) {
if(o == null) {
return null;
}
TextWriterWriterInterface<?> writer = writers.getHandler(o);
if(writer != null) {
return writer;
}
try {
final Class<?> decl = o.getClass().getMethod("toString").getDeclaringClass();
... | java | public TextWriterWriterInterface<?> getWriterFor(Object o) {
if(o == null) {
return null;
}
TextWriterWriterInterface<?> writer = writers.getHandler(o);
if(writer != null) {
return writer;
}
try {
final Class<?> decl = o.getClass().getMethod("toString").getDeclaringClass();
... | [
"public",
"TextWriterWriterInterface",
"<",
"?",
">",
"getWriterFor",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"TextWriterWriterInterface",
"<",
"?",
">",
"writer",
"=",
"writers",
".",
"getHandler",... | Retrieve an appropriate writer from the handler list.
@param o query object
@return appropriate write, if available | [
"Retrieve",
"an",
"appropriate",
"writer",
"from",
"the",
"handler",
"list",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/textwriter/TextWriterStream.java#L229-L248 |
64,045 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/biclustering/AbstractBiclustering.java | AbstractBiclustering.defineBicluster | protected Cluster<BiclusterModel> defineBicluster(BitSet rows, BitSet cols) {
ArrayDBIDs rowIDs = rowsBitsetToIDs(rows);
int[] colIDs = colsBitsetToIDs(cols);
return new Cluster<>(rowIDs, new BiclusterModel(colIDs));
} | java | protected Cluster<BiclusterModel> defineBicluster(BitSet rows, BitSet cols) {
ArrayDBIDs rowIDs = rowsBitsetToIDs(rows);
int[] colIDs = colsBitsetToIDs(cols);
return new Cluster<>(rowIDs, new BiclusterModel(colIDs));
} | [
"protected",
"Cluster",
"<",
"BiclusterModel",
">",
"defineBicluster",
"(",
"BitSet",
"rows",
",",
"BitSet",
"cols",
")",
"{",
"ArrayDBIDs",
"rowIDs",
"=",
"rowsBitsetToIDs",
"(",
"rows",
")",
";",
"int",
"[",
"]",
"colIDs",
"=",
"colsBitsetToIDs",
"(",
"col... | Defines a Bicluster as given by the included rows and columns.
@param rows the rows included in the Bicluster
@param cols the columns included in the Bicluster
@return a Bicluster as given by the included rows and columns | [
"Defines",
"a",
"Bicluster",
"as",
"given",
"by",
"the",
"included",
"rows",
"and",
"columns",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/biclustering/AbstractBiclustering.java#L157-L161 |
64,046 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/StatisticalMoments.java | StatisticalMoments.getSampleSkewness | public double getSampleSkewness() {
if(!(m2 > 0) || !(n > 2)) {
throw new ArithmeticException("Skewness not defined when variance is 0 or weight <= 2.0!");
}
return (m3 * n / (n - 1) / (n - 2)) / FastMath.pow(getSampleVariance(), 1.5);
} | java | public double getSampleSkewness() {
if(!(m2 > 0) || !(n > 2)) {
throw new ArithmeticException("Skewness not defined when variance is 0 or weight <= 2.0!");
}
return (m3 * n / (n - 1) / (n - 2)) / FastMath.pow(getSampleVariance(), 1.5);
} | [
"public",
"double",
"getSampleSkewness",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"m2",
">",
"0",
")",
"||",
"!",
"(",
"n",
">",
"2",
")",
")",
"{",
"throw",
"new",
"ArithmeticException",
"(",
"\"Skewness not defined when variance is 0 or weight <= 2.0!\"",
")",
... | Get the skewness using sample variance.
@return Skewness | [
"Get",
"the",
"skewness",
"using",
"sample",
"variance",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/StatisticalMoments.java#L250-L255 |
64,047 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java | SphereUtil.cosineOrHaversineDeg | public static double cosineOrHaversineDeg(double lat1, double lon1, double lat2, double lon2) {
return cosineOrHaversineRad(deg2rad(lat1), deg2rad(lon1), deg2rad(lat2), deg2rad(lon2));
} | java | public static double cosineOrHaversineDeg(double lat1, double lon1, double lat2, double lon2) {
return cosineOrHaversineRad(deg2rad(lat1), deg2rad(lon1), deg2rad(lat2), deg2rad(lon2));
} | [
"public",
"static",
"double",
"cosineOrHaversineDeg",
"(",
"double",
"lat1",
",",
"double",
"lon1",
",",
"double",
"lat2",
",",
"double",
"lon2",
")",
"{",
"return",
"cosineOrHaversineRad",
"(",
"deg2rad",
"(",
"lat1",
")",
",",
"deg2rad",
"(",
"lon1",
")",
... | Use cosine or haversine dynamically.
Complexity: 4-5 trigonometric functions, 1 sqrt.
@param lat1 Latitude of first point in degree
@param lon1 Longitude of first point in degree
@param lat2 Latitude of second point in degree
@param lon2 Longitude of second point in degree
@return Distance on unit sphere | [
"Use",
"cosine",
"or",
"haversine",
"dynamically",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java#L200-L202 |
64,048 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java | SphereUtil.crossTrackDistanceRad | public static double crossTrackDistanceRad(double lat1, double lon1, double lat2, double lon2, double latQ, double lonQ, double dist1Q) {
final double dlon12 = lon2 - lon1;
final double dlon1Q = lonQ - lon1;
// Compute trigonometric functions only once.
final DoubleWrapper tmp = new DoubleWrapper(); //... | java | public static double crossTrackDistanceRad(double lat1, double lon1, double lat2, double lon2, double latQ, double lonQ, double dist1Q) {
final double dlon12 = lon2 - lon1;
final double dlon1Q = lonQ - lon1;
// Compute trigonometric functions only once.
final DoubleWrapper tmp = new DoubleWrapper(); //... | [
"public",
"static",
"double",
"crossTrackDistanceRad",
"(",
"double",
"lat1",
",",
"double",
"lon1",
",",
"double",
"lat2",
",",
"double",
"lon2",
",",
"double",
"latQ",
",",
"double",
"lonQ",
",",
"double",
"dist1Q",
")",
"{",
"final",
"double",
"dlon12",
... | Compute the cross-track distance.
@param lat1 Latitude of starting point.
@param lon1 Longitude of starting point.
@param lat2 Latitude of destination point.
@param lon2 Longitude of destination point.
@param latQ Latitude of query point.
@param lonQ Longitude of query point.
@param dist1Q Distance from starting point... | [
"Compute",
"the",
"cross",
"-",
"track",
"distance",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java#L436-L462 |
64,049 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java | SphereUtil.alongTrackDistanceRad | public static double alongTrackDistanceRad(double lat1, double lon1, double lat2, double lon2, double latQ, double lonQ, double dist1Q, double ctd) {
// FIXME: optimize the sign computation!
int sign = Math.abs(bearingRad(lat1, lon1, lat2, lon2) - bearingRad(lat1, lon1, latQ, lonQ)) < HALFPI ? +1 : -1;
retu... | java | public static double alongTrackDistanceRad(double lat1, double lon1, double lat2, double lon2, double latQ, double lonQ, double dist1Q, double ctd) {
// FIXME: optimize the sign computation!
int sign = Math.abs(bearingRad(lat1, lon1, lat2, lon2) - bearingRad(lat1, lon1, latQ, lonQ)) < HALFPI ? +1 : -1;
retu... | [
"public",
"static",
"double",
"alongTrackDistanceRad",
"(",
"double",
"lat1",
",",
"double",
"lon1",
",",
"double",
"lat2",
",",
"double",
"lon2",
",",
"double",
"latQ",
",",
"double",
"lonQ",
",",
"double",
"dist1Q",
",",
"double",
"ctd",
")",
"{",
"// FI... | The along track distance, is the distance from S to Q along the track S to
E.
ATD=acos(cos(dist_SQ)/cos(XTD))
TODO: optimize: can we do a faster sign computation?
@param lat1 Latitude of starting point in radians.
@param lon1 Longitude of starting point in radians.
@param lat2 Latitude of destination point in radian... | [
"The",
"along",
"track",
"distance",
"is",
"the",
"distance",
"from",
"S",
"to",
"Q",
"along",
"the",
"track",
"S",
"to",
"E",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java#L616-L622 |
64,050 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/AutotuningPCA.java | AutotuningPCA.reversed | private static double[] reversed(double[] a) {
// TODO: there doesn't appear to be a nicer version in Java, unfortunately.
Arrays.sort(a);
for(int i = 0, j = a.length - 1; i < j; i++, j--) {
double tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
return a;
} | java | private static double[] reversed(double[] a) {
// TODO: there doesn't appear to be a nicer version in Java, unfortunately.
Arrays.sort(a);
for(int i = 0, j = a.length - 1; i < j; i++, j--) {
double tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
return a;
} | [
"private",
"static",
"double",
"[",
"]",
"reversed",
"(",
"double",
"[",
"]",
"a",
")",
"{",
"// TODO: there doesn't appear to be a nicer version in Java, unfortunately.",
"Arrays",
".",
"sort",
"(",
"a",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"j",
... | Sort an array of doubles in descending order.
@param a Values
@return Values in descending order | [
"Sort",
"an",
"array",
"of",
"doubles",
"in",
"descending",
"order",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/AutotuningPCA.java#L201-L210 |
64,051 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/AutotuningPCA.java | AutotuningPCA.computeExplainedVariance | private double computeExplainedVariance(double[] eigenValues, int filteredEigenPairs) {
double strongsum = 0., weaksum = 0.;
for(int i = 0; i < filteredEigenPairs; i++) {
strongsum += eigenValues[i];
}
for(int i = filteredEigenPairs; i < eigenValues.length; i++) {
weaksum += eigenValues[i];
... | java | private double computeExplainedVariance(double[] eigenValues, int filteredEigenPairs) {
double strongsum = 0., weaksum = 0.;
for(int i = 0; i < filteredEigenPairs; i++) {
strongsum += eigenValues[i];
}
for(int i = filteredEigenPairs; i < eigenValues.length; i++) {
weaksum += eigenValues[i];
... | [
"private",
"double",
"computeExplainedVariance",
"(",
"double",
"[",
"]",
"eigenValues",
",",
"int",
"filteredEigenPairs",
")",
"{",
"double",
"strongsum",
"=",
"0.",
",",
"weaksum",
"=",
"0.",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"filte... | Compute the explained variance for a filtered EigenPairs.
@param eigenValues Eigen values
@param filteredEigenPairs Filtered eigenpairs
@return explained variance by the strong eigenvectors. | [
"Compute",
"the",
"explained",
"variance",
"for",
"a",
"filtered",
"EigenPairs",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/AutotuningPCA.java#L219-L228 |
64,052 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/AutotuningPCA.java | AutotuningPCA.assertSortedByDistance | private void assertSortedByDistance(DoubleDBIDList results) {
// TODO: sort results instead?
double dist = -1.0;
boolean sorted = true;
for(DoubleDBIDListIter it = results.iter(); it.valid(); it.advance()) {
double qr = it.doubleValue();
if(qr < dist) {
sorted = false;
}
... | java | private void assertSortedByDistance(DoubleDBIDList results) {
// TODO: sort results instead?
double dist = -1.0;
boolean sorted = true;
for(DoubleDBIDListIter it = results.iter(); it.valid(); it.advance()) {
double qr = it.doubleValue();
if(qr < dist) {
sorted = false;
}
... | [
"private",
"void",
"assertSortedByDistance",
"(",
"DoubleDBIDList",
"results",
")",
"{",
"// TODO: sort results instead?",
"double",
"dist",
"=",
"-",
"1.0",
";",
"boolean",
"sorted",
"=",
"true",
";",
"for",
"(",
"DoubleDBIDListIter",
"it",
"=",
"results",
".",
... | Ensure that the results are sorted by distance.
@param results Results to process | [
"Ensure",
"that",
"the",
"results",
"are",
"sorted",
"by",
"distance",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/AutotuningPCA.java#L235-L254 |
64,053 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/ParameterException.java | ParameterException.prefixParameterToMessage | public static String prefixParameterToMessage(Parameter<?> p, String message) {
return new StringBuilder(100 + message.length()) //
.append(p instanceof Flag ? "Flag '" : "Parameter '") //
.append(p.getOptionID().getName()) //
.append("' ").append(message).toString();
} | java | public static String prefixParameterToMessage(Parameter<?> p, String message) {
return new StringBuilder(100 + message.length()) //
.append(p instanceof Flag ? "Flag '" : "Parameter '") //
.append(p.getOptionID().getName()) //
.append("' ").append(message).toString();
} | [
"public",
"static",
"String",
"prefixParameterToMessage",
"(",
"Parameter",
"<",
"?",
">",
"p",
",",
"String",
"message",
")",
"{",
"return",
"new",
"StringBuilder",
"(",
"100",
"+",
"message",
".",
"length",
"(",
")",
")",
"//",
".",
"append",
"(",
"p",... | Prefix parameter information to error message.
@param p Parameter
@param message Error message
@return Combined error message | [
"Prefix",
"parameter",
"information",
"to",
"error",
"message",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/ParameterException.java#L85-L90 |
64,054 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/ParameterException.java | ParameterException.prefixParametersToMessage | public static String prefixParametersToMessage(Parameter<?> p, String mid, Parameter<?> p2, String message) {
return new StringBuilder(200 + mid.length() + message.length())//
.append(p instanceof Flag ? "Flag '" : "Parameter '") //
.append(p.getOptionID().getName()) //
.append("' ").append(... | java | public static String prefixParametersToMessage(Parameter<?> p, String mid, Parameter<?> p2, String message) {
return new StringBuilder(200 + mid.length() + message.length())//
.append(p instanceof Flag ? "Flag '" : "Parameter '") //
.append(p.getOptionID().getName()) //
.append("' ").append(... | [
"public",
"static",
"String",
"prefixParametersToMessage",
"(",
"Parameter",
"<",
"?",
">",
"p",
",",
"String",
"mid",
",",
"Parameter",
"<",
"?",
">",
"p2",
",",
"String",
"message",
")",
"{",
"return",
"new",
"StringBuilder",
"(",
"200",
"+",
"mid",
".... | Prefix parameters to error message.
@param p Parameter
@param p2 Parameter
@param message Error message
@return Combined error message | [
"Prefix",
"parameters",
"to",
"error",
"message",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/ParameterException.java#L100-L108 |
64,055 | elki-project/elki | elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/NonFlatRStarTree.java | NonFlatRStarTree.computeHeight | @Override
protected int computeHeight() {
N node = getRoot();
int height = 1;
// compute height
while(!node.isLeaf() && node.getNumEntries() != 0) {
E entry = node.getEntry(0);
node = getNode(entry);
height++;
}
return height;
} | java | @Override
protected int computeHeight() {
N node = getRoot();
int height = 1;
// compute height
while(!node.isLeaf() && node.getNumEntries() != 0) {
E entry = node.getEntry(0);
node = getNode(entry);
height++;
}
return height;
} | [
"@",
"Override",
"protected",
"int",
"computeHeight",
"(",
")",
"{",
"N",
"node",
"=",
"getRoot",
"(",
")",
";",
"int",
"height",
"=",
"1",
";",
"// compute height",
"while",
"(",
"!",
"node",
".",
"isLeaf",
"(",
")",
"&&",
"node",
".",
"getNumEntries"... | Computes the height of this RTree. Is called by the constructor. and should
be overwritten by subclasses if necessary.
@return the height of this RTree | [
"Computes",
"the",
"height",
"of",
"this",
"RTree",
".",
"Is",
"called",
"by",
"the",
"constructor",
".",
"and",
"should",
"be",
"overwritten",
"by",
"subclasses",
"if",
"necessary",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/NonFlatRStarTree.java#L92-L104 |
64,056 | elki-project/elki | elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/NonFlatRStarTree.java | NonFlatRStarTree.createBulkDirectoryNodes | private List<E> createBulkDirectoryNodes(List<E> nodes) {
int minEntries = dirMinimum;
int maxEntries = dirCapacity - 1;
ArrayList<E> result = new ArrayList<>();
List<List<E>> partitions = settings.bulkSplitter.partition(nodes, minEntries, maxEntries);
for(List<E> partition : partitions) {
/... | java | private List<E> createBulkDirectoryNodes(List<E> nodes) {
int minEntries = dirMinimum;
int maxEntries = dirCapacity - 1;
ArrayList<E> result = new ArrayList<>();
List<List<E>> partitions = settings.bulkSplitter.partition(nodes, minEntries, maxEntries);
for(List<E> partition : partitions) {
/... | [
"private",
"List",
"<",
"E",
">",
"createBulkDirectoryNodes",
"(",
"List",
"<",
"E",
">",
"nodes",
")",
"{",
"int",
"minEntries",
"=",
"dirMinimum",
";",
"int",
"maxEntries",
"=",
"dirCapacity",
"-",
"1",
";",
"ArrayList",
"<",
"E",
">",
"result",
"=",
... | Creates and returns the directory nodes for bulk load.
@param nodes the nodes to be inserted
@return the directory nodes containing the nodes | [
"Creates",
"and",
"returns",
"the",
"directory",
"nodes",
"for",
"bulk",
"load",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/NonFlatRStarTree.java#L179-L203 |
64,057 | elki-project/elki | elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/NonFlatRStarTree.java | NonFlatRStarTree.createRoot | private N createRoot(N root, List<E> objects) {
// insert data
for(E entry : objects) {
if (entry instanceof LeafEntry) {
root.addLeafEntry(entry);
}
else {
root.addDirectoryEntry(entry);
}
}
// set root mbr
((SpatialDirectoryEntry) getRootEntry()).setMBR(roo... | java | private N createRoot(N root, List<E> objects) {
// insert data
for(E entry : objects) {
if (entry instanceof LeafEntry) {
root.addLeafEntry(entry);
}
else {
root.addDirectoryEntry(entry);
}
}
// set root mbr
((SpatialDirectoryEntry) getRootEntry()).setMBR(roo... | [
"private",
"N",
"createRoot",
"(",
"N",
"root",
",",
"List",
"<",
"E",
">",
"objects",
")",
"{",
"// insert data",
"for",
"(",
"E",
"entry",
":",
"objects",
")",
"{",
"if",
"(",
"entry",
"instanceof",
"LeafEntry",
")",
"{",
"root",
".",
"addLeafEntry",... | Returns a root node for bulk load. If the objects are data objects a leaf
node will be returned, if the objects are nodes a directory node will be
returned.
@param root the new root node
@param objects the spatial objects to be inserted
@return the root node | [
"Returns",
"a",
"root",
"node",
"for",
"bulk",
"load",
".",
"If",
"the",
"objects",
"are",
"data",
"objects",
"a",
"leaf",
"node",
"will",
"be",
"returned",
"if",
"the",
"objects",
"are",
"nodes",
"a",
"directory",
"node",
"will",
"be",
"returned",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/NonFlatRStarTree.java#L214-L237 |
64,058 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/OutputStreamLogger.java | OutputStreamLogger.tailingNonNewline | private int tailingNonNewline(char[] cbuf, int off, int len) {
for(int cnt = 0; cnt < len; cnt++) {
final int pos = off + (len - 1) - cnt;
if(cbuf[pos] == UNIX_NEWLINE) {
return cnt;
}
if(cbuf[pos] == CARRIAGE_RETURN) {
return cnt;
}
// TODO: need to compare to NE... | java | private int tailingNonNewline(char[] cbuf, int off, int len) {
for(int cnt = 0; cnt < len; cnt++) {
final int pos = off + (len - 1) - cnt;
if(cbuf[pos] == UNIX_NEWLINE) {
return cnt;
}
if(cbuf[pos] == CARRIAGE_RETURN) {
return cnt;
}
// TODO: need to compare to NE... | [
"private",
"int",
"tailingNonNewline",
"(",
"char",
"[",
"]",
"cbuf",
",",
"int",
"off",
",",
"int",
"len",
")",
"{",
"for",
"(",
"int",
"cnt",
"=",
"0",
";",
"cnt",
"<",
"len",
";",
"cnt",
"++",
")",
"{",
"final",
"int",
"pos",
"=",
"off",
"+"... | Count the tailing non-newline characters.
@param cbuf Character buffer
@param off Offset
@param len Range
@return number of tailing non-newline character | [
"Count",
"the",
"tailing",
"non",
"-",
"newline",
"characters",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/OutputStreamLogger.java#L126-L138 |
64,059 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/OutputStreamLogger.java | OutputStreamLogger.write | @Override
public void write(char[] cbuf, int off, int len) throws IOException {
if(len <= 0) {
return;
}
// if we havn't last seen a newline, and don't get a CR, insert a newline.
if(charsSinceNewline > 0) {
if(cbuf[off] != CARRIAGE_RETURN) {
super.write(NEWLINEC, 0, NEWLINEC.lengt... | java | @Override
public void write(char[] cbuf, int off, int len) throws IOException {
if(len <= 0) {
return;
}
// if we havn't last seen a newline, and don't get a CR, insert a newline.
if(charsSinceNewline > 0) {
if(cbuf[off] != CARRIAGE_RETURN) {
super.write(NEWLINEC, 0, NEWLINEC.lengt... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"char",
"[",
"]",
"cbuf",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"len",
"<=",
"0",
")",
"{",
"return",
";",
"}",
"// if we havn't last seen a newline, and don't g... | Writer that keeps track of when it hasn't seen a newline yet, will
auto-insert newlines except when lines start with a carriage return. | [
"Writer",
"that",
"keeps",
"track",
"of",
"when",
"it",
"hasn",
"t",
"seen",
"a",
"newline",
"yet",
"will",
"auto",
"-",
"insert",
"newlines",
"except",
"when",
"lines",
"start",
"with",
"a",
"carriage",
"return",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/OutputStreamLogger.java#L208-L239 |
64,060 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/intrinsic/IDOS.java | IDOS.computeIDs | protected DoubleDataStore computeIDs(DBIDs ids, KNNQuery<O> knnQ) {
WritableDoubleDataStore intDims = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP);
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Intrinsic dimensionality", ids.size(), LOG) : null;
... | java | protected DoubleDataStore computeIDs(DBIDs ids, KNNQuery<O> knnQ) {
WritableDoubleDataStore intDims = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP);
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Intrinsic dimensionality", ids.size(), LOG) : null;
... | [
"protected",
"DoubleDataStore",
"computeIDs",
"(",
"DBIDs",
"ids",
",",
"KNNQuery",
"<",
"O",
">",
"knnQ",
")",
"{",
"WritableDoubleDataStore",
"intDims",
"=",
"DataStoreUtil",
".",
"makeDoubleStorage",
"(",
"ids",
",",
"DataStoreFactory",
".",
"HINT_HOT",
"|",
... | Computes all IDs
@param ids the DBIDs to process
@param knnQ the KNN query
@return The computed intrinsic dimensionalities. | [
"Computes",
"all",
"IDs"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/intrinsic/IDOS.java#L153-L169 |
64,061 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/intrinsic/IDOS.java | IDOS.computeIDOS | protected DoubleDataStore computeIDOS(DBIDs ids, KNNQuery<O> knnQ, DoubleDataStore intDims, DoubleMinMax idosminmax) {
WritableDoubleDataStore ldms = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_STATIC);
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("ID Outlier Scores for objects", id... | java | protected DoubleDataStore computeIDOS(DBIDs ids, KNNQuery<O> knnQ, DoubleDataStore intDims, DoubleMinMax idosminmax) {
WritableDoubleDataStore ldms = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_STATIC);
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("ID Outlier Scores for objects", id... | [
"protected",
"DoubleDataStore",
"computeIDOS",
"(",
"DBIDs",
"ids",
",",
"KNNQuery",
"<",
"O",
">",
"knnQ",
",",
"DoubleDataStore",
"intDims",
",",
"DoubleMinMax",
"idosminmax",
")",
"{",
"WritableDoubleDataStore",
"ldms",
"=",
"DataStoreUtil",
".",
"makeDoubleStora... | Computes all IDOS scores.
@param ids the DBIDs to process
@param knnQ the KNN query
@param intDims Precomputed intrinsic dimensionalities
@param idosminmax Output of minimum and maximum, for metadata
@return ID scores | [
"Computes",
"all",
"IDOS",
"scores",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/intrinsic/IDOS.java#L180-L206 |
64,062 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/AggarwalYuEvolutionary.java | AggarwalYuEvolutionary.run | public OutlierResult run(Database database, Relation<V> relation) {
final int dbsize = relation.size();
ArrayList<ArrayList<DBIDs>> ranges = buildRanges(relation);
Heap<Individuum>.UnorderedIter individuums = (new EvolutionarySearch(relation, ranges, m, rnd.getSingleThreadedRandom())).run();
WritableD... | java | public OutlierResult run(Database database, Relation<V> relation) {
final int dbsize = relation.size();
ArrayList<ArrayList<DBIDs>> ranges = buildRanges(relation);
Heap<Individuum>.UnorderedIter individuums = (new EvolutionarySearch(relation, ranges, m, rnd.getSingleThreadedRandom())).run();
WritableD... | [
"public",
"OutlierResult",
"run",
"(",
"Database",
"database",
",",
"Relation",
"<",
"V",
">",
"relation",
")",
"{",
"final",
"int",
"dbsize",
"=",
"relation",
".",
"size",
"(",
")",
";",
"ArrayList",
"<",
"ArrayList",
"<",
"DBIDs",
">",
">",
"ranges",
... | Performs the evolutionary algorithm on the given database.
@param database Database
@param relation Relation
@return Result | [
"Performs",
"the",
"evolutionary",
"algorithm",
"on",
"the",
"given",
"database",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/AggarwalYuEvolutionary.java#L133-L162 |
64,063 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/GaussianAffinityMatrixBuilder.java | GaussianAffinityMatrixBuilder.buildDistanceMatrix | protected double[][] buildDistanceMatrix(ArrayDBIDs ids, DistanceQuery<?> dq) {
final int size = ids.size();
double[][] dmat = new double[size][size];
final boolean square = !dq.getDistanceFunction().isSquared();
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Computing distance matrix", (si... | java | protected double[][] buildDistanceMatrix(ArrayDBIDs ids, DistanceQuery<?> dq) {
final int size = ids.size();
double[][] dmat = new double[size][size];
final boolean square = !dq.getDistanceFunction().isSquared();
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Computing distance matrix", (si... | [
"protected",
"double",
"[",
"]",
"[",
"]",
"buildDistanceMatrix",
"(",
"ArrayDBIDs",
"ids",
",",
"DistanceQuery",
"<",
"?",
">",
"dq",
")",
"{",
"final",
"int",
"size",
"=",
"ids",
".",
"size",
"(",
")",
";",
"double",
"[",
"]",
"[",
"]",
"dmat",
"... | Build a distance matrix of squared distances.
@param ids DBIDs
@param dq Distance query
@return Distance matrix | [
"Build",
"a",
"distance",
"matrix",
"of",
"squared",
"distances",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/GaussianAffinityMatrixBuilder.java#L116-L139 |
64,064 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/XMeans.java | XMeans.run | @Override
public Clustering<M> run(Database database, Relation<V> relation) {
MutableProgress prog = LOG.isVerbose() ? new MutableProgress("X-means number of clusters", k_max, LOG) : null;
// Run initial k-means to find at least k_min clusters
innerKMeans.setK(k_min);
LOG.statistics(new StringStatist... | java | @Override
public Clustering<M> run(Database database, Relation<V> relation) {
MutableProgress prog = LOG.isVerbose() ? new MutableProgress("X-means number of clusters", k_max, LOG) : null;
// Run initial k-means to find at least k_min clusters
innerKMeans.setK(k_min);
LOG.statistics(new StringStatist... | [
"@",
"Override",
"public",
"Clustering",
"<",
"M",
">",
"run",
"(",
"Database",
"database",
",",
"Relation",
"<",
"V",
">",
"relation",
")",
"{",
"MutableProgress",
"prog",
"=",
"LOG",
".",
"isVerbose",
"(",
")",
"?",
"new",
"MutableProgress",
"(",
"\"X-... | Run the algorithm on a database and relation.
@param database Database to process
@param relation Data relation
@return Clustering result. | [
"Run",
"the",
"algorithm",
"on",
"a",
"database",
"and",
"relation",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/XMeans.java#L160-L209 |
64,065 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/XMeans.java | XMeans.splitCluster | protected List<Cluster<M>> splitCluster(Cluster<M> parentCluster, Database database, Relation<V> relation) {
// Transform parent cluster into a clustering
ArrayList<Cluster<M>> parentClusterList = new ArrayList<Cluster<M>>(1);
parentClusterList.add(parentCluster);
if(parentCluster.size() <= 1) {
/... | java | protected List<Cluster<M>> splitCluster(Cluster<M> parentCluster, Database database, Relation<V> relation) {
// Transform parent cluster into a clustering
ArrayList<Cluster<M>> parentClusterList = new ArrayList<Cluster<M>>(1);
parentClusterList.add(parentCluster);
if(parentCluster.size() <= 1) {
/... | [
"protected",
"List",
"<",
"Cluster",
"<",
"M",
">",
">",
"splitCluster",
"(",
"Cluster",
"<",
"M",
">",
"parentCluster",
",",
"Database",
"database",
",",
"Relation",
"<",
"V",
">",
"relation",
")",
"{",
"// Transform parent cluster into a clustering",
"ArrayLis... | Conditionally splits the clusters based on the information criterion.
@param parentCluster Cluster to split
@param database Database
@param relation Data relation
@return Parent cluster when split decreases clustering quality or child
clusters when split improves clustering. | [
"Conditionally",
"splits",
"the",
"clusters",
"based",
"on",
"the",
"information",
"criterion",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/XMeans.java#L220-L246 |
64,066 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/XMeans.java | XMeans.splitCentroid | protected double[][] splitCentroid(Cluster<? extends MeanModel> parentCluster, Relation<V> relation) {
double[] parentCentroid = parentCluster.getModel().getMean();
// Compute size of cluster/region
double radius = 0.;
for(DBIDIter it = parentCluster.getIDs().iter(); it.valid(); it.advance()) {
d... | java | protected double[][] splitCentroid(Cluster<? extends MeanModel> parentCluster, Relation<V> relation) {
double[] parentCentroid = parentCluster.getModel().getMean();
// Compute size of cluster/region
double radius = 0.;
for(DBIDIter it = parentCluster.getIDs().iter(); it.valid(); it.advance()) {
d... | [
"protected",
"double",
"[",
"]",
"[",
"]",
"splitCentroid",
"(",
"Cluster",
"<",
"?",
"extends",
"MeanModel",
">",
"parentCluster",
",",
"Relation",
"<",
"V",
">",
"relation",
")",
"{",
"double",
"[",
"]",
"parentCentroid",
"=",
"parentCluster",
".",
"getM... | Split an existing centroid into two initial centers.
@param parentCluster Existing cluster
@param relation Data relation
@return List of new centroids | [
"Split",
"an",
"existing",
"centroid",
"into",
"two",
"initial",
"centers",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/XMeans.java#L255-L278 |
64,067 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/HilOut.java | HilOut.scan | private void scan(HilbertFeatures hf, int k0) {
final int mink0 = Math.min(2 * k0, capital_n - 1);
if(LOG.isDebuggingFine()) {
LOG.debugFine("Scanning with k0=" + k0 + " (" + mink0 + ")" + " N*=" + capital_n_star);
}
for(int i = 0; i < hf.pf.length; i++) {
if(hf.pf[i].ubound < omega_star) {
... | java | private void scan(HilbertFeatures hf, int k0) {
final int mink0 = Math.min(2 * k0, capital_n - 1);
if(LOG.isDebuggingFine()) {
LOG.debugFine("Scanning with k0=" + k0 + " (" + mink0 + ")" + " N*=" + capital_n_star);
}
for(int i = 0; i < hf.pf.length; i++) {
if(hf.pf[i].ubound < omega_star) {
... | [
"private",
"void",
"scan",
"(",
"HilbertFeatures",
"hf",
",",
"int",
"k0",
")",
"{",
"final",
"int",
"mink0",
"=",
"Math",
".",
"min",
"(",
"2",
"*",
"k0",
",",
"capital_n",
"-",
"1",
")",
";",
"if",
"(",
"LOG",
".",
"isDebuggingFine",
"(",
")",
... | Scan function performs a squential scan over the data.
@param hf the hilbert features
@param k0 | [
"Scan",
"function",
"performs",
"a",
"squential",
"scan",
"over",
"the",
"data",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/HilOut.java#L284-L320 |
64,068 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/HilOut.java | HilOut.trueOutliers | private void trueOutliers(HilbertFeatures h) {
n_star = 0;
for(ObjectHeap.UnsortedIter<HilFeature> iter = h.out.unsortedIter(); iter.valid(); iter.advance()) {
HilFeature entry = iter.get();
if(entry.ubound >= omega_star && (entry.ubound - entry.lbound < 1E-10)) {
n_star++;
}
}
} | java | private void trueOutliers(HilbertFeatures h) {
n_star = 0;
for(ObjectHeap.UnsortedIter<HilFeature> iter = h.out.unsortedIter(); iter.valid(); iter.advance()) {
HilFeature entry = iter.get();
if(entry.ubound >= omega_star && (entry.ubound - entry.lbound < 1E-10)) {
n_star++;
}
}
} | [
"private",
"void",
"trueOutliers",
"(",
"HilbertFeatures",
"h",
")",
"{",
"n_star",
"=",
"0",
";",
"for",
"(",
"ObjectHeap",
".",
"UnsortedIter",
"<",
"HilFeature",
">",
"iter",
"=",
"h",
".",
"out",
".",
"unsortedIter",
"(",
")",
";",
"iter",
".",
"va... | trueOutliers function updates n_star
@param h the HilberFeatures | [
"trueOutliers",
"function",
"updates",
"n_star"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/HilOut.java#L403-L411 |
64,069 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceScanner.java | ELKIServiceScanner.load | public static void load(Class<?> restrictionClass) {
if(MASTER_CACHE == null) {
initialize();
}
if(MASTER_CACHE.isEmpty()) {
return;
}
Iterator<Class<?>> iter = MASTER_CACHE.iterator();
while(iter.hasNext()) {
Class<?> clazz = iter.next();
// Skip other classes.
if(... | java | public static void load(Class<?> restrictionClass) {
if(MASTER_CACHE == null) {
initialize();
}
if(MASTER_CACHE.isEmpty()) {
return;
}
Iterator<Class<?>> iter = MASTER_CACHE.iterator();
while(iter.hasNext()) {
Class<?> clazz = iter.next();
// Skip other classes.
if(... | [
"public",
"static",
"void",
"load",
"(",
"Class",
"<",
"?",
">",
"restrictionClass",
")",
"{",
"if",
"(",
"MASTER_CACHE",
"==",
"null",
")",
"{",
"initialize",
"(",
")",
";",
"}",
"if",
"(",
"MASTER_CACHE",
".",
"isEmpty",
"(",
")",
")",
"{",
"return... | Load classes via linear scanning.
@param restrictionClass Class to find subclasses for. | [
"Load",
"classes",
"via",
"linear",
"scanning",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceScanner.java#L76-L112 |
64,070 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceScanner.java | ELKIServiceScanner.comparePackageClass | private static int comparePackageClass(Class<?> o1, Class<?> o2) {
return o1.getPackage() == o2.getPackage() ? //
o1.getCanonicalName().compareTo(o2.getCanonicalName()) //
: o1.getPackage() == null ? -1 : o2.getPackage() == null ? +1 //
: o1.getPackage().getName().compareTo(o2.getPackage... | java | private static int comparePackageClass(Class<?> o1, Class<?> o2) {
return o1.getPackage() == o2.getPackage() ? //
o1.getCanonicalName().compareTo(o2.getCanonicalName()) //
: o1.getPackage() == null ? -1 : o2.getPackage() == null ? +1 //
: o1.getPackage().getName().compareTo(o2.getPackage... | [
"private",
"static",
"int",
"comparePackageClass",
"(",
"Class",
"<",
"?",
">",
"o1",
",",
"Class",
"<",
"?",
">",
"o2",
")",
"{",
"return",
"o1",
".",
"getPackage",
"(",
")",
"==",
"o2",
".",
"getPackage",
"(",
")",
"?",
"//",
"o1",
".",
"getCanon... | Compare two classes, by package name first.
@param o1 First class
@param o2 Second class
@return Comparison result | [
"Compare",
"two",
"classes",
"by",
"package",
"name",
"first",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceScanner.java#L274-L279 |
64,071 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceScanner.java | ELKIServiceScanner.classPriority | private static int classPriority(Class<?> o1) {
Priority p = o1.getAnnotation(Priority.class);
if(p == null) {
Class<?> pa = o1.getDeclaringClass();
p = (pa != null) ? pa.getAnnotation(Priority.class) : null;
}
return p != null ? p.value() : Priority.DEFAULT;
} | java | private static int classPriority(Class<?> o1) {
Priority p = o1.getAnnotation(Priority.class);
if(p == null) {
Class<?> pa = o1.getDeclaringClass();
p = (pa != null) ? pa.getAnnotation(Priority.class) : null;
}
return p != null ? p.value() : Priority.DEFAULT;
} | [
"private",
"static",
"int",
"classPriority",
"(",
"Class",
"<",
"?",
">",
"o1",
")",
"{",
"Priority",
"p",
"=",
"o1",
".",
"getAnnotation",
"(",
"Priority",
".",
"class",
")",
";",
"if",
"(",
"p",
"==",
"null",
")",
"{",
"Class",
"<",
"?",
">",
"... | Get the priority of a class, or its outer class.
@param o1 Class
@return Priority | [
"Get",
"the",
"priority",
"of",
"a",
"class",
"or",
"its",
"outer",
"class",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceScanner.java#L287-L294 |
64,072 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/unionfind/WeightedQuickUnionInteger.java | WeightedQuickUnionInteger.nextIndex | public int nextIndex(int weight) {
if(used == parent.length) {
int nsize = used + (used >> 1);
this.weight = Arrays.copyOf(this.weight, nsize);
this.parent = Arrays.copyOf(this.parent, nsize);
}
this.weight[used] = weight;
this.parent[used] = used;
return used++;
} | java | public int nextIndex(int weight) {
if(used == parent.length) {
int nsize = used + (used >> 1);
this.weight = Arrays.copyOf(this.weight, nsize);
this.parent = Arrays.copyOf(this.parent, nsize);
}
this.weight[used] = weight;
this.parent[used] = used;
return used++;
} | [
"public",
"int",
"nextIndex",
"(",
"int",
"weight",
")",
"{",
"if",
"(",
"used",
"==",
"parent",
".",
"length",
")",
"{",
"int",
"nsize",
"=",
"used",
"+",
"(",
"used",
">>",
"1",
")",
";",
"this",
".",
"weight",
"=",
"Arrays",
".",
"copyOf",
"("... | Occupy the next unused index.
@param weight Initial weight.
@return Next unused index. | [
"Occupy",
"the",
"next",
"unused",
"index",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/unionfind/WeightedQuickUnionInteger.java#L84-L93 |
64,073 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/unionfind/WeightedQuickUnionInteger.java | WeightedQuickUnionInteger.find | public int find(int cur) {
assert (cur >= 0 && cur < parent.length);
int p = parent[cur], tmp;
while(cur != p) {
tmp = p;
p = parent[cur] = parent[p]; // Perform simple path compression.
cur = tmp;
}
return cur;
} | java | public int find(int cur) {
assert (cur >= 0 && cur < parent.length);
int p = parent[cur], tmp;
while(cur != p) {
tmp = p;
p = parent[cur] = parent[p]; // Perform simple path compression.
cur = tmp;
}
return cur;
} | [
"public",
"int",
"find",
"(",
"int",
"cur",
")",
"{",
"assert",
"(",
"cur",
">=",
"0",
"&&",
"cur",
"<",
"parent",
".",
"length",
")",
";",
"int",
"p",
"=",
"parent",
"[",
"cur",
"]",
",",
"tmp",
";",
"while",
"(",
"cur",
"!=",
"p",
")",
"{",... | Find the parent of an object.
@param cur Current entry
@return Parent entry | [
"Find",
"the",
"parent",
"of",
"an",
"object",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/unionfind/WeightedQuickUnionInteger.java#L101-L110 |
64,074 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/unionfind/WeightedQuickUnionInteger.java | WeightedQuickUnionInteger.union | public int union(int first, int second) {
int firstComponent = find(first), secondComponent = find(second);
if(firstComponent == secondComponent) {
return firstComponent;
}
final int w1 = weight[firstComponent], w2 = weight[secondComponent];
if(w1 > w2) {
parent[secondComponent] = firstC... | java | public int union(int first, int second) {
int firstComponent = find(first), secondComponent = find(second);
if(firstComponent == secondComponent) {
return firstComponent;
}
final int w1 = weight[firstComponent], w2 = weight[secondComponent];
if(w1 > w2) {
parent[secondComponent] = firstC... | [
"public",
"int",
"union",
"(",
"int",
"first",
",",
"int",
"second",
")",
"{",
"int",
"firstComponent",
"=",
"find",
"(",
"first",
")",
",",
"secondComponent",
"=",
"find",
"(",
"second",
")",
";",
"if",
"(",
"firstComponent",
"==",
"secondComponent",
")... | Join the components of elements p and q.
@param first First element
@param second Second element
@return Component id. | [
"Join",
"the",
"components",
"of",
"elements",
"p",
"and",
"q",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/unionfind/WeightedQuickUnionInteger.java#L119-L135 |
64,075 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/unionfind/WeightedQuickUnionInteger.java | WeightedQuickUnionInteger.getRoots | public IntList getRoots() {
IntList roots = new IntArrayList();
for(int i = 0; i < used; i++) {
// roots or one element in component
if(parent[i] == i) {
roots.add(i);
}
}
return roots;
} | java | public IntList getRoots() {
IntList roots = new IntArrayList();
for(int i = 0; i < used; i++) {
// roots or one element in component
if(parent[i] == i) {
roots.add(i);
}
}
return roots;
} | [
"public",
"IntList",
"getRoots",
"(",
")",
"{",
"IntList",
"roots",
"=",
"new",
"IntArrayList",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"used",
";",
"i",
"++",
")",
"{",
"// roots or one element in component",
"if",
"(",
"parent... | Collect all component root elements.
@return Root elements | [
"Collect",
"all",
"component",
"root",
"elements",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/unionfind/WeightedQuickUnionInteger.java#L153-L162 |
64,076 | elki-project/elki | addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/AbstractXTreeNode.java | AbstractXTreeNode.growSuperNode | public int growSuperNode() {
if(getNumEntries() < getCapacity()) {
throw new IllegalStateException("This node is not yet overflowing (only " + getNumEntries() + " of " + getCapacity() + " entries)");
}
Entry[] old_nodes = super.entries.clone();
assert old_nodes[old_nodes.length - 1] != null;
s... | java | public int growSuperNode() {
if(getNumEntries() < getCapacity()) {
throw new IllegalStateException("This node is not yet overflowing (only " + getNumEntries() + " of " + getCapacity() + " entries)");
}
Entry[] old_nodes = super.entries.clone();
assert old_nodes[old_nodes.length - 1] != null;
s... | [
"public",
"int",
"growSuperNode",
"(",
")",
"{",
"if",
"(",
"getNumEntries",
"(",
")",
"<",
"getCapacity",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"This node is not yet overflowing (only \"",
"+",
"getNumEntries",
"(",
")",
"+",
"\" o... | Grows the supernode by duplicating its capacity.
@return the new page capacity of this node | [
"Grows",
"the",
"supernode",
"by",
"duplicating",
"its",
"capacity",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/AbstractXTreeNode.java#L90-L99 |
64,077 | elki-project/elki | addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/AbstractXTreeNode.java | AbstractXTreeNode.readSuperNode | public <T extends AbstractXTree<N>> void readSuperNode(ObjectInput in, T tree) throws IOException, ClassNotFoundException {
readExternal(in);
if(capacity_to_be_filled <= 0 || !isSuperNode()) {
throw new IllegalStateException("This node does not appear to be a supernode");
}
if(isLeaf) {
thro... | java | public <T extends AbstractXTree<N>> void readSuperNode(ObjectInput in, T tree) throws IOException, ClassNotFoundException {
readExternal(in);
if(capacity_to_be_filled <= 0 || !isSuperNode()) {
throw new IllegalStateException("This node does not appear to be a supernode");
}
if(isLeaf) {
thro... | [
"public",
"<",
"T",
"extends",
"AbstractXTree",
"<",
"N",
">",
">",
"void",
"readSuperNode",
"(",
"ObjectInput",
"in",
",",
"T",
"tree",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"readExternal",
"(",
"in",
")",
";",
"if",
"(",
"capa... | Reads the id of this supernode, the numEntries and the entries array from
the specified stream.
@param in the stream to read data from in order to restore the object
@param tree the tree this supernode is to be assigned to
@throws java.io.IOException if I/O errors occur
@throws ClassNotFoundException If the class for ... | [
"Reads",
"the",
"id",
"of",
"this",
"supernode",
"the",
"numEntries",
"and",
"the",
"entries",
"array",
"from",
"the",
"specified",
"stream",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/AbstractXTreeNode.java#L238-L260 |
64,078 | elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java | DBIDUtil.compare | public static int compare(DBIDRef id1, DBIDRef id2) {
return DBIDFactory.FACTORY.compare(id1, id2);
} | java | public static int compare(DBIDRef id1, DBIDRef id2) {
return DBIDFactory.FACTORY.compare(id1, id2);
} | [
"public",
"static",
"int",
"compare",
"(",
"DBIDRef",
"id1",
",",
"DBIDRef",
"id2",
")",
"{",
"return",
"DBIDFactory",
".",
"FACTORY",
".",
"compare",
"(",
"id1",
",",
"id2",
")",
";",
"}"
] | Compare two DBIDs.
@param id1 First ID
@param id2 Second ID
@return Comparison result | [
"Compare",
"two",
"DBIDs",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L95-L97 |
64,079 | elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java | DBIDUtil.equal | public static boolean equal(DBIDRef id1, DBIDRef id2) {
return DBIDFactory.FACTORY.equal(id1, id2);
} | java | public static boolean equal(DBIDRef id1, DBIDRef id2) {
return DBIDFactory.FACTORY.equal(id1, id2);
} | [
"public",
"static",
"boolean",
"equal",
"(",
"DBIDRef",
"id1",
",",
"DBIDRef",
"id2",
")",
"{",
"return",
"DBIDFactory",
".",
"FACTORY",
".",
"equal",
"(",
"id1",
",",
"id2",
")",
";",
"}"
] | Test two DBIDs for equality.
@param id1 First ID
@param id2 Second ID
@return Comparison result | [
"Test",
"two",
"DBIDs",
"for",
"equality",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L106-L108 |
64,080 | elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java | DBIDUtil.deref | public static DBID deref(DBIDRef ref) {
return ref instanceof DBID ? (DBID) ref : importInteger(ref.internalGetIndex());
} | java | public static DBID deref(DBIDRef ref) {
return ref instanceof DBID ? (DBID) ref : importInteger(ref.internalGetIndex());
} | [
"public",
"static",
"DBID",
"deref",
"(",
"DBIDRef",
"ref",
")",
"{",
"return",
"ref",
"instanceof",
"DBID",
"?",
"(",
"DBID",
")",
"ref",
":",
"importInteger",
"(",
"ref",
".",
"internalGetIndex",
"(",
")",
")",
";",
"}"
] | Dereference a DBID reference.
@param ref DBID reference
@return DBID | [
"Dereference",
"a",
"DBID",
"reference",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L116-L118 |
64,081 | elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java | DBIDUtil.union | public static ModifiableDBIDs union(DBIDs ids1, DBIDs ids2) {
ModifiableDBIDs result = DBIDUtil.newHashSet(Math.max(ids1.size(), ids2.size()));
result.addDBIDs(ids1);
result.addDBIDs(ids2);
return result;
} | java | public static ModifiableDBIDs union(DBIDs ids1, DBIDs ids2) {
ModifiableDBIDs result = DBIDUtil.newHashSet(Math.max(ids1.size(), ids2.size()));
result.addDBIDs(ids1);
result.addDBIDs(ids2);
return result;
} | [
"public",
"static",
"ModifiableDBIDs",
"union",
"(",
"DBIDs",
"ids1",
",",
"DBIDs",
"ids2",
")",
"{",
"ModifiableDBIDs",
"result",
"=",
"DBIDUtil",
".",
"newHashSet",
"(",
"Math",
".",
"max",
"(",
"ids1",
".",
"size",
"(",
")",
",",
"ids2",
".",
"size",
... | Returns the union of the two specified collection of IDs.
@param ids1 the first collection
@param ids2 the second collection
@return the union of ids1 and ids2 without duplicates | [
"Returns",
"the",
"union",
"of",
"the",
"two",
"specified",
"collection",
"of",
"IDs",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L398-L403 |
64,082 | elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java | DBIDUtil.difference | public static ModifiableDBIDs difference(DBIDs ids1, DBIDs ids2) {
ModifiableDBIDs result = DBIDUtil.newHashSet(ids1);
result.removeDBIDs(ids2);
return result;
} | java | public static ModifiableDBIDs difference(DBIDs ids1, DBIDs ids2) {
ModifiableDBIDs result = DBIDUtil.newHashSet(ids1);
result.removeDBIDs(ids2);
return result;
} | [
"public",
"static",
"ModifiableDBIDs",
"difference",
"(",
"DBIDs",
"ids1",
",",
"DBIDs",
"ids2",
")",
"{",
"ModifiableDBIDs",
"result",
"=",
"DBIDUtil",
".",
"newHashSet",
"(",
"ids1",
")",
";",
"result",
".",
"removeDBIDs",
"(",
"ids2",
")",
";",
"return",
... | Returns the difference of the two specified collection of IDs.
@param ids1 the first collection
@param ids2 the second collection
@return the difference of ids1 minus ids2 | [
"Returns",
"the",
"difference",
"of",
"the",
"two",
"specified",
"collection",
"of",
"IDs",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L412-L416 |
64,083 | elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java | DBIDUtil.ensureArray | public static ArrayDBIDs ensureArray(DBIDs ids) {
return ids instanceof ArrayDBIDs ? (ArrayDBIDs) ids : newArray(ids);
} | java | public static ArrayDBIDs ensureArray(DBIDs ids) {
return ids instanceof ArrayDBIDs ? (ArrayDBIDs) ids : newArray(ids);
} | [
"public",
"static",
"ArrayDBIDs",
"ensureArray",
"(",
"DBIDs",
"ids",
")",
"{",
"return",
"ids",
"instanceof",
"ArrayDBIDs",
"?",
"(",
"ArrayDBIDs",
")",
"ids",
":",
"newArray",
"(",
"ids",
")",
";",
"}"
] | Ensure that the given DBIDs are array-indexable.
@param ids IDs
@return Array DBIDs. | [
"Ensure",
"that",
"the",
"given",
"DBIDs",
"are",
"array",
"-",
"indexable",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L434-L436 |
64,084 | elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java | DBIDUtil.ensureSet | public static SetDBIDs ensureSet(DBIDs ids) {
return ids instanceof SetDBIDs ? (SetDBIDs) ids : newHashSet(ids);
} | java | public static SetDBIDs ensureSet(DBIDs ids) {
return ids instanceof SetDBIDs ? (SetDBIDs) ids : newHashSet(ids);
} | [
"public",
"static",
"SetDBIDs",
"ensureSet",
"(",
"DBIDs",
"ids",
")",
"{",
"return",
"ids",
"instanceof",
"SetDBIDs",
"?",
"(",
"SetDBIDs",
")",
"ids",
":",
"newHashSet",
"(",
"ids",
")",
";",
"}"
] | Ensure that the given DBIDs support fast "contains" operations.
@param ids IDs
@return Set DBIDs. | [
"Ensure",
"that",
"the",
"given",
"DBIDs",
"support",
"fast",
"contains",
"operations",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L444-L446 |
64,085 | elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java | DBIDUtil.ensureModifiable | public static ModifiableDBIDs ensureModifiable(DBIDs ids) {
return ids instanceof ModifiableDBIDs ? (ModifiableDBIDs) ids : //
ids instanceof HashSetDBIDs ? newHashSet(ids) : newArray(ids);
} | java | public static ModifiableDBIDs ensureModifiable(DBIDs ids) {
return ids instanceof ModifiableDBIDs ? (ModifiableDBIDs) ids : //
ids instanceof HashSetDBIDs ? newHashSet(ids) : newArray(ids);
} | [
"public",
"static",
"ModifiableDBIDs",
"ensureModifiable",
"(",
"DBIDs",
"ids",
")",
"{",
"return",
"ids",
"instanceof",
"ModifiableDBIDs",
"?",
"(",
"ModifiableDBIDs",
")",
"ids",
":",
"//",
"ids",
"instanceof",
"HashSetDBIDs",
"?",
"newHashSet",
"(",
"ids",
")... | Ensure modifiable.
@param ids IDs
@return Modifiable DBIDs. | [
"Ensure",
"modifiable",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L454-L457 |
64,086 | elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java | DBIDUtil.newPair | public static DBIDPair newPair(DBIDRef id1, DBIDRef id2) {
return DBIDFactory.FACTORY.newPair(id1, id2);
} | java | public static DBIDPair newPair(DBIDRef id1, DBIDRef id2) {
return DBIDFactory.FACTORY.newPair(id1, id2);
} | [
"public",
"static",
"DBIDPair",
"newPair",
"(",
"DBIDRef",
"id1",
",",
"DBIDRef",
"id2",
")",
"{",
"return",
"DBIDFactory",
".",
"FACTORY",
".",
"newPair",
"(",
"id1",
",",
"id2",
")",
";",
"}"
] | Make a DBID pair.
@param id1 first ID
@param id2 second ID
@return DBID pair | [
"Make",
"a",
"DBID",
"pair",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L467-L469 |
64,087 | elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java | DBIDUtil.newPair | public static DoubleDBIDPair newPair(double val, DBIDRef id) {
return DBIDFactory.FACTORY.newPair(val, id);
} | java | public static DoubleDBIDPair newPair(double val, DBIDRef id) {
return DBIDFactory.FACTORY.newPair(val, id);
} | [
"public",
"static",
"DoubleDBIDPair",
"newPair",
"(",
"double",
"val",
",",
"DBIDRef",
"id",
")",
"{",
"return",
"DBIDFactory",
".",
"FACTORY",
".",
"newPair",
"(",
"val",
",",
"id",
")",
";",
"}"
] | Make a DoubleDBIDPair.
@param val double value
@param id ID
@return new pair | [
"Make",
"a",
"DoubleDBIDPair",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L478-L480 |
64,088 | elki-project/elki | elki-core-dbids-int/src/main/java/de/lmu/ifi/dbs/elki/database/ids/integer/IntegerDBIDArrayQuickSort.java | IntegerDBIDArrayQuickSort.sort | public static void sort(int[] data, Comparator<? super DBIDRef> comp) {
sort(data, 0, data.length, comp);
} | java | public static void sort(int[] data, Comparator<? super DBIDRef> comp) {
sort(data, 0, data.length, comp);
} | [
"public",
"static",
"void",
"sort",
"(",
"int",
"[",
"]",
"data",
",",
"Comparator",
"<",
"?",
"super",
"DBIDRef",
">",
"comp",
")",
"{",
"sort",
"(",
"data",
",",
"0",
",",
"data",
".",
"length",
",",
"comp",
")",
";",
"}"
] | Sort the full array using the given comparator.
@param data Data to sort
@param comp Comparator | [
"Sort",
"the",
"full",
"array",
"using",
"the",
"given",
"comparator",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids-int/src/main/java/de/lmu/ifi/dbs/elki/database/ids/integer/IntegerDBIDArrayQuickSort.java#L68-L70 |
64,089 | elki-project/elki | elki-core-dbids-int/src/main/java/de/lmu/ifi/dbs/elki/database/ids/integer/IntegerDBIDArrayQuickSort.java | IntegerDBIDArrayQuickSort.compare | private static int compare(IntegerDBIDVar i1, int p1, IntegerDBIDVar i2, int p2, Comparator<? super DBIDRef> comp) {
i1.internalSetIndex(p1);
i2.internalSetIndex(p2);
return comp.compare(i1, i2);
} | java | private static int compare(IntegerDBIDVar i1, int p1, IntegerDBIDVar i2, int p2, Comparator<? super DBIDRef> comp) {
i1.internalSetIndex(p1);
i2.internalSetIndex(p2);
return comp.compare(i1, i2);
} | [
"private",
"static",
"int",
"compare",
"(",
"IntegerDBIDVar",
"i1",
",",
"int",
"p1",
",",
"IntegerDBIDVar",
"i2",
",",
"int",
"p2",
",",
"Comparator",
"<",
"?",
"super",
"DBIDRef",
">",
"comp",
")",
"{",
"i1",
".",
"internalSetIndex",
"(",
"p1",
")",
... | Compare two elements.
@param i1 First scratch variable
@param p1 Value for first
@param i2 Second scratch variable
@param p2 Value for second
@param comp Comparator
@return Comparison result | [
"Compare",
"two",
"elements",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids-int/src/main/java/de/lmu/ifi/dbs/elki/database/ids/integer/IntegerDBIDArrayQuickSort.java#L256-L260 |
64,090 | elki-project/elki | addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/AbstractXTree.java | AbstractXTree.computeHeight | @Override
protected int computeHeight() {
N node = getRoot();
int tHeight = 1;
// compute height
while(!node.isLeaf() && node.getNumEntries() != 0) {
SpatialEntry entry = node.getEntry(0);
node = getNode(entry);
tHeight++;
}
return tHeight;
} | java | @Override
protected int computeHeight() {
N node = getRoot();
int tHeight = 1;
// compute height
while(!node.isLeaf() && node.getNumEntries() != 0) {
SpatialEntry entry = node.getEntry(0);
node = getNode(entry);
tHeight++;
}
return tHeight;
} | [
"@",
"Override",
"protected",
"int",
"computeHeight",
"(",
")",
"{",
"N",
"node",
"=",
"getRoot",
"(",
")",
";",
"int",
"tHeight",
"=",
"1",
";",
"// compute height",
"while",
"(",
"!",
"node",
".",
"isLeaf",
"(",
")",
"&&",
"node",
".",
"getNumEntries... | Computes the height of this XTree. Is called by the constructor. and should
be overwritten by subclasses if necessary.
@return the height of this XTree | [
"Computes",
"the",
"height",
"of",
"this",
"XTree",
".",
"Is",
"called",
"by",
"the",
"constructor",
".",
"and",
"should",
"be",
"overwritten",
"by",
"subclasses",
"if",
"necessary",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/AbstractXTree.java#L170-L182 |
64,091 | elki-project/elki | addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/AbstractXTree.java | AbstractXTree.commit | public long commit() throws IOException {
final PageFile<N> file = super.getFile();
if(!(file instanceof PersistentPageFile)) {
throw new IllegalStateException("Trying to commit a non-persistent XTree");
}
long npid = file.getNextPageID();
XTreeHeader ph = (XTreeHeader) ((PersistentPageFile<?>... | java | public long commit() throws IOException {
final PageFile<N> file = super.getFile();
if(!(file instanceof PersistentPageFile)) {
throw new IllegalStateException("Trying to commit a non-persistent XTree");
}
long npid = file.getNextPageID();
XTreeHeader ph = (XTreeHeader) ((PersistentPageFile<?>... | [
"public",
"long",
"commit",
"(",
")",
"throws",
"IOException",
"{",
"final",
"PageFile",
"<",
"N",
">",
"file",
"=",
"super",
".",
"getFile",
"(",
")",
";",
"if",
"(",
"!",
"(",
"file",
"instanceof",
"PersistentPageFile",
")",
")",
"{",
"throw",
"new",... | Writes all supernodes to the end of the file. This is only supposed to be
used for a final saving of an XTree. If another page is added to this tree,
the supernodes written to file by this operation are over-written.
@return the number of bytes written to file for this tree's supernodes
@throws IOException if there ar... | [
"Writes",
"all",
"supernodes",
"to",
"the",
"end",
"of",
"the",
"file",
".",
"This",
"is",
"only",
"supposed",
"to",
"be",
"used",
"for",
"a",
"final",
"saving",
"of",
"an",
"XTree",
".",
"If",
"another",
"page",
"is",
"added",
"to",
"this",
"tree",
... | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/AbstractXTree.java#L298-L330 |
64,092 | elki-project/elki | elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/deliclu/DeLiCluTree.java | DeLiCluTree.setExpanded | public void setExpanded(SpatialEntry entry1, SpatialEntry entry2) {
IntSet exp1 = expanded.get(getPageID(entry1));
if(exp1 == null) {
exp1 = new IntOpenHashSet();
expanded.put(getPageID(entry1), exp1);
}
exp1.add(getPageID(entry2));
} | java | public void setExpanded(SpatialEntry entry1, SpatialEntry entry2) {
IntSet exp1 = expanded.get(getPageID(entry1));
if(exp1 == null) {
exp1 = new IntOpenHashSet();
expanded.put(getPageID(entry1), exp1);
}
exp1.add(getPageID(entry2));
} | [
"public",
"void",
"setExpanded",
"(",
"SpatialEntry",
"entry1",
",",
"SpatialEntry",
"entry2",
")",
"{",
"IntSet",
"exp1",
"=",
"expanded",
".",
"get",
"(",
"getPageID",
"(",
"entry1",
")",
")",
";",
"if",
"(",
"exp1",
"==",
"null",
")",
"{",
"exp1",
"... | Marks the nodes with the specified ids as expanded.
@param entry1 the first node
@param entry2 the second node | [
"Marks",
"the",
"nodes",
"with",
"the",
"specified",
"ids",
"as",
"expanded",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/deliclu/DeLiCluTree.java#L72-L79 |
64,093 | elki-project/elki | elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/deliclu/DeLiCluTree.java | DeLiCluTree.getExpanded | public IntSet getExpanded(SpatialEntry entry) {
IntSet exp = expanded.get(getPageID(entry));
return (exp != null) ? exp : IntSets.EMPTY_SET;
} | java | public IntSet getExpanded(SpatialEntry entry) {
IntSet exp = expanded.get(getPageID(entry));
return (exp != null) ? exp : IntSets.EMPTY_SET;
} | [
"public",
"IntSet",
"getExpanded",
"(",
"SpatialEntry",
"entry",
")",
"{",
"IntSet",
"exp",
"=",
"expanded",
".",
"get",
"(",
"getPageID",
"(",
"entry",
")",
")",
";",
"return",
"(",
"exp",
"!=",
"null",
")",
"?",
"exp",
":",
"IntSets",
".",
"EMPTY_SET... | Returns the nodes which are already expanded with the specified node.
@param entry the id of the node for which the expansions should be returned
@return the nodes which are already expanded with the specified node | [
"Returns",
"the",
"nodes",
"which",
"are",
"already",
"expanded",
"with",
"the",
"specified",
"node",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/deliclu/DeLiCluTree.java#L87-L90 |
64,094 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/histogram/DoubleHistogram.java | DoubleHistogram.increment | public void increment(double coord, double val) {
int bin = getBinNr(coord);
if (bin < 0) {
if (size - bin > data.length) {
// Reallocate. TODO: use an arraylist-like grow strategy!
double[] tmpdata = new double[growSize(data.length, size - bin)];
System.arraycopy(data, 0, tmpdata,... | java | public void increment(double coord, double val) {
int bin = getBinNr(coord);
if (bin < 0) {
if (size - bin > data.length) {
// Reallocate. TODO: use an arraylist-like grow strategy!
double[] tmpdata = new double[growSize(data.length, size - bin)];
System.arraycopy(data, 0, tmpdata,... | [
"public",
"void",
"increment",
"(",
"double",
"coord",
",",
"double",
"val",
")",
"{",
"int",
"bin",
"=",
"getBinNr",
"(",
"coord",
")",
";",
"if",
"(",
"bin",
"<",
"0",
")",
"{",
"if",
"(",
"size",
"-",
"bin",
">",
"data",
".",
"length",
")",
... | Increment the value of a bin.
@param coord Coordinate
@param val Value | [
"Increment",
"the",
"value",
"of",
"a",
"bin",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/histogram/DoubleHistogram.java#L58-L93 |
64,095 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/histogram/DoubleHistogram.java | DoubleHistogram.get | public double get(double coord) {
int bin = getBinNr(coord);
return (bin < 0 || bin >= size) ? 0 : data[bin];
} | java | public double get(double coord) {
int bin = getBinNr(coord);
return (bin < 0 || bin >= size) ? 0 : data[bin];
} | [
"public",
"double",
"get",
"(",
"double",
"coord",
")",
"{",
"int",
"bin",
"=",
"getBinNr",
"(",
"coord",
")",
";",
"return",
"(",
"bin",
"<",
"0",
"||",
"bin",
">=",
"size",
")",
"?",
"0",
":",
"data",
"[",
"bin",
"]",
";",
"}"
] | Get the value at a particular position.
@param coord Coordinate
@return Value | [
"Get",
"the",
"value",
"at",
"a",
"particular",
"position",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/histogram/DoubleHistogram.java#L101-L104 |
64,096 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/util/MultiBorder.java | MultiBorder.update | public Assignment update(Border border) {
Arrays.sort(cs);
int j = 1;
boolean found = (cs[0].core == border.core);
for(int i = 1; i < cs.length; i++) {
if(cs[i].core != cs[i - 1].core) {
cs[j++] = cs[i];
}
found |= (cs[i].core == border.core);
}
if(found) {
if(j =... | java | public Assignment update(Border border) {
Arrays.sort(cs);
int j = 1;
boolean found = (cs[0].core == border.core);
for(int i = 1; i < cs.length; i++) {
if(cs[i].core != cs[i - 1].core) {
cs[j++] = cs[i];
}
found |= (cs[i].core == border.core);
}
if(found) {
if(j =... | [
"public",
"Assignment",
"update",
"(",
"Border",
"border",
")",
"{",
"Arrays",
".",
"sort",
"(",
"cs",
")",
";",
"int",
"j",
"=",
"1",
";",
"boolean",
"found",
"=",
"(",
"cs",
"[",
"0",
"]",
".",
"core",
"==",
"border",
".",
"core",
")",
";",
"... | Add a new border to the existing borders.
@param border New border. | [
"Add",
"a",
"new",
"border",
"to",
"the",
"existing",
"borders",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/util/MultiBorder.java#L53-L79 |
64,097 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/util/MultiBorder.java | MultiBorder.getCore | public Core getCore() {
Core a = cs[0].core;
for(int i = 1; i < cs.length; i++) {
Core v = cs[i].core;
a = a.num > v.num ? a : v; // max, of negative values
}
return a;
} | java | public Core getCore() {
Core a = cs[0].core;
for(int i = 1; i < cs.length; i++) {
Core v = cs[i].core;
a = a.num > v.num ? a : v; // max, of negative values
}
return a;
} | [
"public",
"Core",
"getCore",
"(",
")",
"{",
"Core",
"a",
"=",
"cs",
"[",
"0",
"]",
".",
"core",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"cs",
".",
"length",
";",
"i",
"++",
")",
"{",
"Core",
"v",
"=",
"cs",
"[",
"i",
"]",
... | Get the core this is assigned to.
@return Core | [
"Get",
"the",
"core",
"this",
"is",
"assigned",
"to",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/util/MultiBorder.java#L86-L93 |
64,098 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/KMedoidsPark.java | KMedoidsPark.currentCluster | protected int currentCluster(List<? extends ModifiableDBIDs> clusters, DBIDRef id) {
for(int i = 0; i < k; i++) {
if(clusters.get(i).contains(id)) {
return i;
}
}
return -1;
} | java | protected int currentCluster(List<? extends ModifiableDBIDs> clusters, DBIDRef id) {
for(int i = 0; i < k; i++) {
if(clusters.get(i).contains(id)) {
return i;
}
}
return -1;
} | [
"protected",
"int",
"currentCluster",
"(",
"List",
"<",
"?",
"extends",
"ModifiableDBIDs",
">",
"clusters",
",",
"DBIDRef",
"id",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"k",
";",
"i",
"++",
")",
"{",
"if",
"(",
"clusters",
".",
... | Find the current cluster assignment.
@param clusters Clusters
@param id Current object
@return Current cluster assignment. | [
"Find",
"the",
"current",
"cluster",
"assignment",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/KMedoidsPark.java#L286-L293 |
64,099 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/INFLO.java | INFLO.computeINFLO | protected void computeINFLO(Relation<O> relation, ModifiableDBIDs pruned, KNNQuery<O> knnq, WritableDataStore<ModifiableDBIDs> rNNminuskNNs, WritableDoubleDataStore inflos, DoubleMinMax inflominmax) {
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Computing INFLOs", relation.size(), LOG) : null;
Ha... | java | protected void computeINFLO(Relation<O> relation, ModifiableDBIDs pruned, KNNQuery<O> knnq, WritableDataStore<ModifiableDBIDs> rNNminuskNNs, WritableDoubleDataStore inflos, DoubleMinMax inflominmax) {
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Computing INFLOs", relation.size(), LOG) : null;
Ha... | [
"protected",
"void",
"computeINFLO",
"(",
"Relation",
"<",
"O",
">",
"relation",
",",
"ModifiableDBIDs",
"pruned",
",",
"KNNQuery",
"<",
"O",
">",
"knnq",
",",
"WritableDataStore",
"<",
"ModifiableDBIDs",
">",
"rNNminuskNNs",
",",
"WritableDoubleDataStore",
"inflo... | Compute the final INFLO scores.
@param relation Data relation
@param pruned Pruned objects
@param knnq kNN query
@param rNNminuskNNs reverse kNN storage
@param inflos INFLO score storage
@param inflominmax Output of minimum and maximum | [
"Compute",
"the",
"final",
"INFLO",
"scores",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/INFLO.java#L225-L268 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.