id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
63,200
elki-project/elki
elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/HierarchicalClassLabel.java
HierarchicalClassLabel.getNameAt
public String getNameAt(int level) { return this.levelwiseNames[level] instanceof Integer ? this.levelwiseNames[level].toString() : (String) this.levelwiseNames[level]; }
java
public String getNameAt(int level) { return this.levelwiseNames[level] instanceof Integer ? this.levelwiseNames[level].toString() : (String) this.levelwiseNames[level]; }
[ "public", "String", "getNameAt", "(", "int", "level", ")", "{", "return", "this", ".", "levelwiseNames", "[", "level", "]", "instanceof", "Integer", "?", "this", ".", "levelwiseNames", "[", "level", "]", ".", "toString", "(", ")", ":", "(", "String", ")"...
Returns the name at the given level as a String. @param level the level to return the name at @return the name at the given level as a String
[ "Returns", "the", "name", "at", "the", "given", "level", "as", "a", "String", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/HierarchicalClassLabel.java#L153-L155
63,201
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/result/LogResultStructureResultHandler.java
LogResultStructureResultHandler.recursiveLogResult
private void recursiveLogResult(StringBuilder buf, Hierarchy<Result> hier, Result result, int depth) { if(result == null) { buf.append("null"); LOG.warning("null result!"); return; } if(depth > 50) { LOG.warning("Probably infinitely nested results, aborting!"); return; } ...
java
private void recursiveLogResult(StringBuilder buf, Hierarchy<Result> hier, Result result, int depth) { if(result == null) { buf.append("null"); LOG.warning("null result!"); return; } if(depth > 50) { LOG.warning("Probably infinitely nested results, aborting!"); return; } ...
[ "private", "void", "recursiveLogResult", "(", "StringBuilder", "buf", ",", "Hierarchy", "<", "Result", ">", "hier", ",", "Result", "result", ",", "int", "depth", ")", "{", "if", "(", "result", "==", "null", ")", "{", "buf", ".", "append", "(", "\"null\""...
Recursively walk through the result tree. @param buf Output buffer @param result Current result @param depth Depth
[ "Recursively", "walk", "through", "the", "result", "tree", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/result/LogResultStructureResultHandler.java#L67-L87
63,202
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameterization/ListParameterization.java
ListParameterization.addFlag
public ListParameterization addFlag(OptionID optionid) { parameters.add(new ParameterPair(optionid, Flag.SET)); return this; }
java
public ListParameterization addFlag(OptionID optionid) { parameters.add(new ParameterPair(optionid, Flag.SET)); return this; }
[ "public", "ListParameterization", "addFlag", "(", "OptionID", "optionid", ")", "{", "parameters", ".", "add", "(", "new", "ParameterPair", "(", "optionid", ",", "Flag", ".", "SET", ")", ")", ";", "return", "this", ";", "}" ]
Add a flag to the parameter list @param optionid Option ID @return this, for chaining
[ "Add", "a", "flag", "to", "the", "parameter", "list" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameterization/ListParameterization.java#L77-L80
63,203
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameterization/ListParameterization.java
ListParameterization.serialize
public ArrayList<String> serialize() { ArrayList<String> params = new ArrayList<>(); for(ParameterPair pair : parameters) { params.add(SerializedParameterization.OPTION_PREFIX + pair.option.toString()); if(pair.value instanceof String) { params.add((String) pair.value); } else if...
java
public ArrayList<String> serialize() { ArrayList<String> params = new ArrayList<>(); for(ParameterPair pair : parameters) { params.add(SerializedParameterization.OPTION_PREFIX + pair.option.toString()); if(pair.value instanceof String) { params.add((String) pair.value); } else if...
[ "public", "ArrayList", "<", "String", ">", "serialize", "(", ")", "{", "ArrayList", "<", "String", ">", "params", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "ParameterPair", "pair", ":", "parameters", ")", "{", "params", ".", "add", "(",...
Serialize parameters. @return Array list of parameters
[ "Serialize", "parameters", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameterization/ListParameterization.java#L177-L192
63,204
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/anglebased/FastABOD.java
FastABOD.run
@Override public OutlierResult run(Database db, Relation<V> relation) { DBIDs ids = relation.getDBIDs(); WritableDoubleDataStore abodvalues = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_STATIC); DoubleMinMax minmaxabod = new DoubleMinMax(); if(kernelFunction.getClass() == LinearKernelFu...
java
@Override public OutlierResult run(Database db, Relation<V> relation) { DBIDs ids = relation.getDBIDs(); WritableDoubleDataStore abodvalues = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_STATIC); DoubleMinMax minmaxabod = new DoubleMinMax(); if(kernelFunction.getClass() == LinearKernelFu...
[ "@", "Override", "public", "OutlierResult", "run", "(", "Database", "db", ",", "Relation", "<", "V", ">", "relation", ")", "{", "DBIDs", "ids", "=", "relation", ".", "getDBIDs", "(", ")", ";", "WritableDoubleDataStore", "abodvalues", "=", "DataStoreUtil", "....
Run Fast-ABOD on the data set. @param relation Relation to process @return Outlier detection result
[ "Run", "Fast", "-", "ABOD", "on", "the", "data", "set", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/anglebased/FastABOD.java#L115-L134
63,205
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/anglebased/FastABOD.java
FastABOD.kNNABOD
private boolean kNNABOD(Database db, Relation<V> relation, DBIDs ids, WritableDoubleDataStore abodvalues, DoubleMinMax minmaxabod) { DistanceQuery<V> dq = db.getDistanceQuery(relation, SquaredEuclideanDistanceFunction.STATIC); KNNQuery<V> knnq = db.getKNNQuery(dq, DatabaseQuery.HINT_OPTIMIZED_ONLY); boolean...
java
private boolean kNNABOD(Database db, Relation<V> relation, DBIDs ids, WritableDoubleDataStore abodvalues, DoubleMinMax minmaxabod) { DistanceQuery<V> dq = db.getDistanceQuery(relation, SquaredEuclideanDistanceFunction.STATIC); KNNQuery<V> knnq = db.getKNNQuery(dq, DatabaseQuery.HINT_OPTIMIZED_ONLY); boolean...
[ "private", "boolean", "kNNABOD", "(", "Database", "db", ",", "Relation", "<", "V", ">", "relation", ",", "DBIDs", "ids", ",", "WritableDoubleDataStore", "abodvalues", ",", "DoubleMinMax", "minmaxabod", ")", "{", "DistanceQuery", "<", "V", ">", "dq", "=", "db...
Simpler kNN based, can use more indexing. @param db Database @param relation Data relation @param ids IDs @param abodvalues Score storage @param minmaxabod Min/max storage @return {@code true} if kNN were available and usable.
[ "Simpler", "kNN", "based", "can", "use", "more", "indexing", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/anglebased/FastABOD.java#L146-L200
63,206
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/anglebased/FastABOD.java
FastABOD.fastABOD
private void fastABOD(Database db, Relation<V> relation, DBIDs ids, WritableDoubleDataStore abodvalues, DoubleMinMax minmaxabod) { // Build a kernel matrix, to make O(n^3) slightly less bad. SimilarityQuery<V> sq = db.getSimilarityQuery(relation, kernelFunction); KernelMatrix kernelMatrix = new KernelMatrix...
java
private void fastABOD(Database db, Relation<V> relation, DBIDs ids, WritableDoubleDataStore abodvalues, DoubleMinMax minmaxabod) { // Build a kernel matrix, to make O(n^3) slightly less bad. SimilarityQuery<V> sq = db.getSimilarityQuery(relation, kernelFunction); KernelMatrix kernelMatrix = new KernelMatrix...
[ "private", "void", "fastABOD", "(", "Database", "db", ",", "Relation", "<", "V", ">", "relation", ",", "DBIDs", "ids", ",", "WritableDoubleDataStore", "abodvalues", ",", "DoubleMinMax", "minmaxabod", ")", "{", "// Build a kernel matrix, to make O(n^3) slightly less bad....
Full kernel-based version. @param db Database @param relation Data relation @param ids IDs @param abodvalues Score storage @param minmaxabod Min/max storage
[ "Full", "kernel", "-", "based", "version", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/anglebased/FastABOD.java#L211-L264
63,207
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/weightfunctions/ErfcStddevWeight.java
ErfcStddevWeight.getWeight
@Override public double getWeight(double distance, double max, double stddev) { if(stddev <= 0) { return 1; } return NormalDistribution.erfc(MathUtil.SQRTHALF * distance / stddev); }
java
@Override public double getWeight(double distance, double max, double stddev) { if(stddev <= 0) { return 1; } return NormalDistribution.erfc(MathUtil.SQRTHALF * distance / stddev); }
[ "@", "Override", "public", "double", "getWeight", "(", "double", "distance", ",", "double", "max", ",", "double", "stddev", ")", "{", "if", "(", "stddev", "<=", "0", ")", "{", "return", "1", ";", "}", "return", "NormalDistribution", ".", "erfc", "(", "...
Return Erfc weight, scaled by standard deviation. max is ignored.
[ "Return", "Erfc", "weight", "scaled", "by", "standard", "deviation", ".", "max", "is", "ignored", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/weightfunctions/ErfcStddevWeight.java#L39-L45
63,208
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/LOF.java
LOF.run
public OutlierResult run(Database database, Relation<O> relation) { StepProgress stepprog = LOG.isVerbose() ? new StepProgress("LOF", 3) : null; DBIDs ids = relation.getDBIDs(); LOG.beginStep(stepprog, 1, "Materializing nearest-neighbor sets."); KNNQuery<O> knnq = DatabaseUtil.precomputedKNNQuery(datab...
java
public OutlierResult run(Database database, Relation<O> relation) { StepProgress stepprog = LOG.isVerbose() ? new StepProgress("LOF", 3) : null; DBIDs ids = relation.getDBIDs(); LOG.beginStep(stepprog, 1, "Materializing nearest-neighbor sets."); KNNQuery<O> knnq = DatabaseUtil.precomputedKNNQuery(datab...
[ "public", "OutlierResult", "run", "(", "Database", "database", ",", "Relation", "<", "O", ">", "relation", ")", "{", "StepProgress", "stepprog", "=", "LOG", ".", "isVerbose", "(", ")", "?", "new", "StepProgress", "(", "\"LOF\"", ",", "3", ")", ":", "null...
Runs the LOF algorithm on the given database. @param database Database to query @param relation Data to process @return LOF outlier result
[ "Runs", "the", "LOF", "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/lof/LOF.java#L125-L150
63,209
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/LOF.java
LOF.computeLRDs
private void computeLRDs(KNNQuery<O> knnq, DBIDs ids, WritableDoubleDataStore lrds) { FiniteProgress lrdsProgress = LOG.isVerbose() ? new FiniteProgress("Local Reachability Densities (LRD)", ids.size(), LOG) : null; double lrd; for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { lrd = comp...
java
private void computeLRDs(KNNQuery<O> knnq, DBIDs ids, WritableDoubleDataStore lrds) { FiniteProgress lrdsProgress = LOG.isVerbose() ? new FiniteProgress("Local Reachability Densities (LRD)", ids.size(), LOG) : null; double lrd; for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { lrd = comp...
[ "private", "void", "computeLRDs", "(", "KNNQuery", "<", "O", ">", "knnq", ",", "DBIDs", "ids", ",", "WritableDoubleDataStore", "lrds", ")", "{", "FiniteProgress", "lrdsProgress", "=", "LOG", ".", "isVerbose", "(", ")", "?", "new", "FiniteProgress", "(", "\"L...
Compute local reachability distances. @param knnq KNN query @param ids IDs to process @param lrds Reachability storage
[ "Compute", "local", "reachability", "distances", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/LOF.java#L159-L168
63,210
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/LOF.java
LOF.computeLRD
protected double computeLRD(KNNQuery<O> knnq, DBIDIter curr) { final KNNList neighbors = knnq.getKNNForDBID(curr, k); double sum = 0.0; int count = 0; for(DoubleDBIDListIter neighbor = neighbors.iter(); neighbor.valid(); neighbor.advance()) { if(DBIDUtil.equal(curr, neighbor)) { continue; ...
java
protected double computeLRD(KNNQuery<O> knnq, DBIDIter curr) { final KNNList neighbors = knnq.getKNNForDBID(curr, k); double sum = 0.0; int count = 0; for(DoubleDBIDListIter neighbor = neighbors.iter(); neighbor.valid(); neighbor.advance()) { if(DBIDUtil.equal(curr, neighbor)) { continue; ...
[ "protected", "double", "computeLRD", "(", "KNNQuery", "<", "O", ">", "knnq", ",", "DBIDIter", "curr", ")", "{", "final", "KNNList", "neighbors", "=", "knnq", ".", "getKNNForDBID", "(", "curr", ",", "k", ")", ";", "double", "sum", "=", "0.0", ";", "int"...
Compute a single local reachability distance. @param knnq kNN Query @param curr Current object @return Local Reachability Density
[ "Compute", "a", "single", "local", "reachability", "distance", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/LOF.java#L177-L191
63,211
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/LOF.java
LOF.computeLOFScores
private void computeLOFScores(KNNQuery<O> knnq, DBIDs ids, DoubleDataStore lrds, WritableDoubleDataStore lofs, DoubleMinMax lofminmax) { FiniteProgress progressLOFs = LOG.isVerbose() ? new FiniteProgress("Local Outlier Factor (LOF) scores", ids.size(), LOG) : null; double lof; for(DBIDIter iter = ids.iter()...
java
private void computeLOFScores(KNNQuery<O> knnq, DBIDs ids, DoubleDataStore lrds, WritableDoubleDataStore lofs, DoubleMinMax lofminmax) { FiniteProgress progressLOFs = LOG.isVerbose() ? new FiniteProgress("Local Outlier Factor (LOF) scores", ids.size(), LOG) : null; double lof; for(DBIDIter iter = ids.iter()...
[ "private", "void", "computeLOFScores", "(", "KNNQuery", "<", "O", ">", "knnq", ",", "DBIDs", "ids", ",", "DoubleDataStore", "lrds", ",", "WritableDoubleDataStore", "lofs", ",", "DoubleMinMax", "lofminmax", ")", "{", "FiniteProgress", "progressLOFs", "=", "LOG", ...
Compute local outlier factors. @param knnq KNN query @param ids IDs to process @param lrds Local reachability distances @param lofs Local outlier factor storage @param lofminmax Score minimum/maximum tracker
[ "Compute", "local", "outlier", "factors", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/LOF.java#L202-L213
63,212
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/LOF.java
LOF.computeLOFScore
protected double computeLOFScore(KNNQuery<O> knnq, DBIDRef cur, DoubleDataStore lrds) { final double lrdp = lrds.doubleValue(cur); if(Double.isInfinite(lrdp)) { return 1.0; } double sum = 0.; int count = 0; final KNNList neighbors = knnq.getKNNForDBID(cur, k); for(DBIDIter neighbor = n...
java
protected double computeLOFScore(KNNQuery<O> knnq, DBIDRef cur, DoubleDataStore lrds) { final double lrdp = lrds.doubleValue(cur); if(Double.isInfinite(lrdp)) { return 1.0; } double sum = 0.; int count = 0; final KNNList neighbors = knnq.getKNNForDBID(cur, k); for(DBIDIter neighbor = n...
[ "protected", "double", "computeLOFScore", "(", "KNNQuery", "<", "O", ">", "knnq", ",", "DBIDRef", "cur", ",", "DoubleDataStore", "lrds", ")", "{", "final", "double", "lrdp", "=", "lrds", ".", "doubleValue", "(", "cur", ")", ";", "if", "(", "Double", ".",...
Compute a single LOF score. @param knnq kNN query @param cur Current object @param lrds Stored reachability densities @return LOF score.
[ "Compute", "a", "single", "LOF", "score", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/LOF.java#L223-L240
63,213
elki-project/elki
elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/rdknn/RdKNNNode.java
RdKNNNode.kNNDistance
protected double kNNDistance() { double result = getEntry(0).getKnnDistance(); for(int i = 1; i < getNumEntries(); i++) { double knnDistance = getEntry(i).getKnnDistance(); result = (result < knnDistance) ? knnDistance : result; } return result; }
java
protected double kNNDistance() { double result = getEntry(0).getKnnDistance(); for(int i = 1; i < getNumEntries(); i++) { double knnDistance = getEntry(i).getKnnDistance(); result = (result < knnDistance) ? knnDistance : result; } return result; }
[ "protected", "double", "kNNDistance", "(", ")", "{", "double", "result", "=", "getEntry", "(", "0", ")", ".", "getKnnDistance", "(", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "getNumEntries", "(", ")", ";", "i", "++", ")", "{", "...
Computes and returns the aggregated knn distance of this node @return the aggregated knn distance of this node
[ "Computes", "and", "returns", "the", "aggregated", "knn", "distance", "of", "this", "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/rdknn/RdKNNNode.java#L59-L66
63,214
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/LineReader.java
LineReader.readLine
public boolean readLine(Appendable buf) throws IOException { boolean success = false; while(true) { // Process buffer: while(pos < end) { success = true; final char c = buffer[pos++]; if(c == '\n') { return success; } if(c == '\r') { contin...
java
public boolean readLine(Appendable buf) throws IOException { boolean success = false; while(true) { // Process buffer: while(pos < end) { success = true; final char c = buffer[pos++]; if(c == '\n') { return success; } if(c == '\r') { contin...
[ "public", "boolean", "readLine", "(", "Appendable", "buf", ")", "throws", "IOException", "{", "boolean", "success", "=", "false", ";", "while", "(", "true", ")", "{", "// Process buffer:", "while", "(", "pos", "<", "end", ")", "{", "success", "=", "true", ...
Read a line into the given buffer. @param buf Buffer. @return {@code true} if some characters have been read.
[ "Read", "a", "line", "into", "the", "given", "buffer", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/LineReader.java#L118-L141
63,215
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/QuickSelect.java
QuickSelect.bestPivot
private static final int bestPivot(int rank, int m1, int m2, int m3, int m4, int m5) { if(rank < m1) { return m1; } if(rank > m5) { return m5; } if(rank < m2) { return m2; } if(rank > m4) { return m4; } return m3; }
java
private static final int bestPivot(int rank, int m1, int m2, int m3, int m4, int m5) { if(rank < m1) { return m1; } if(rank > m5) { return m5; } if(rank < m2) { return m2; } if(rank > m4) { return m4; } return m3; }
[ "private", "static", "final", "int", "bestPivot", "(", "int", "rank", ",", "int", "m1", ",", "int", "m2", ",", "int", "m3", ",", "int", "m4", ",", "int", "m5", ")", "{", "if", "(", "rank", "<", "m1", ")", "{", "return", "m1", ";", "}", "if", ...
Choose the best pivot for the given rank. @param rank Rank @param m1 Pivot candidate @param m2 Pivot candidate @param m3 Pivot candidate @param m4 Pivot candidate @param m5 Pivot candidate @return Best pivot candidate
[ "Choose", "the", "best", "pivot", "for", "the", "given", "rank", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/QuickSelect.java#L69-L83
63,216
elki-project/elki
elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mktab/MkTabLeafEntry.java
MkTabLeafEntry.writeExternal
@Override public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal(out); int k_max = knnDistances.length; out.writeInt(k_max); for(int i = 0; i < k_max; i++) { out.writeDouble(knnDistances[i]); } }
java
@Override public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal(out); int k_max = knnDistances.length; out.writeInt(k_max); for(int i = 0; i < k_max; i++) { out.writeDouble(knnDistances[i]); } }
[ "@", "Override", "public", "void", "writeExternal", "(", "ObjectOutput", "out", ")", "throws", "IOException", "{", "super", ".", "writeExternal", "(", "out", ")", ";", "int", "k_max", "=", "knnDistances", ".", "length", ";", "out", ".", "writeInt", "(", "k...
Calls the super method and writes the parameter k_max and the knn distances of this entry to the specified stream. @param out the stream to write the object to @throws java.io.IOException Includes any I/O exceptions that may occur
[ "Calls", "the", "super", "method", "and", "writes", "the", "parameter", "k_max", "and", "the", "knn", "distances", "of", "this", "entry", "to", "the", "specified", "stream", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mktab/MkTabLeafEntry.java#L96-L104
63,217
elki-project/elki
elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mktab/MkTabLeafEntry.java
MkTabLeafEntry.readExternal
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal(in); int k_max = in.readInt(); knnDistances = new double[k_max]; for(int i = 0; i < k_max; i++) { knnDistances[i] = in.readDouble(); } }
java
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal(in); int k_max = in.readInt(); knnDistances = new double[k_max]; for(int i = 0; i < k_max; i++) { knnDistances[i] = in.readDouble(); } }
[ "@", "Override", "public", "void", "readExternal", "(", "ObjectInput", "in", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "super", ".", "readExternal", "(", "in", ")", ";", "int", "k_max", "=", "in", ".", "readInt", "(", ")", ";", "knn...
Calls the super method and reads the parameter k_max and knn distance of this entry from the specified input stream. @param in the stream to read data from in order to restore the object @throws java.io.IOException if I/O errors occur @throws ClassNotFoundException If the class for an object being restored cannot be f...
[ "Calls", "the", "super", "method", "and", "reads", "the", "parameter", "k_max", "and", "knn", "distance", "of", "this", "entry", "from", "the", "specified", "input", "stream", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mktab/MkTabLeafEntry.java#L115-L123
63,218
elki-project/elki
elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkcop/ApproximationLine.java
ApproximationLine.getValueAt
public double getValueAt(int k) { if (k < k_0) { return Double.POSITIVE_INFINITY; } return m * FastMath.log(k) + t; }
java
public double getValueAt(int k) { if (k < k_0) { return Double.POSITIVE_INFINITY; } return m * FastMath.log(k) + t; }
[ "public", "double", "getValueAt", "(", "int", "k", ")", "{", "if", "(", "k", "<", "k_0", ")", "{", "return", "Double", ".", "POSITIVE_INFINITY", ";", "}", "return", "m", "*", "FastMath", ".", "log", "(", "k", ")", "+", "t", ";", "}" ]
Returns the function value of the approximation line at the specified k. @param k the value for which the function value of the approximation line should be returned @return the function value of the approximation line at the specified k
[ "Returns", "the", "function", "value", "of", "the", "approximation", "line", "at", "the", "specified", "k", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkcop/ApproximationLine.java#L110-L115
63,219
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/fitting/LevenbergMarquardtMethod.java
LevenbergMarquardtMethod.iterate
public void iterate() { // build covmat out of fitting matrix by multiplying diagonal elements with // 1+lambda for(int i = 0; i < numfit; i++) { System.arraycopy(alpha[i], 0, covmat[i], 0, numfit); covmat[i][i] *= (1.0 + lambda); } // Solve the equation system (Gauss-Jordan) LinearE...
java
public void iterate() { // build covmat out of fitting matrix by multiplying diagonal elements with // 1+lambda for(int i = 0; i < numfit; i++) { System.arraycopy(alpha[i], 0, covmat[i], 0, numfit); covmat[i][i] *= (1.0 + lambda); } // Solve the equation system (Gauss-Jordan) LinearE...
[ "public", "void", "iterate", "(", ")", "{", "// build covmat out of fitting matrix by multiplying diagonal elements with", "// 1+lambda", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numfit", ";", "i", "++", ")", "{", "System", ".", "arraycopy", "(", "alpha...
Perform an iteration of the approximation loop.
[ "Perform", "an", "iteration", "of", "the", "approximation", "loop", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/fitting/LevenbergMarquardtMethod.java#L238-L282
63,220
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/fitting/LevenbergMarquardtMethod.java
LevenbergMarquardtMethod.run
public void run() { int maxruns = this.maxruns, maxsmall = this.maxsmall; double oldchi = getChiSq(); while(maxruns-- > 0) { iterate(); double newchi = getChiSq(), deltachi = newchi - oldchi; oldchi = newchi; // stop condition: only a small improvement in Chi. if(deltachi < 0 &...
java
public void run() { int maxruns = this.maxruns, maxsmall = this.maxsmall; double oldchi = getChiSq(); while(maxruns-- > 0) { iterate(); double newchi = getChiSq(), deltachi = newchi - oldchi; oldchi = newchi; // stop condition: only a small improvement in Chi. if(deltachi < 0 &...
[ "public", "void", "run", "(", ")", "{", "int", "maxruns", "=", "this", ".", "maxruns", ",", "maxsmall", "=", "this", ".", "maxsmall", ";", "double", "oldchi", "=", "getChiSq", "(", ")", ";", "while", "(", "maxruns", "--", ">", "0", ")", "{", "itera...
Iterate until convergence, at most 100 times.
[ "Iterate", "until", "convergence", "at", "most", "100", "times", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/fitting/LevenbergMarquardtMethod.java#L330-L342
63,221
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/overview/RectangleArranger.java
RectangleArranger.get
public double[] get(T object) { double[] v = map.get(object); if(v == null) { return null; } return v.clone(); }
java
public double[] get(T object) { double[] v = map.get(object); if(v == null) { return null; } return v.clone(); }
[ "public", "double", "[", "]", "get", "(", "T", "object", ")", "{", "double", "[", "]", "v", "=", "map", ".", "get", "(", "object", ")", ";", "if", "(", "v", "==", "null", ")", "{", "return", "null", ";", "}", "return", "v", ".", "clone", "(",...
Get the position data of the object @param object Query object @return Position information: x,y,w,h
[ "Get", "the", "position", "data", "of", "the", "object" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/overview/RectangleArranger.java#L380-L386
63,222
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/overview/RectangleArranger.java
RectangleArranger.relativeFill
public double relativeFill() { double acc = 0.0; final int cols = widths.size(); final int rows = heights.size(); { for(int y = 0; y < rows; y++) { for(int x = 0; x < cols; x++) { if(usage.get(y).get(x) != null) { acc += widths.get(x) * heights.get(y); } ...
java
public double relativeFill() { double acc = 0.0; final int cols = widths.size(); final int rows = heights.size(); { for(int y = 0; y < rows; y++) { for(int x = 0; x < cols; x++) { if(usage.get(y).get(x) != null) { acc += widths.get(x) * heights.get(y); } ...
[ "public", "double", "relativeFill", "(", ")", "{", "double", "acc", "=", "0.0", ";", "final", "int", "cols", "=", "widths", ".", "size", "(", ")", ";", "final", "int", "rows", "=", "heights", ".", "size", "(", ")", ";", "{", "for", "(", "int", "y...
Compute the relative fill. Useful for triggering a relayout if the relative fill is not satisfactory. @return relative fill
[ "Compute", "the", "relative", "fill", ".", "Useful", "for", "triggering", "a", "relayout", "if", "the", "relative", "fill", "is", "not", "satisfactory", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/overview/RectangleArranger.java#L464-L478
63,223
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUEUnit.java
CLIQUEUnit.contains
public boolean contains(NumberVector vector) { for(int i = 0; i < dims.length; i++) { final double value = vector.doubleValue(dims[i]); if(bounds[i << 1] > value || value >= bounds[(i << 1) + 1]) { return false; } } return true; }
java
public boolean contains(NumberVector vector) { for(int i = 0; i < dims.length; i++) { final double value = vector.doubleValue(dims[i]); if(bounds[i << 1] > value || value >= bounds[(i << 1) + 1]) { return false; } } return true; }
[ "public", "boolean", "contains", "(", "NumberVector", "vector", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "dims", ".", "length", ";", "i", "++", ")", "{", "final", "double", "value", "=", "vector", ".", "doubleValue", "(", "dims", ...
Returns true, if the intervals of this unit contain the specified feature vector. @param vector the feature vector to be tested for containment @return true, if the intervals of this unit contain the specified feature vector, false otherwise
[ "Returns", "true", "if", "the", "intervals", "of", "this", "unit", "contain", "the", "specified", "feature", "vector", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUEUnit.java#L120-L128
63,224
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUEUnit.java
CLIQUEUnit.addFeatureVector
public boolean addFeatureVector(DBIDRef id, NumberVector vector) { if(contains(vector)) { ids.add(id); return true; } return false; }
java
public boolean addFeatureVector(DBIDRef id, NumberVector vector) { if(contains(vector)) { ids.add(id); return true; } return false; }
[ "public", "boolean", "addFeatureVector", "(", "DBIDRef", "id", ",", "NumberVector", "vector", ")", "{", "if", "(", "contains", "(", "vector", ")", ")", "{", "ids", ".", "add", "(", "id", ")", ";", "return", "true", ";", "}", "return", "false", ";", "...
Adds the id of the specified feature vector to this unit, if this unit contains the feature vector. @param id Vector id @param vector the feature vector to be added @return true, if this unit contains the specified feature vector, false otherwise
[ "Adds", "the", "id", "of", "the", "specified", "feature", "vector", "to", "this", "unit", "if", "this", "unit", "contains", "the", "feature", "vector", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUEUnit.java#L139-L145
63,225
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUEUnit.java
CLIQUEUnit.containsRightNeighbor
protected boolean containsRightNeighbor(CLIQUEUnit unit, int d) { final int e = dims.length - 1; return checkDimensions(unit, e) && bounds[e << 1] == unit.bounds[(e << 1) + 1]; }
java
protected boolean containsRightNeighbor(CLIQUEUnit unit, int d) { final int e = dims.length - 1; return checkDimensions(unit, e) && bounds[e << 1] == unit.bounds[(e << 1) + 1]; }
[ "protected", "boolean", "containsRightNeighbor", "(", "CLIQUEUnit", "unit", ",", "int", "d", ")", "{", "final", "int", "e", "=", "dims", ".", "length", "-", "1", ";", "return", "checkDimensions", "(", "unit", ",", "e", ")", "&&", "bounds", "[", "e", "<...
Returns true if this unit is the right neighbor of the given unit. @param unit Reference unit @param d Current dimension @return true if this unit is the right neighbor of the given unit
[ "Returns", "true", "if", "this", "unit", "is", "the", "right", "neighbor", "of", "the", "given", "unit", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUEUnit.java#L186-L189
63,226
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUEUnit.java
CLIQUEUnit.join
protected CLIQUEUnit join(CLIQUEUnit other, double all, double tau) { if(other.dimensionality() != this.dimensionality()) { return null; } // n-1 dimensions must be the same: int e = dims.length - 1; if(!checkDimensions(other, e)) { return null; } if(dims[e] >= other.dims[e]) { ...
java
protected CLIQUEUnit join(CLIQUEUnit other, double all, double tau) { if(other.dimensionality() != this.dimensionality()) { return null; } // n-1 dimensions must be the same: int e = dims.length - 1; if(!checkDimensions(other, e)) { return null; } if(dims[e] >= other.dims[e]) { ...
[ "protected", "CLIQUEUnit", "join", "(", "CLIQUEUnit", "other", ",", "double", "all", ",", "double", "tau", ")", "{", "if", "(", "other", ".", "dimensionality", "(", ")", "!=", "this", ".", "dimensionality", "(", ")", ")", "{", "return", "null", ";", "}...
Joins this unit with the specified unit. @param other the unit to be joined @param all the overall number of feature vectors @param tau the density threshold for the selectivity of a unit @return the joined unit if the selectivity of the join result is equal or greater than tau, null otherwise
[ "Joins", "this", "unit", "with", "the", "specified", "unit", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUEUnit.java#L226-L246
63,227
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUEUnit.java
CLIQUEUnit.checkDimensions
private boolean checkDimensions(CLIQUEUnit other, int e) { for(int i = 0, j = 0; i < e; i++, j += 2) { if(dims[i] != other.dims[i] || bounds[j] != other.bounds[j] || bounds[j + 1] != bounds[j + 1]) { return false; } } return true; }
java
private boolean checkDimensions(CLIQUEUnit other, int e) { for(int i = 0, j = 0; i < e; i++, j += 2) { if(dims[i] != other.dims[i] || bounds[j] != other.bounds[j] || bounds[j + 1] != bounds[j + 1]) { return false; } } return true; }
[ "private", "boolean", "checkDimensions", "(", "CLIQUEUnit", "other", ",", "int", "e", ")", "{", "for", "(", "int", "i", "=", "0", ",", "j", "=", "0", ";", "i", "<", "e", ";", "i", "++", ",", "j", "+=", "2", ")", "{", "if", "(", "dims", "[", ...
Check that the first e dimensions agree. @param other Other unit @param e Number of dimensions to check @return {@code true} if the first e dimensions are the same (index and bounds)
[ "Check", "that", "the", "first", "e", "dimensions", "agree", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUEUnit.java#L256-L263
63,228
elki-project/elki
elki-core-parallel/src/main/java/de/lmu/ifi/dbs/elki/parallel/processor/DoubleMinMaxProcessor.java
DoubleMinMaxProcessor.merge
protected synchronized void merge(DoubleMinMax minmax) { this.minmax.put(minmax.getMin()); this.minmax.put(minmax.getMax()); }
java
protected synchronized void merge(DoubleMinMax minmax) { this.minmax.put(minmax.getMin()); this.minmax.put(minmax.getMax()); }
[ "protected", "synchronized", "void", "merge", "(", "DoubleMinMax", "minmax", ")", "{", "this", ".", "minmax", ".", "put", "(", "minmax", ".", "getMin", "(", ")", ")", ";", "this", ".", "minmax", ".", "put", "(", "minmax", ".", "getMax", "(", ")", ")"...
Merge the result of an instance. @param minmax Minmax value
[ "Merge", "the", "result", "of", "an", "instance", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-parallel/src/main/java/de/lmu/ifi/dbs/elki/parallel/processor/DoubleMinMaxProcessor.java#L80-L83
63,229
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java
DragableArea.enableStart
public void enableStart() { EventTarget targ = (EventTarget) element; targ.addEventListener(SVGConstants.SVG_EVENT_MOUSEDOWN, this, false); }
java
public void enableStart() { EventTarget targ = (EventTarget) element; targ.addEventListener(SVGConstants.SVG_EVENT_MOUSEDOWN, this, false); }
[ "public", "void", "enableStart", "(", ")", "{", "EventTarget", "targ", "=", "(", "EventTarget", ")", "element", ";", "targ", ".", "addEventListener", "(", "SVGConstants", ".", "SVG_EVENT_MOUSEDOWN", ",", "this", ",", "false", ")", ";", "}" ]
Enable capturing of 'mousedown' events.
[ "Enable", "capturing", "of", "mousedown", "events", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java#L172-L175
63,230
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java
DragableArea.disableStart
public void disableStart() { EventTarget targ = (EventTarget) element; targ.removeEventListener(SVGConstants.SVG_EVENT_MOUSEDOWN, this, false); }
java
public void disableStart() { EventTarget targ = (EventTarget) element; targ.removeEventListener(SVGConstants.SVG_EVENT_MOUSEDOWN, this, false); }
[ "public", "void", "disableStart", "(", ")", "{", "EventTarget", "targ", "=", "(", "EventTarget", ")", "element", ";", "targ", ".", "removeEventListener", "(", "SVGConstants", ".", "SVG_EVENT_MOUSEDOWN", ",", "this", ",", "false", ")", ";", "}" ]
Disable capturing of 'mousedown' events.
[ "Disable", "capturing", "of", "mousedown", "events", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java#L180-L183
63,231
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java
DragableArea.enableStop
protected void enableStop() { EventTarget targ = svgp.getDocument().getRootElement(); targ.addEventListener(SVGConstants.SVG_EVENT_MOUSEMOVE, this, false); targ.addEventListener(SVGConstants.SVG_EVENT_MOUSEUP, this, false); // FIXME: listen on the background object! targ.addEventListener(SVGConstant...
java
protected void enableStop() { EventTarget targ = svgp.getDocument().getRootElement(); targ.addEventListener(SVGConstants.SVG_EVENT_MOUSEMOVE, this, false); targ.addEventListener(SVGConstants.SVG_EVENT_MOUSEUP, this, false); // FIXME: listen on the background object! targ.addEventListener(SVGConstant...
[ "protected", "void", "enableStop", "(", ")", "{", "EventTarget", "targ", "=", "svgp", ".", "getDocument", "(", ")", ".", "getRootElement", "(", ")", ";", "targ", ".", "addEventListener", "(", "SVGConstants", ".", "SVG_EVENT_MOUSEMOVE", ",", "this", ",", "fal...
Enable capturing of 'mousemove' and 'mouseup' events.
[ "Enable", "capturing", "of", "mousemove", "and", "mouseup", "events", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java#L188-L194
63,232
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java
DragableArea.disableStop
protected void disableStop() { EventTarget targ = svgp.getDocument().getRootElement(); targ.removeEventListener(SVGConstants.SVG_EVENT_MOUSEMOVE, this, false); targ.removeEventListener(SVGConstants.SVG_EVENT_MOUSEUP, this, false); // FIXME: listen on the background object! targ.removeEventListener(S...
java
protected void disableStop() { EventTarget targ = svgp.getDocument().getRootElement(); targ.removeEventListener(SVGConstants.SVG_EVENT_MOUSEMOVE, this, false); targ.removeEventListener(SVGConstants.SVG_EVENT_MOUSEUP, this, false); // FIXME: listen on the background object! targ.removeEventListener(S...
[ "protected", "void", "disableStop", "(", ")", "{", "EventTarget", "targ", "=", "svgp", ".", "getDocument", "(", ")", ".", "getRootElement", "(", ")", ";", "targ", ".", "removeEventListener", "(", "SVGConstants", ".", "SVG_EVENT_MOUSEMOVE", ",", "this", ",", ...
Disable capturing of 'mousemove' and 'mouseup' events.
[ "Disable", "capturing", "of", "mousemove", "and", "mouseup", "events", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java#L199-L205
63,233
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java
DragableArea.getCoordinates
protected SVGPoint getCoordinates(Event evt) { return SVGUtil.elementCoordinatesFromEvent(this.svgp.getDocument(), this.coordref, evt); }
java
protected SVGPoint getCoordinates(Event evt) { return SVGUtil.elementCoordinatesFromEvent(this.svgp.getDocument(), this.coordref, evt); }
[ "protected", "SVGPoint", "getCoordinates", "(", "Event", "evt", ")", "{", "return", "SVGUtil", ".", "elementCoordinatesFromEvent", "(", "this", ".", "svgp", ".", "getDocument", "(", ")", ",", "this", ".", "coordref", ",", "evt", ")", ";", "}" ]
Return the event coordinates for this event. @param evt Event @return Coordinates
[ "Return", "the", "event", "coordinates", "for", "this", "event", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java#L256-L258
63,234
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java
DragableArea.startDrag
protected boolean startDrag(SVGPoint startPoint, Event evt) { if (listener != null) { return listener.startDrag(startPoint, evt); } return true; }
java
protected boolean startDrag(SVGPoint startPoint, Event evt) { if (listener != null) { return listener.startDrag(startPoint, evt); } return true; }
[ "protected", "boolean", "startDrag", "(", "SVGPoint", "startPoint", ",", "Event", "evt", ")", "{", "if", "(", "listener", "!=", "null", ")", "{", "return", "listener", ".", "startDrag", "(", "startPoint", ",", "evt", ")", ";", "}", "return", "true", ";",...
Action to do on drag start. @param startPoint Point where the drag was started. @param evt The event object @return {@code true} to start the drag operation
[ "Action", "to", "do", "on", "drag", "start", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java#L267-L272
63,235
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java
DragableArea.duringDrag
protected boolean duringDrag(SVGPoint startPoint, SVGPoint dragPoint, Event evt, boolean inside) { if (listener != null) { return listener.duringDrag(startPoint, dragPoint, evt, inside); } return true; }
java
protected boolean duringDrag(SVGPoint startPoint, SVGPoint dragPoint, Event evt, boolean inside) { if (listener != null) { return listener.duringDrag(startPoint, dragPoint, evt, inside); } return true; }
[ "protected", "boolean", "duringDrag", "(", "SVGPoint", "startPoint", ",", "SVGPoint", "dragPoint", ",", "Event", "evt", ",", "boolean", "inside", ")", "{", "if", "(", "listener", "!=", "null", ")", "{", "return", "listener", ".", "duringDrag", "(", "startPoi...
Method called during drags. @param startPoint Drag starting point @param dragPoint Drag end point @param evt The event object @param inside Inside the tracked element @return {@code true} to continue the drag
[ "Method", "called", "during", "drags", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java#L283-L288
63,236
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java
DragableArea.makeInvisible
public void makeInvisible() { CSSClass cls = new CSSClass(this, "unused"); cls.setStatement(SVGConstants.CSS_FILL_OPACITY_PROPERTY, "0"); cls.setStatement(SVGConstants.CSS_CURSOR_PROPERTY, SVGConstants.CSS_POINTER_VALUE); SVGUtil.setAtt(element, SVGConstants.SVG_STYLE_ATTRIBUTE, cls.inlineCSS()); }
java
public void makeInvisible() { CSSClass cls = new CSSClass(this, "unused"); cls.setStatement(SVGConstants.CSS_FILL_OPACITY_PROPERTY, "0"); cls.setStatement(SVGConstants.CSS_CURSOR_PROPERTY, SVGConstants.CSS_POINTER_VALUE); SVGUtil.setAtt(element, SVGConstants.SVG_STYLE_ATTRIBUTE, cls.inlineCSS()); }
[ "public", "void", "makeInvisible", "(", ")", "{", "CSSClass", "cls", "=", "new", "CSSClass", "(", "this", ",", "\"unused\"", ")", ";", "cls", ".", "setStatement", "(", "SVGConstants", ".", "CSS_FILL_OPACITY_PROPERTY", ",", "\"0\"", ")", ";", "cls", ".", "s...
Make the rectangle invisible.
[ "Make", "the", "rectangle", "invisible", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java#L309-L314
63,237
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java
DragableArea.makeVisible
public void makeVisible() { CSSClass cls = new CSSClass(this, "unused"); cls.setStatement(SVGConstants.CSS_FILL_PROPERTY, SVGConstants.CSS_GREEN_VALUE); cls.setStatement(SVGConstants.CSS_FILL_OPACITY_PROPERTY, "0.2"); cls.setStatement(SVGConstants.CSS_CURSOR_PROPERTY, SVGConstants.CSS_POINTER_VALUE); ...
java
public void makeVisible() { CSSClass cls = new CSSClass(this, "unused"); cls.setStatement(SVGConstants.CSS_FILL_PROPERTY, SVGConstants.CSS_GREEN_VALUE); cls.setStatement(SVGConstants.CSS_FILL_OPACITY_PROPERTY, "0.2"); cls.setStatement(SVGConstants.CSS_CURSOR_PROPERTY, SVGConstants.CSS_POINTER_VALUE); ...
[ "public", "void", "makeVisible", "(", ")", "{", "CSSClass", "cls", "=", "new", "CSSClass", "(", "this", ",", "\"unused\"", ")", ";", "cls", ".", "setStatement", "(", "SVGConstants", ".", "CSS_FILL_PROPERTY", ",", "SVGConstants", ".", "CSS_GREEN_VALUE", ")", ...
Make the rectangle visible, for debug purposes.
[ "Make", "the", "rectangle", "visible", "for", "debug", "purposes", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/DragableArea.java#L319-L325
63,238
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGScoreBar.java
SVGScoreBar.setFill
public void setFill(double val, double min, double max) { this.val = val; this.min = min; this.max = max; }
java
public void setFill(double val, double min, double max) { this.val = val; this.min = min; this.max = max; }
[ "public", "void", "setFill", "(", "double", "val", ",", "double", "min", ",", "double", "max", ")", "{", "this", ".", "val", "=", "val", ";", "this", ".", "min", "=", "min", ";", "this", ".", "max", "=", "max", ";", "}" ]
Set the fill of the score bar. @param val Value @param min Minimum value @param max Maximum value
[ "Set", "the", "fill", "of", "the", "score", "bar", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGScoreBar.java#L71-L75
63,239
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGScoreBar.java
SVGScoreBar.build
public Element build(SVGPlot svgp, double x, double y, double width, double height) { Element barchart = svgp.svgElement(SVGConstants.SVG_G_TAG); // TODO: use style library for colors! Element bar = svgp.svgRect(x, y, width, height); bar.setAttribute(SVGConstants.SVG_FILL_ATTRIBUTE, "#a0a0a0"); bar...
java
public Element build(SVGPlot svgp, double x, double y, double width, double height) { Element barchart = svgp.svgElement(SVGConstants.SVG_G_TAG); // TODO: use style library for colors! Element bar = svgp.svgRect(x, y, width, height); bar.setAttribute(SVGConstants.SVG_FILL_ATTRIBUTE, "#a0a0a0"); bar...
[ "public", "Element", "build", "(", "SVGPlot", "svgp", ",", "double", "x", ",", "double", "y", ",", "double", "width", ",", "double", "height", ")", "{", "Element", "barchart", "=", "svgp", ".", "svgElement", "(", "SVGConstants", ".", "SVG_G_TAG", ")", ";...
Build the actual element @param svgp Plot to draw to @param x X coordinate @param y Y coordinate @param width Width @param height Height @return new element
[ "Build", "the", "actual", "element" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGScoreBar.java#L114-L155
63,240
elki-project/elki
elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/datasource/bundle/BundleReader.java
BundleReader.openBuffer
void openBuffer() { if(buffer == null) { try { buffer = input.map(MapMode.READ_ONLY, 0, input.size()); } catch(IOException e) { throw new AbortException("Cannot map input bundle.", e); } } }
java
void openBuffer() { if(buffer == null) { try { buffer = input.map(MapMode.READ_ONLY, 0, input.size()); } catch(IOException e) { throw new AbortException("Cannot map input bundle.", e); } } }
[ "void", "openBuffer", "(", ")", "{", "if", "(", "buffer", "==", "null", ")", "{", "try", "{", "buffer", "=", "input", ".", "map", "(", "MapMode", ".", "READ_ONLY", ",", "0", ",", "input", ".", "size", "(", ")", ")", ";", "}", "catch", "(", "IOE...
Map the input file.
[ "Map", "the", "input", "file", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/datasource/bundle/BundleReader.java#L116-L125
63,241
elki-project/elki
elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/datasource/bundle/BundleReader.java
BundleReader.readMeta
void readMeta() { final int check = buffer.getInt(); if(check != MAGIC) { throw new AbortException("File does not start with expected magic."); } final int nummeta = buffer.getInt(); assert (nummeta > 0) : "Empty bundle?"; meta = new BundleMeta(nummeta); sers = new ByteBufferSerializer...
java
void readMeta() { final int check = buffer.getInt(); if(check != MAGIC) { throw new AbortException("File does not start with expected magic."); } final int nummeta = buffer.getInt(); assert (nummeta > 0) : "Empty bundle?"; meta = new BundleMeta(nummeta); sers = new ByteBufferSerializer...
[ "void", "readMeta", "(", ")", "{", "final", "int", "check", "=", "buffer", ".", "getInt", "(", ")", ";", "if", "(", "check", "!=", "MAGIC", ")", "{", "throw", "new", "AbortException", "(", "\"File does not start with expected magic.\"", ")", ";", "}", "fin...
Read the metadata.
[ "Read", "the", "metadata", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/datasource/bundle/BundleReader.java#L130-L159
63,242
elki-project/elki
elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/datasource/bundle/BundleReader.java
BundleReader.readObject
void readObject() { for(int i = 0; i < sers.length; ++i) { try { data[i] = sers[i].fromByteBuffer(buffer); } catch(UnsupportedOperationException e) { throw new AbortException("Deserialization failed.", e); } catch(IOException e) { throw new AbortException("IO er...
java
void readObject() { for(int i = 0; i < sers.length; ++i) { try { data[i] = sers[i].fromByteBuffer(buffer); } catch(UnsupportedOperationException e) { throw new AbortException("Deserialization failed.", e); } catch(IOException e) { throw new AbortException("IO er...
[ "void", "readObject", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "sers", ".", "length", ";", "++", "i", ")", "{", "try", "{", "data", "[", "i", "]", "=", "sers", "[", "i", "]", ".", "fromByteBuffer", "(", "buffer", ")", ...
Read an object.
[ "Read", "an", "object", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/datasource/bundle/BundleReader.java#L164-L176
63,243
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/Leader.java
Leader.run
public Clustering<PrototypeModel<O>> run(Relation<O> relation) { RangeQuery<O> rq = relation.getRangeQuery(getDistanceFunction(), threshold); ModifiableDBIDs seen = DBIDUtil.newHashSet(relation.size()); Clustering<PrototypeModel<O>> clustering = new Clustering<>("Prototype clustering", "prototype-clusterin...
java
public Clustering<PrototypeModel<O>> run(Relation<O> relation) { RangeQuery<O> rq = relation.getRangeQuery(getDistanceFunction(), threshold); ModifiableDBIDs seen = DBIDUtil.newHashSet(relation.size()); Clustering<PrototypeModel<O>> clustering = new Clustering<>("Prototype clustering", "prototype-clusterin...
[ "public", "Clustering", "<", "PrototypeModel", "<", "O", ">", ">", "run", "(", "Relation", "<", "O", ">", "relation", ")", "{", "RangeQuery", "<", "O", ">", "rq", "=", "relation", ".", "getRangeQuery", "(", "getDistanceFunction", "(", ")", ",", "threshol...
Run the leader clustering algorithm. @param relation Data set @return Clustering result
[ "Run", "the", "leader", "clustering", "algorithm", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/Leader.java#L91-L119
63,244
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/Cluster.java
Cluster.writeToText
@Override public void writeToText(TextWriterStream out, String label) { String name = getNameAutomatic(); if(name != null) { out.commentPrintLn("Cluster name: " + name); } out.commentPrintLn("Cluster noise flag: " + isNoise()); out.commentPrintLn("Cluster size: " + ids.size()); // also p...
java
@Override public void writeToText(TextWriterStream out, String label) { String name = getNameAutomatic(); if(name != null) { out.commentPrintLn("Cluster name: " + name); } out.commentPrintLn("Cluster noise flag: " + isNoise()); out.commentPrintLn("Cluster size: " + ids.size()); // also p...
[ "@", "Override", "public", "void", "writeToText", "(", "TextWriterStream", "out", ",", "String", "label", ")", "{", "String", "name", "=", "getNameAutomatic", "(", ")", ";", "if", "(", "name", "!=", "null", ")", "{", "out", ".", "commentPrintLn", "(", "\...
Write to a textual representation. Writing the actual group data will be handled by the caller, this is only meant to write the meta information. @param out output writer stream @param label Label to prefix
[ "Write", "to", "a", "textual", "representation", ".", "Writing", "the", "actual", "group", "data", "will", "be", "handled", "by", "the", "caller", "this", "is", "only", "meant", "to", "write", "the", "meta", "information", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/Cluster.java#L247-L259
63,245
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/JSVGSynchronizedCanvas.java
JSVGSynchronizedCanvas.scheduleSetPlot
private void scheduleSetPlot(final SVGPlot oldplot, final SVGPlot newplot) { UpdateManager um = this.getUpdateManager(); if(um != null) { synchronized(um) { if(um.isRunning()) { // LoggingUtil.warning("Scheduling detach: " + this + " " + oldplot); final Runnable detach = new Ru...
java
private void scheduleSetPlot(final SVGPlot oldplot, final SVGPlot newplot) { UpdateManager um = this.getUpdateManager(); if(um != null) { synchronized(um) { if(um.isRunning()) { // LoggingUtil.warning("Scheduling detach: " + this + " " + oldplot); final Runnable detach = new Ru...
[ "private", "void", "scheduleSetPlot", "(", "final", "SVGPlot", "oldplot", ",", "final", "SVGPlot", "newplot", ")", "{", "UpdateManager", "um", "=", "this", ".", "getUpdateManager", "(", ")", ";", "if", "(", "um", "!=", "null", ")", "{", "synchronized", "("...
Schedule a detach. @param oldplot Plot to detach from.
[ "Schedule", "a", "detach", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/JSVGSynchronizedCanvas.java#L111-L139
63,246
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/JSVGSynchronizedCanvas.java
JSVGSynchronizedCanvas.attachPlot
private void attachPlot(SVGPlot newplot) { this.plot = newplot; if(newplot == null) { super.setSVGDocument(null); return; } newplot.synchronizeWith(synchronizer); super.setSVGDocument(newplot.getDocument()); super.setDisableInteractions(newplot.getDisableInteractions()); }
java
private void attachPlot(SVGPlot newplot) { this.plot = newplot; if(newplot == null) { super.setSVGDocument(null); return; } newplot.synchronizeWith(synchronizer); super.setSVGDocument(newplot.getDocument()); super.setDisableInteractions(newplot.getDisableInteractions()); }
[ "private", "void", "attachPlot", "(", "SVGPlot", "newplot", ")", "{", "this", ".", "plot", "=", "newplot", ";", "if", "(", "newplot", "==", "null", ")", "{", "super", ".", "setSVGDocument", "(", "null", ")", ";", "return", ";", "}", "newplot", ".", "...
Attach to a new plot, and display. @param newplot Plot to attach to.
[ "Attach", "to", "a", "new", "plot", "and", "display", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/JSVGSynchronizedCanvas.java#L146-L155
63,247
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/JSVGSynchronizedCanvas.java
JSVGSynchronizedCanvas.detachPlot
private void detachPlot(SVGPlot oldplot) { if(oldplot == null) { return; } this.plot = null; oldplot.unsynchronizeWith(synchronizer); }
java
private void detachPlot(SVGPlot oldplot) { if(oldplot == null) { return; } this.plot = null; oldplot.unsynchronizeWith(synchronizer); }
[ "private", "void", "detachPlot", "(", "SVGPlot", "oldplot", ")", "{", "if", "(", "oldplot", "==", "null", ")", "{", "return", ";", "}", "this", ".", "plot", "=", "null", ";", "oldplot", ".", "unsynchronizeWith", "(", "synchronizer", ")", ";", "}" ]
Execute the detaching event. @param oldplot Plot to detach from.
[ "Execute", "the", "detaching", "event", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/JSVGSynchronizedCanvas.java#L162-L168
63,248
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/intrinsic/ISOS.java
ISOS.estimateID
protected double estimateID(DBIDRef ignore, DoubleDBIDListIter it, double[] p) { int j = 0; for(it.seek(0); it.valid(); it.advance()) { if(it.doubleValue() == 0. || DBIDUtil.equal(ignore, it)) { continue; } p[j++] = it.doubleValue(); } if(j < 2) { throw new ArithmeticExce...
java
protected double estimateID(DBIDRef ignore, DoubleDBIDListIter it, double[] p) { int j = 0; for(it.seek(0); it.valid(); it.advance()) { if(it.doubleValue() == 0. || DBIDUtil.equal(ignore, it)) { continue; } p[j++] = it.doubleValue(); } if(j < 2) { throw new ArithmeticExce...
[ "protected", "double", "estimateID", "(", "DBIDRef", "ignore", ",", "DoubleDBIDListIter", "it", ",", "double", "[", "]", "p", ")", "{", "int", "j", "=", "0", ";", "for", "(", "it", ".", "seek", "(", "0", ")", ";", "it", ".", "valid", "(", ")", ";...
Estimate the local intrinsic dimensionality. @param ignore Object to ignore @param it Iterator @param p Scratch array @return ID estimate
[ "Estimate", "the", "local", "intrinsic", "dimensionality", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/intrinsic/ISOS.java#L194-L206
63,249
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/ExponentialDistribution.java
ExponentialDistribution.logpdf
public static double logpdf(double val, double rate) { return val < 0. ? Double.NEGATIVE_INFINITY : FastMath.log(rate) - rate * val; }
java
public static double logpdf(double val, double rate) { return val < 0. ? Double.NEGATIVE_INFINITY : FastMath.log(rate) - rate * val; }
[ "public", "static", "double", "logpdf", "(", "double", "val", ",", "double", "rate", ")", "{", "return", "val", "<", "0.", "?", "Double", ".", "NEGATIVE_INFINITY", ":", "FastMath", ".", "log", "(", "rate", ")", "-", "rate", "*", "val", ";", "}" ]
log PDF, static version @param val Value to compute PDF at @param rate Rate parameter (1/scale) @return probability density
[ "log", "PDF", "static", "version" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/ExponentialDistribution.java#L149-L151
63,250
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/ExponentialDistribution.java
ExponentialDistribution.quantile
public static double quantile(double val, double rate) { return val >= 0 && val <= 1 ? -FastMath.log(1 - val) / rate : Double.NaN; }
java
public static double quantile(double val, double rate) { return val >= 0 && val <= 1 ? -FastMath.log(1 - val) / rate : Double.NaN; }
[ "public", "static", "double", "quantile", "(", "double", "val", ",", "double", "rate", ")", "{", "return", "val", ">=", "0", "&&", "val", "<=", "1", "?", "-", "FastMath", ".", "log", "(", "1", "-", "val", ")", "/", "rate", ":", "Double", ".", "Na...
Quantile function, static version @param val Value to compute quantile for @param rate Rate parameter @return Quantile
[ "Quantile", "function", "static", "version" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/ExponentialDistribution.java#L181-L183
63,251
elki-project/elki
elki-docutil/src/main/java/de/lmu/ifi/dbs/elki/application/internal/MarkdownDocStream.java
MarkdownDocStream.pendingBreak
private MarkdownDocStream pendingBreak() { if(newline == Newline.NONE) { return this; } out.append(newline == Newline.BREAK ? "\\\n" : newline == Newline.PAR ? "\n\n" : "\n"); for(int i = indent, j = i; i > 0; i -= j) { out.append(WHITESPACES, 0, (j = i > WHITESPACES.length() ? WHITESPACES.l...
java
private MarkdownDocStream pendingBreak() { if(newline == Newline.NONE) { return this; } out.append(newline == Newline.BREAK ? "\\\n" : newline == Newline.PAR ? "\n\n" : "\n"); for(int i = indent, j = i; i > 0; i -= j) { out.append(WHITESPACES, 0, (j = i > WHITESPACES.length() ? WHITESPACES.l...
[ "private", "MarkdownDocStream", "pendingBreak", "(", ")", "{", "if", "(", "newline", "==", "Newline", ".", "NONE", ")", "{", "return", "this", ";", "}", "out", ".", "append", "(", "newline", "==", "Newline", ".", "BREAK", "?", "\"\\\\\\n\"", ":", "newlin...
Output any pending line breaks. @return {@code this}
[ "Output", "any", "pending", "line", "breaks", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-docutil/src/main/java/de/lmu/ifi/dbs/elki/application/internal/MarkdownDocStream.java#L78-L88
63,252
elki-project/elki
elki-docutil/src/main/java/de/lmu/ifi/dbs/elki/application/internal/MarkdownDocStream.java
MarkdownDocStream.append
public MarkdownDocStream append(char c) { if(c == '\n') { newline = newline == Newline.NONE ? Newline.NEWLINE : Newline.PAR; return this; } pendingBreak(); out.append(c); return this; }
java
public MarkdownDocStream append(char c) { if(c == '\n') { newline = newline == Newline.NONE ? Newline.NEWLINE : Newline.PAR; return this; } pendingBreak(); out.append(c); return this; }
[ "public", "MarkdownDocStream", "append", "(", "char", "c", ")", "{", "if", "(", "c", "==", "'", "'", ")", "{", "newline", "=", "newline", "==", "Newline", ".", "NONE", "?", "Newline", ".", "NEWLINE", ":", "Newline", ".", "PAR", ";", "return", "this",...
Append a single character. @param c Char @return {@code this}
[ "Append", "a", "single", "character", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-docutil/src/main/java/de/lmu/ifi/dbs/elki/application/internal/MarkdownDocStream.java#L96-L104
63,253
elki-project/elki
elki-docutil/src/main/java/de/lmu/ifi/dbs/elki/application/internal/MarkdownDocStream.java
MarkdownDocStream.append
public MarkdownDocStream append(CharSequence p, int start, int end) { for(int pos = start; pos < end; ++pos) { final char c = p.charAt(pos); if(c == '\r') { continue; } append(c); // Uses \n magic. } return this; }
java
public MarkdownDocStream append(CharSequence p, int start, int end) { for(int pos = start; pos < end; ++pos) { final char c = p.charAt(pos); if(c == '\r') { continue; } append(c); // Uses \n magic. } return this; }
[ "public", "MarkdownDocStream", "append", "(", "CharSequence", "p", ",", "int", "start", ",", "int", "end", ")", "{", "for", "(", "int", "pos", "=", "start", ";", "pos", "<", "end", ";", "++", "pos", ")", "{", "final", "char", "c", "=", "p", ".", ...
Output part of a string. @param p String @param start Begin @param end End @return {@code this}
[ "Output", "part", "of", "a", "string", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-docutil/src/main/java/de/lmu/ifi/dbs/elki/application/internal/MarkdownDocStream.java#L124-L133
63,254
elki-project/elki
elki-docutil/src/main/java/de/lmu/ifi/dbs/elki/application/internal/MarkdownDocStream.java
MarkdownDocStream.indent
public MarkdownDocStream indent(int newindent) { if(newindent < indent) { newline = newline == Newline.BREAK ? Newline.NEWLINE : Newline.PAR; } indent = newindent; return this; }
java
public MarkdownDocStream indent(int newindent) { if(newindent < indent) { newline = newline == Newline.BREAK ? Newline.NEWLINE : Newline.PAR; } indent = newindent; return this; }
[ "public", "MarkdownDocStream", "indent", "(", "int", "newindent", ")", "{", "if", "(", "newindent", "<", "indent", ")", "{", "newline", "=", "newline", "==", "Newline", ".", "BREAK", "?", "Newline", ".", "NEWLINE", ":", "Newline", ".", "PAR", ";", "}", ...
Set the indent depth. @param newindent Indent depth @return {@code this}
[ "Set", "the", "indent", "depth", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-docutil/src/main/java/de/lmu/ifi/dbs/elki/application/internal/MarkdownDocStream.java#L203-L209
63,255
elki-project/elki
addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/util/AbstractSimpleOverlay.java
AbstractSimpleOverlay.render
public final void render(GL2 gl) { gl.glMatrixMode(GL2.GL_PROJECTION); gl.glPushMatrix(); gl.glLoadIdentity(); gl.glMatrixMode(GL2.GL_MODELVIEW); gl.glPushMatrix(); gl.glLoadIdentity(); gl.glOrtho(0, width, 0, height, -1, +1); gl.glColor4f(0f, 0f, 0f, .5f); // Fade background: ...
java
public final void render(GL2 gl) { gl.glMatrixMode(GL2.GL_PROJECTION); gl.glPushMatrix(); gl.glLoadIdentity(); gl.glMatrixMode(GL2.GL_MODELVIEW); gl.glPushMatrix(); gl.glLoadIdentity(); gl.glOrtho(0, width, 0, height, -1, +1); gl.glColor4f(0f, 0f, 0f, .5f); // Fade background: ...
[ "public", "final", "void", "render", "(", "GL2", "gl", ")", "{", "gl", ".", "glMatrixMode", "(", "GL2", ".", "GL_PROJECTION", ")", ";", "gl", ".", "glPushMatrix", "(", ")", ";", "gl", ".", "glLoadIdentity", "(", ")", ";", "gl", ".", "glMatrixMode", "...
Main render method @param gl GL context
[ "Main", "render", "method" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/util/AbstractSimpleOverlay.java#L49-L74
63,256
elki-project/elki
elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/AbstractStoringPageFile.java
AbstractStoringPageFile.setPageID
@Override public int setPageID(P page) { int pageID = page.getPageID(); if(pageID == -1) { pageID = getNextEmptyPageID(); if(pageID == -1) { pageID = nextPageID++; } page.setPageID(pageID); } return pageID; }
java
@Override public int setPageID(P page) { int pageID = page.getPageID(); if(pageID == -1) { pageID = getNextEmptyPageID(); if(pageID == -1) { pageID = nextPageID++; } page.setPageID(pageID); } return pageID; }
[ "@", "Override", "public", "int", "setPageID", "(", "P", "page", ")", "{", "int", "pageID", "=", "page", ".", "getPageID", "(", ")", ";", "if", "(", "pageID", "==", "-", "1", ")", "{", "pageID", "=", "getNextEmptyPageID", "(", ")", ";", "if", "(", ...
Sets the id of the given page. @param page the page to set the id
[ "Sets", "the", "id", "of", "the", "given", "page", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/AbstractStoringPageFile.java#L66-L77
63,257
elki-project/elki
elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/spatial/Polygon.java
Polygon.appendToBuffer
public StringBuilder appendToBuffer(StringBuilder buf) { Iterator<double[]> iter = points.iterator(); while(iter.hasNext()) { double[] data = iter.next(); for(int i = 0; i < data.length; i++) { if(i > 0) { buf.append(','); } buf.append(data[i]); } if(ite...
java
public StringBuilder appendToBuffer(StringBuilder buf) { Iterator<double[]> iter = points.iterator(); while(iter.hasNext()) { double[] data = iter.next(); for(int i = 0; i < data.length; i++) { if(i > 0) { buf.append(','); } buf.append(data[i]); } if(ite...
[ "public", "StringBuilder", "appendToBuffer", "(", "StringBuilder", "buf", ")", "{", "Iterator", "<", "double", "[", "]", ">", "iter", "=", "points", ".", "iterator", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "{", "double", "["...
Append the polygon to the buffer. @param buf Buffer to append to
[ "Append", "the", "polygon", "to", "the", "buffer", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/spatial/Polygon.java#L113-L128
63,258
elki-project/elki
elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/spatial/Polygon.java
Polygon.containsPoint2D
public boolean containsPoint2D(double[] v) { assert (v.length == 2); final double testx = v[0]; final double testy = v[1]; boolean c = false; Iterator<double[]> it = points.iterator(); double[] pre = points.get(points.size() - 1); while(it.hasNext()) { final double[] cur = it.next(); ...
java
public boolean containsPoint2D(double[] v) { assert (v.length == 2); final double testx = v[0]; final double testy = v[1]; boolean c = false; Iterator<double[]> it = points.iterator(); double[] pre = points.get(points.size() - 1); while(it.hasNext()) { final double[] cur = it.next(); ...
[ "public", "boolean", "containsPoint2D", "(", "double", "[", "]", "v", ")", "{", "assert", "(", "v", ".", "length", "==", "2", ")", ";", "final", "double", "testx", "=", "v", "[", "0", "]", ";", "final", "double", "testy", "=", "v", "[", "1", "]",...
Point in polygon test, based on http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html by W. Randolph Franklin @param v Point to test @return True when contained.
[ "Point", "in", "polygon", "test", "based", "on" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/spatial/Polygon.java#L245-L265
63,259
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/AffineTransformation.java
AffineTransformation.reorderAxesTransformation
public static AffineTransformation reorderAxesTransformation(int dim, int... axes) { double[][] m = zeroMatrix(dim + 1); // insert ones appropriately: for(int i = 0; i < axes.length; i++) { assert (0 < axes[i] && axes[i] <= dim); m[i][axes[i] - 1] = 1.0; } int useddim = 1; for(int i ...
java
public static AffineTransformation reorderAxesTransformation(int dim, int... axes) { double[][] m = zeroMatrix(dim + 1); // insert ones appropriately: for(int i = 0; i < axes.length; i++) { assert (0 < axes[i] && axes[i] <= dim); m[i][axes[i] - 1] = 1.0; } int useddim = 1; for(int i ...
[ "public", "static", "AffineTransformation", "reorderAxesTransformation", "(", "int", "dim", ",", "int", "...", "axes", ")", "{", "double", "[", "]", "[", "]", "m", "=", "zeroMatrix", "(", "dim", "+", "1", ")", ";", "// insert ones appropriately:", "for", "("...
Generate a transformation that reorders axes in the given way. The list of axes to be used should not contain duplicates, or the resulting matrix will not be invertible. It does not have to be complete however, in particular an empty list will result in the identity transform: unmentioned axes will be appended in thei...
[ "Generate", "a", "transformation", "that", "reorders", "axes", "in", "the", "given", "way", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/AffineTransformation.java#L101-L129
63,260
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/AffineTransformation.java
AffineTransformation.addTranslation
public void addTranslation(double[] v) { assert (v.length == dim); // reset inverse transformation - needs recomputation. inv = null; double[][] homTrans = unitMatrix(dim + 1); for(int i = 0; i < dim; i++) { homTrans[i][dim] = v[i]; } trans = times(homTrans, trans); }
java
public void addTranslation(double[] v) { assert (v.length == dim); // reset inverse transformation - needs recomputation. inv = null; double[][] homTrans = unitMatrix(dim + 1); for(int i = 0; i < dim; i++) { homTrans[i][dim] = v[i]; } trans = times(homTrans, trans); }
[ "public", "void", "addTranslation", "(", "double", "[", "]", "v", ")", "{", "assert", "(", "v", ".", "length", "==", "dim", ")", ";", "// reset inverse transformation - needs recomputation.", "inv", "=", "null", ";", "double", "[", "]", "[", "]", "homTrans",...
Add a translation operation to the matrix @param v translation vector
[ "Add", "a", "translation", "operation", "to", "the", "matrix" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/AffineTransformation.java#L145-L156
63,261
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/AffineTransformation.java
AffineTransformation.addMatrix
public void addMatrix(double[][] m) { assert (m.length == dim); assert (m[0].length == dim); // reset inverse transformation - needs recomputation. inv = null; // extend the matrix with an extra row and column double[][] ht = new double[dim + 1][dim + 1]; for(int i = 0; i < dim; i++) { ...
java
public void addMatrix(double[][] m) { assert (m.length == dim); assert (m[0].length == dim); // reset inverse transformation - needs recomputation. inv = null; // extend the matrix with an extra row and column double[][] ht = new double[dim + 1][dim + 1]; for(int i = 0; i < dim; i++) { ...
[ "public", "void", "addMatrix", "(", "double", "[", "]", "[", "]", "m", ")", "{", "assert", "(", "m", ".", "length", "==", "dim", ")", ";", "assert", "(", "m", "[", "0", "]", ".", "length", "==", "dim", ")", ";", "// reset inverse transformation - nee...
Add a matrix operation to the matrix. Be careful to use only invertible matrices if you want an invertible affine transformation. @param m matrix (should be invertible)
[ "Add", "a", "matrix", "operation", "to", "the", "matrix", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/AffineTransformation.java#L166-L184
63,262
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/AffineTransformation.java
AffineTransformation.addRotation
public void addRotation(int axis1, int axis2, double angle) { // TODO: throw an exception instead of using assert assert (axis1 >= 0); assert (axis1 < dim); assert (axis1 >= 0); assert (axis2 < dim); assert (axis1 != axis2); // reset inverse transformation - needs recomputation. inv = n...
java
public void addRotation(int axis1, int axis2, double angle) { // TODO: throw an exception instead of using assert assert (axis1 >= 0); assert (axis1 < dim); assert (axis1 >= 0); assert (axis2 < dim); assert (axis1 != axis2); // reset inverse transformation - needs recomputation. inv = n...
[ "public", "void", "addRotation", "(", "int", "axis1", ",", "int", "axis2", ",", "double", "angle", ")", "{", "// TODO: throw an exception instead of using assert", "assert", "(", "axis1", ">=", "0", ")", ";", "assert", "(", "axis1", "<", "dim", ")", ";", "as...
Convenience function to apply a rotation in 2 dimensions. @param axis1 first dimension @param axis2 second dimension @param angle rotation angle in radians.
[ "Convenience", "function", "to", "apply", "a", "rotation", "in", "2", "dimensions", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/AffineTransformation.java#L193-L218
63,263
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/AffineTransformation.java
AffineTransformation.addAxisReflection
public void addAxisReflection(int axis) { assert (0 < axis && axis <= dim); // reset inverse transformation - needs recomputation. inv = null; // Formal: // Matrix homTrans = Matrix.unitMatrix(dim + 1); // homTrans[axis - 1][axis - 1] = -1; // trans = homTrans.times(trans); // Faster: ...
java
public void addAxisReflection(int axis) { assert (0 < axis && axis <= dim); // reset inverse transformation - needs recomputation. inv = null; // Formal: // Matrix homTrans = Matrix.unitMatrix(dim + 1); // homTrans[axis - 1][axis - 1] = -1; // trans = homTrans.times(trans); // Faster: ...
[ "public", "void", "addAxisReflection", "(", "int", "axis", ")", "{", "assert", "(", "0", "<", "axis", "&&", "axis", "<=", "dim", ")", ";", "// reset inverse transformation - needs recomputation.", "inv", "=", "null", ";", "// Formal:", "// Matrix homTrans = Matrix.u...
Add a reflection along the given axis. @param axis Axis number to do the reflection at.
[ "Add", "a", "reflection", "along", "the", "given", "axis", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/AffineTransformation.java#L225-L238
63,264
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/AffineTransformation.java
AffineTransformation.homogeneVector
public double[] homogeneVector(double[] v) { assert (v.length == dim); double[] dv = Arrays.copyOf(v, dim + 1); dv[dim] = 1.0; return dv; }
java
public double[] homogeneVector(double[] v) { assert (v.length == dim); double[] dv = Arrays.copyOf(v, dim + 1); dv[dim] = 1.0; return dv; }
[ "public", "double", "[", "]", "homogeneVector", "(", "double", "[", "]", "v", ")", "{", "assert", "(", "v", ".", "length", "==", "dim", ")", ";", "double", "[", "]", "dv", "=", "Arrays", ".", "copyOf", "(", "v", ",", "dim", "+", "1", ")", ";", ...
Transform an absolute vector into homogeneous coordinates. @param v initial vector @return vector of dim+1, with new column having the value 1.0
[ "Transform", "an", "absolute", "vector", "into", "homogeneous", "coordinates", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/AffineTransformation.java#L292-L297
63,265
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/AffineTransformation.java
AffineTransformation.homogeneRelativeVector
public double[] homogeneRelativeVector(double[] v) { assert (v.length == dim); // TODO: this only works properly when trans[dim][dim] == 1.0, right? double[] dv = Arrays.copyOf(v, dim + 1); dv[dim] = 0.0; return dv; }
java
public double[] homogeneRelativeVector(double[] v) { assert (v.length == dim); // TODO: this only works properly when trans[dim][dim] == 1.0, right? double[] dv = Arrays.copyOf(v, dim + 1); dv[dim] = 0.0; return dv; }
[ "public", "double", "[", "]", "homogeneRelativeVector", "(", "double", "[", "]", "v", ")", "{", "assert", "(", "v", ".", "length", "==", "dim", ")", ";", "// TODO: this only works properly when trans[dim][dim] == 1.0, right?", "double", "[", "]", "dv", "=", "Arr...
Transform a relative vector into homogeneous coordinates. @param v initial vector @return vector of dim+1, with new column having the value 0.0
[ "Transform", "a", "relative", "vector", "into", "homogeneous", "coordinates", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/AffineTransformation.java#L305-L311
63,266
elki-project/elki
addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/RepresentativeUncertainClustering.java
RepresentativeUncertainClustering.computeConfidence
private double computeConfidence(int support, int samples) { final double z = NormalDistribution.standardNormalQuantile(alpha); final double eprob = support / (double) samples; return Math.max(0., eprob - z * FastMath.sqrt((eprob * (1 - eprob)) / samples)); }
java
private double computeConfidence(int support, int samples) { final double z = NormalDistribution.standardNormalQuantile(alpha); final double eprob = support / (double) samples; return Math.max(0., eprob - z * FastMath.sqrt((eprob * (1 - eprob)) / samples)); }
[ "private", "double", "computeConfidence", "(", "int", "support", ",", "int", "samples", ")", "{", "final", "double", "z", "=", "NormalDistribution", ".", "standardNormalQuantile", "(", "alpha", ")", ";", "final", "double", "eprob", "=", "support", "/", "(", ...
Estimate the confidence probability of a clustering. @param support Number of supporting samples @param samples Total samples @return Probability
[ "Estimate", "the", "confidence", "probability", "of", "a", "clustering", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/RepresentativeUncertainClustering.java#L294-L298
63,267
elki-project/elki
addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/RepresentativeUncertainClustering.java
RepresentativeUncertainClustering.runClusteringAlgorithm
protected Clustering<?> runClusteringAlgorithm(ResultHierarchy hierarchy, Result parent, DBIDs ids, DataStore<DoubleVector> store, int dim, String title) { SimpleTypeInformation<DoubleVector> t = new VectorFieldTypeInformation<>(DoubleVector.FACTORY, dim); Relation<DoubleVector> sample = new MaterializedRelatio...
java
protected Clustering<?> runClusteringAlgorithm(ResultHierarchy hierarchy, Result parent, DBIDs ids, DataStore<DoubleVector> store, int dim, String title) { SimpleTypeInformation<DoubleVector> t = new VectorFieldTypeInformation<>(DoubleVector.FACTORY, dim); Relation<DoubleVector> sample = new MaterializedRelatio...
[ "protected", "Clustering", "<", "?", ">", "runClusteringAlgorithm", "(", "ResultHierarchy", "hierarchy", ",", "Result", "parent", ",", "DBIDs", "ids", ",", "DataStore", "<", "DoubleVector", ">", "store", ",", "int", "dim", ",", "String", "title", ")", "{", "...
Run a clustering algorithm on a single instance. @param parent Parent result to attach to @param ids Object IDs to process @param store Input data @param dim Dimensionality @param title Title of relation @return Clustering result
[ "Run", "a", "clustering", "algorithm", "on", "a", "single", "instance", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/RepresentativeUncertainClustering.java#L310-L320
63,268
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceLoader.java
ELKIServiceLoader.load
public static void load(Class<?> parent, ClassLoader cl) { char[] buf = new char[0x4000]; try { String fullName = RESOURCE_PREFIX + parent.getName(); Enumeration<URL> configfiles = cl.getResources(fullName); while(configfiles.hasMoreElements()) { URL nextElement = configfiles.nextEleme...
java
public static void load(Class<?> parent, ClassLoader cl) { char[] buf = new char[0x4000]; try { String fullName = RESOURCE_PREFIX + parent.getName(); Enumeration<URL> configfiles = cl.getResources(fullName); while(configfiles.hasMoreElements()) { URL nextElement = configfiles.nextEleme...
[ "public", "static", "void", "load", "(", "Class", "<", "?", ">", "parent", ",", "ClassLoader", "cl", ")", "{", "char", "[", "]", "buf", "=", "new", "char", "[", "0x4000", "]", ";", "try", "{", "String", "fullName", "=", "RESOURCE_PREFIX", "+", "paren...
Load the service file.
[ "Load", "the", "service", "file", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceLoader.java#L75-L122
63,269
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceLoader.java
ELKIServiceLoader.parseLine
private static void parseLine(Class<?> parent, char[] line, int begin, int end) { while(begin < end && line[begin] == ' ') { begin++; } if(begin >= end || line[begin] == '#') { return; // Empty/comment lines are okay, continue } // Find end of class name: int cend = begin + 1; wh...
java
private static void parseLine(Class<?> parent, char[] line, int begin, int end) { while(begin < end && line[begin] == ' ') { begin++; } if(begin >= end || line[begin] == '#') { return; // Empty/comment lines are okay, continue } // Find end of class name: int cend = begin + 1; wh...
[ "private", "static", "void", "parseLine", "(", "Class", "<", "?", ">", "parent", ",", "char", "[", "]", "line", ",", "int", "begin", ",", "int", "end", ")", "{", "while", "(", "begin", "<", "end", "&&", "line", "[", "begin", "]", "==", "'", "'", ...
Parse a single line from a service registry file. @param parent Parent class @param line Line to read
[ "Parse", "a", "single", "line", "from", "a", "service", "registry", "file", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceLoader.java#L130-L158
63,270
elki-project/elki
elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/rdknn/RdKNNLeafEntry.java
RdKNNLeafEntry.readExternal
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal(in); this.knnDistance = in.readDouble(); }
java
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal(in); this.knnDistance = in.readDouble(); }
[ "@", "Override", "public", "void", "readExternal", "(", "ObjectInput", "in", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "super", ".", "readExternal", "(", "in", ")", ";", "this", ".", "knnDistance", "=", "in", ".", "readDouble", "(", "...
Calls the super method and reads the knn distance of this entry from the specified input stream. @param in the stream to read data from in order to restore the object @throws java.io.IOException if I/O errors occur @throws ClassNotFoundException If the class for an object being restored cannot be found.
[ "Calls", "the", "super", "method", "and", "reads", "the", "knn", "distance", "of", "this", "entry", "from", "the", "specified", "input", "stream", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/rdknn/RdKNNLeafEntry.java#L98-L102
63,271
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/OnlineLOF.java
OnlineLOF.getKNNAndRkNNQueries
private Pair<Pair<KNNQuery<O>, KNNQuery<O>>, Pair<RKNNQuery<O>, RKNNQuery<O>>> getKNNAndRkNNQueries(Database database, Relation<O> relation, StepProgress stepprog) { DistanceQuery<O> drefQ = database.getDistanceQuery(relation, referenceDistanceFunction); // Use "HEAVY" flag, since this is an online algorithm ...
java
private Pair<Pair<KNNQuery<O>, KNNQuery<O>>, Pair<RKNNQuery<O>, RKNNQuery<O>>> getKNNAndRkNNQueries(Database database, Relation<O> relation, StepProgress stepprog) { DistanceQuery<O> drefQ = database.getDistanceQuery(relation, referenceDistanceFunction); // Use "HEAVY" flag, since this is an online algorithm ...
[ "private", "Pair", "<", "Pair", "<", "KNNQuery", "<", "O", ">", ",", "KNNQuery", "<", "O", ">", ">", ",", "Pair", "<", "RKNNQuery", "<", "O", ">", ",", "RKNNQuery", "<", "O", ">", ">", ">", "getKNNAndRkNNQueries", "(", "Database", "database", ",", ...
Get the kNN and rkNN queries for the algorithm. @param relation Data @param stepprog Progress logger @return the kNN and rkNN queries
[ "Get", "the", "kNN", "and", "rkNN", "queries", "for", "the", "algorithm", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/OnlineLOF.java#L121-L165
63,272
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/COPACNeighborPredicate.java
COPACNeighborPredicate.instantiate
public COPACNeighborPredicate.Instance instantiate(Database database, Relation<V> relation) { DistanceQuery<V> dq = database.getDistanceQuery(relation, EuclideanDistanceFunction.STATIC); KNNQuery<V> knnq = database.getKNNQuery(dq, settings.k); WritableDataStore<COPACModel> storage = DataStoreUtil.makeStora...
java
public COPACNeighborPredicate.Instance instantiate(Database database, Relation<V> relation) { DistanceQuery<V> dq = database.getDistanceQuery(relation, EuclideanDistanceFunction.STATIC); KNNQuery<V> knnq = database.getKNNQuery(dq, settings.k); WritableDataStore<COPACModel> storage = DataStoreUtil.makeStora...
[ "public", "COPACNeighborPredicate", ".", "Instance", "instantiate", "(", "Database", "database", ",", "Relation", "<", "V", ">", "relation", ")", "{", "DistanceQuery", "<", "V", ">", "dq", "=", "database", ".", "getDistanceQuery", "(", "relation", ",", "Euclid...
Full instantiation method. @param database Database @param relation Vector relation @return Instance
[ "Full", "instantiation", "method", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/COPACNeighborPredicate.java#L115-L131
63,273
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/COPACNeighborPredicate.java
COPACNeighborPredicate.computeLocalModel
protected COPACModel computeLocalModel(DBIDRef id, DoubleDBIDList knnneighbors, Relation<V> relation) { PCAResult epairs = settings.pca.processIds(knnneighbors, relation); int pdim = settings.filter.filter(epairs.getEigenvalues()); PCAFilteredResult pcares = new PCAFilteredResult(epairs.getEigenPairs(), pdi...
java
protected COPACModel computeLocalModel(DBIDRef id, DoubleDBIDList knnneighbors, Relation<V> relation) { PCAResult epairs = settings.pca.processIds(knnneighbors, relation); int pdim = settings.filter.filter(epairs.getEigenvalues()); PCAFilteredResult pcares = new PCAFilteredResult(epairs.getEigenPairs(), pdi...
[ "protected", "COPACModel", "computeLocalModel", "(", "DBIDRef", "id", ",", "DoubleDBIDList", "knnneighbors", ",", "Relation", "<", "V", ">", "relation", ")", "{", "PCAResult", "epairs", "=", "settings", ".", "pca", ".", "processIds", "(", "knnneighbors", ",", ...
COPAC model computation @param id Query object @param knnneighbors k nearest neighbors @param relation Data relation @return COPAC object model
[ "COPAC", "model", "computation" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/COPACNeighborPredicate.java#L141-L163
63,274
elki-project/elki
elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/AbstractRStarTreeNode.java
AbstractRStarTreeNode.computeMBR
public ModifiableHyperBoundingBox computeMBR() { E firstEntry = getEntry(0); if(firstEntry == null) { return null; } // Note: we deliberately get a cloned copy here, since we will modify it. ModifiableHyperBoundingBox mbr = new ModifiableHyperBoundingBox(firstEntry); for(int i = 1; i < num...
java
public ModifiableHyperBoundingBox computeMBR() { E firstEntry = getEntry(0); if(firstEntry == null) { return null; } // Note: we deliberately get a cloned copy here, since we will modify it. ModifiableHyperBoundingBox mbr = new ModifiableHyperBoundingBox(firstEntry); for(int i = 1; i < num...
[ "public", "ModifiableHyperBoundingBox", "computeMBR", "(", ")", "{", "E", "firstEntry", "=", "getEntry", "(", "0", ")", ";", "if", "(", "firstEntry", "==", "null", ")", "{", "return", "null", ";", "}", "// Note: we deliberately get a cloned copy here, since we will ...
Recomputing the MBR is rather expensive. @return MBR
[ "Recomputing", "the", "MBR", "is", "rather", "expensive", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/AbstractRStarTreeNode.java#L72-L83
63,275
elki-project/elki
addons/joglvis/src/main/java/de/lmu/ifi/dbs/elki/joglvis/SimpleCamera3D.java
SimpleCamera3D.applyCamera
public void applyCamera(GL2 gl) { // Setup projection. gl.glMatrixMode(GL2.GL_PROJECTION); gl.glLoadIdentity(); glu.gluPerspective(45f, // fov, width / (float) height, // ratio 0.f, 10.f); // near, far clipping eye[0] = (float) Math.sin(theta) * 2.f; eye[1] = .5f; eye[2] = (f...
java
public void applyCamera(GL2 gl) { // Setup projection. gl.glMatrixMode(GL2.GL_PROJECTION); gl.glLoadIdentity(); glu.gluPerspective(45f, // fov, width / (float) height, // ratio 0.f, 10.f); // near, far clipping eye[0] = (float) Math.sin(theta) * 2.f; eye[1] = .5f; eye[2] = (f...
[ "public", "void", "applyCamera", "(", "GL2", "gl", ")", "{", "// Setup projection.", "gl", ".", "glMatrixMode", "(", "GL2", ".", "GL_PROJECTION", ")", ";", "gl", ".", "glLoadIdentity", "(", ")", ";", "glu", ".", "gluPerspective", "(", "45f", ",", "// fov,"...
Apply the camera settings. @param gl GL API.
[ "Apply", "the", "camera", "settings", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/joglvis/src/main/java/de/lmu/ifi/dbs/elki/joglvis/SimpleCamera3D.java#L66-L84
63,276
elki-project/elki
elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/query/knn/LinearScanDistanceKNNQuery.java
LinearScanDistanceKNNQuery.linearScanBatchKNN
private void linearScanBatchKNN(ArrayDBIDs ids, List<KNNHeap> heaps) { final DistanceQuery<O> dq = distanceQuery; // The distance is computed on database IDs for(DBIDIter iter = getRelation().getDBIDs().iter(); iter.valid(); iter.advance()) { int index = 0; for(DBIDIter iter2 = ids.iter(); iter2...
java
private void linearScanBatchKNN(ArrayDBIDs ids, List<KNNHeap> heaps) { final DistanceQuery<O> dq = distanceQuery; // The distance is computed on database IDs for(DBIDIter iter = getRelation().getDBIDs().iter(); iter.valid(); iter.advance()) { int index = 0; for(DBIDIter iter2 = ids.iter(); iter2...
[ "private", "void", "linearScanBatchKNN", "(", "ArrayDBIDs", "ids", ",", "List", "<", "KNNHeap", ">", "heaps", ")", "{", "final", "DistanceQuery", "<", "O", ">", "dq", "=", "distanceQuery", ";", "// The distance is computed on database IDs", "for", "(", "DBIDIter",...
Linear batch knn for arbitrary distance functions. @param ids DBIDs to process @param heaps Heaps to store the results in
[ "Linear", "batch", "knn", "for", "arbitrary", "distance", "functions", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/query/knn/LinearScanDistanceKNNQuery.java#L103-L113
63,277
elki-project/elki
elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/colorhistogram/RGBHistogramQuadraticDistanceFunction.java
RGBHistogramQuadraticDistanceFunction.computeWeightMatrix
public static double[][] computeWeightMatrix(int bpp) { final int dim = bpp * bpp * bpp; final double[][] m = new double[dim][dim]; // maximum occurring distance in manhattan between bins: final double max = 3. * (bpp - 1.); for(int x = 0; x < dim; x++) { final int rx = (x / bpp) / bpp; ...
java
public static double[][] computeWeightMatrix(int bpp) { final int dim = bpp * bpp * bpp; final double[][] m = new double[dim][dim]; // maximum occurring distance in manhattan between bins: final double max = 3. * (bpp - 1.); for(int x = 0; x < dim; x++) { final int rx = (x / bpp) / bpp; ...
[ "public", "static", "double", "[", "]", "[", "]", "computeWeightMatrix", "(", "int", "bpp", ")", "{", "final", "int", "dim", "=", "bpp", "*", "bpp", "*", "bpp", ";", "final", "double", "[", "]", "[", "]", "m", "=", "new", "double", "[", "dim", "]...
Compute weight matrix for a RGB color histogram @param bpp bins per plane @return Weight matrix
[ "Compute", "weight", "matrix", "for", "a", "RGB", "color", "histogram" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/colorhistogram/RGBHistogramQuadraticDistanceFunction.java#L64-L88
63,278
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/statistics/HopkinsStatisticClusteringTendency.java
HopkinsStatisticClusteringTendency.initializeDataExtends
protected void initializeDataExtends(Relation<NumberVector> relation, int dim, double[] min, double[] extend) { assert (min.length == dim && extend.length == dim); // if no parameter for min max compute min max values for each dimension // from dataset if(minima == null || maxima == null || minima.lengt...
java
protected void initializeDataExtends(Relation<NumberVector> relation, int dim, double[] min, double[] extend) { assert (min.length == dim && extend.length == dim); // if no parameter for min max compute min max values for each dimension // from dataset if(minima == null || maxima == null || minima.lengt...
[ "protected", "void", "initializeDataExtends", "(", "Relation", "<", "NumberVector", ">", "relation", ",", "int", "dim", ",", "double", "[", "]", "min", ",", "double", "[", "]", "extend", ")", "{", "assert", "(", "min", ".", "length", "==", "dim", "&&", ...
Initialize the uniform sampling area. @param relation Data relation @param dim Dimensionality @param min Minima output array (preallocated!) @param extend Data extend output array (preallocated!)
[ "Initialize", "the", "uniform", "sampling", "area", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/statistics/HopkinsStatisticClusteringTendency.java#L248-L285
63,279
elki-project/elki
elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/distance/similarityfunction/SharedNearestNeighborSimilarityFunction.java
SharedNearestNeighborSimilarityFunction.countSharedNeighbors
static protected int countSharedNeighbors(DBIDs neighbors1, DBIDs neighbors2) { int intersection = 0; DBIDIter iter1 = neighbors1.iter(); DBIDIter iter2 = neighbors2.iter(); while(iter1.valid() && iter2.valid()) { final int comp = DBIDUtil.compare(iter1, iter2); if(comp == 0) { inter...
java
static protected int countSharedNeighbors(DBIDs neighbors1, DBIDs neighbors2) { int intersection = 0; DBIDIter iter1 = neighbors1.iter(); DBIDIter iter2 = neighbors2.iter(); while(iter1.valid() && iter2.valid()) { final int comp = DBIDUtil.compare(iter1, iter2); if(comp == 0) { inter...
[ "static", "protected", "int", "countSharedNeighbors", "(", "DBIDs", "neighbors1", ",", "DBIDs", "neighbors2", ")", "{", "int", "intersection", "=", "0", ";", "DBIDIter", "iter1", "=", "neighbors1", ".", "iter", "(", ")", ";", "DBIDIter", "iter2", "=", "neigh...
Compute the intersection size @param neighbors1 SORTED neighbors of first @param neighbors2 SORTED neighbors of second @return Intersection size
[ "Compute", "the", "intersection", "size" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/distance/similarityfunction/SharedNearestNeighborSimilarityFunction.java#L61-L81
63,280
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/index/idistance/InMemoryIDistanceIndex.java
InMemoryIDistanceIndex.rankReferencePoints
protected static <O> DoubleIntPair[] rankReferencePoints(DistanceQuery<O> distanceQuery, O obj, ArrayDBIDs referencepoints) { DoubleIntPair[] priority = new DoubleIntPair[referencepoints.size()]; // Compute distances to reference points. for(DBIDArrayIter iter = referencepoints.iter(); iter.valid(); iter.ad...
java
protected static <O> DoubleIntPair[] rankReferencePoints(DistanceQuery<O> distanceQuery, O obj, ArrayDBIDs referencepoints) { DoubleIntPair[] priority = new DoubleIntPair[referencepoints.size()]; // Compute distances to reference points. for(DBIDArrayIter iter = referencepoints.iter(); iter.valid(); iter.ad...
[ "protected", "static", "<", "O", ">", "DoubleIntPair", "[", "]", "rankReferencePoints", "(", "DistanceQuery", "<", "O", ">", "distanceQuery", ",", "O", "obj", ",", "ArrayDBIDs", "referencepoints", ")", "{", "DoubleIntPair", "[", "]", "priority", "=", "new", ...
Sort the reference points by distance to the query object @param distanceQuery Distance query @param obj Query object @param referencepoints Iterator for reference points @return Sorted array.
[ "Sort", "the", "reference", "points", "by", "distance", "to", "the", "query", "object" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/index/idistance/InMemoryIDistanceIndex.java#L258-L268
63,281
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/index/idistance/InMemoryIDistanceIndex.java
InMemoryIDistanceIndex.binarySearch
protected static void binarySearch(ModifiableDoubleDBIDList index, DoubleDBIDListIter iter, double val) { // Binary search. TODO: move this into the DoubleDBIDList class. int left = 0, right = index.size(); while(left < right) { final int mid = (left + right) >>> 1; final double curd = iter.seek...
java
protected static void binarySearch(ModifiableDoubleDBIDList index, DoubleDBIDListIter iter, double val) { // Binary search. TODO: move this into the DoubleDBIDList class. int left = 0, right = index.size(); while(left < right) { final int mid = (left + right) >>> 1; final double curd = iter.seek...
[ "protected", "static", "void", "binarySearch", "(", "ModifiableDoubleDBIDList", "index", ",", "DoubleDBIDListIter", "iter", ",", "double", "val", ")", "{", "// Binary search. TODO: move this into the DoubleDBIDList class.", "int", "left", "=", "0", ",", "right", "=", "i...
Seek an iterator to the desired position, using binary search. @param index Index to search @param iter Iterator @param val Distance to search to
[ "Seek", "an", "iterator", "to", "the", "desired", "position", "using", "binary", "search", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/index/idistance/InMemoryIDistanceIndex.java#L277-L298
63,282
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/workflow/AlgorithmStep.java
AlgorithmStep.runAlgorithms
public Result runAlgorithms(Database database) { ResultHierarchy hier = database.getHierarchy(); if(LOG.isStatistics()) { boolean first = true; for(It<Index> it = hier.iterDescendants(database).filter(Index.class); it.valid(); it.advance()) { if(first) { LOG.statistics("Index stati...
java
public Result runAlgorithms(Database database) { ResultHierarchy hier = database.getHierarchy(); if(LOG.isStatistics()) { boolean first = true; for(It<Index> it = hier.iterDescendants(database).filter(Index.class); it.valid(); it.advance()) { if(first) { LOG.statistics("Index stati...
[ "public", "Result", "runAlgorithms", "(", "Database", "database", ")", "{", "ResultHierarchy", "hier", "=", "database", ".", "getHierarchy", "(", ")", ";", "if", "(", "LOG", ".", "isStatistics", "(", ")", ")", "{", "boolean", "first", "=", "true", ";", "...
Run algorithms. @param database Database @return Algorithm result
[ "Run", "algorithms", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/workflow/AlgorithmStep.java#L84-L120
63,283
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/statistics/DistanceQuantileSampler.java
DistanceQuantileSampler.run
public CollectionResult<double[]> run(Database database, Relation<O> rel) { DistanceQuery<O> dq = rel.getDistanceQuery(getDistanceFunction()); int size = rel.size(); long pairs = (size * (long) size) >> 1; final long ssize = sampling <= 1 ? (long) Math.ceil(sampling * pairs) : (long) sampling; if(s...
java
public CollectionResult<double[]> run(Database database, Relation<O> rel) { DistanceQuery<O> dq = rel.getDistanceQuery(getDistanceFunction()); int size = rel.size(); long pairs = (size * (long) size) >> 1; final long ssize = sampling <= 1 ? (long) Math.ceil(sampling * pairs) : (long) sampling; if(s...
[ "public", "CollectionResult", "<", "double", "[", "]", ">", "run", "(", "Database", "database", ",", "Relation", "<", "O", ">", "rel", ")", "{", "DistanceQuery", "<", "O", ">", "dq", "=", "rel", ".", "getDistanceQuery", "(", "getDistanceFunction", "(", "...
Run the distance quantile sampler. @param database @param rel @return Distances sample
[ "Run", "the", "distance", "quantile", "sampler", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/statistics/DistanceQuantileSampler.java#L119-L155
63,284
elki-project/elki
elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/parser/NumberVectorLabelParser.java
NumberVectorLabelParser.parseLineInternal
protected boolean parseLineInternal() { // Split into numerical attributes and labels int i = 0; for(/* initialized by nextLineExceptComents()! */; tokenizer.valid(); tokenizer.advance(), i++) { if(!isLabelColumn(i) && !tokenizer.isQuoted()) { try { attributes.add(tokenizer.getDouble...
java
protected boolean parseLineInternal() { // Split into numerical attributes and labels int i = 0; for(/* initialized by nextLineExceptComents()! */; tokenizer.valid(); tokenizer.advance(), i++) { if(!isLabelColumn(i) && !tokenizer.isQuoted()) { try { attributes.add(tokenizer.getDouble...
[ "protected", "boolean", "parseLineInternal", "(", ")", "{", "// Split into numerical attributes and labels", "int", "i", "=", "0", ";", "for", "(", "/* initialized by nextLineExceptComents()! */", ";", "tokenizer", ".", "valid", "(", ")", ";", "tokenizer", ".", "advan...
Internal method for parsing a single line. Used by both line based parsing as well as block parsing. This saves the building of meta data for each line. @return {@code true} when a valid line was read, {@code false} on a label row.
[ "Internal", "method", "for", "parsing", "a", "single", "line", ".", "Used", "by", "both", "line", "based", "parsing", "as", "well", "as", "block", "parsing", ".", "This", "saves", "the", "building", "of", "meta", "data", "for", "each", "line", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/parser/NumberVectorLabelParser.java#L276-L316
63,285
elki-project/elki
elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/parser/NumberVectorLabelParser.java
NumberVectorLabelParser.getTypeInformation
SimpleTypeInformation<V> getTypeInformation(int mindim, int maxdim) { if(mindim > maxdim) { throw new AbortException("No vectors were read from the input file - cannot determine vector data type."); } if(mindim == maxdim) { String[] colnames = null; if(columnnames != null && mindim <= colu...
java
SimpleTypeInformation<V> getTypeInformation(int mindim, int maxdim) { if(mindim > maxdim) { throw new AbortException("No vectors were read from the input file - cannot determine vector data type."); } if(mindim == maxdim) { String[] colnames = null; if(columnnames != null && mindim <= colu...
[ "SimpleTypeInformation", "<", "V", ">", "getTypeInformation", "(", "int", "mindim", ",", "int", "maxdim", ")", "{", "if", "(", "mindim", ">", "maxdim", ")", "{", "throw", "new", "AbortException", "(", "\"No vectors were read from the input file - cannot determine vect...
Get a prototype object for the given dimensionality. @param mindim Minimum dimensionality @param maxdim Maximum dimensionality @return Prototype object
[ "Get", "a", "prototype", "object", "for", "the", "given", "dimensionality", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/parser/NumberVectorLabelParser.java#L334-L358
63,286
elki-project/elki
elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/knn/MaterializeKNNAndRKNNPreprocessor.java
MaterializeKNNAndRKNNPreprocessor.materializeKNNAndRKNNs
private void materializeKNNAndRKNNs(ArrayDBIDs ids, FiniteProgress progress) { // add an empty list to each rknn for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { if(materialized_RkNN.get(iter) == null) { materialized_RkNN.put(iter, new TreeSet<DoubleDBIDPair>()); } } ...
java
private void materializeKNNAndRKNNs(ArrayDBIDs ids, FiniteProgress progress) { // add an empty list to each rknn for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { if(materialized_RkNN.get(iter) == null) { materialized_RkNN.put(iter, new TreeSet<DoubleDBIDPair>()); } } ...
[ "private", "void", "materializeKNNAndRKNNs", "(", "ArrayDBIDs", "ids", ",", "FiniteProgress", "progress", ")", "{", "// add an empty list to each rknn", "for", "(", "DBIDIter", "iter", "=", "ids", ".", "iter", "(", ")", ";", "iter", ".", "valid", "(", ")", ";"...
Materializes the kNNs and RkNNs of the specified object IDs. @param ids the IDs of the objects
[ "Materializes", "the", "kNNs", "and", "RkNNs", "of", "the", "specified", "object", "IDs", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/knn/MaterializeKNNAndRKNNPreprocessor.java#L95-L115
63,287
elki-project/elki
elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/knn/MaterializeKNNAndRKNNPreprocessor.java
MaterializeKNNAndRKNNPreprocessor.getRKNN
public DoubleDBIDList getRKNN(DBIDRef id) { TreeSet<DoubleDBIDPair> rKNN = materialized_RkNN.get(id); if(rKNN == null) { return null; } ModifiableDoubleDBIDList ret = DBIDUtil.newDistanceDBIDList(rKNN.size()); for(DoubleDBIDPair pair : rKNN) { ret.add(pair); } ret.sort(); ret...
java
public DoubleDBIDList getRKNN(DBIDRef id) { TreeSet<DoubleDBIDPair> rKNN = materialized_RkNN.get(id); if(rKNN == null) { return null; } ModifiableDoubleDBIDList ret = DBIDUtil.newDistanceDBIDList(rKNN.size()); for(DoubleDBIDPair pair : rKNN) { ret.add(pair); } ret.sort(); ret...
[ "public", "DoubleDBIDList", "getRKNN", "(", "DBIDRef", "id", ")", "{", "TreeSet", "<", "DoubleDBIDPair", ">", "rKNN", "=", "materialized_RkNN", ".", "get", "(", "id", ")", ";", "if", "(", "rKNN", "==", "null", ")", "{", "return", "null", ";", "}", "Mod...
Returns the materialized RkNNs of the specified id. @param id the query id @return the RkNNs
[ "Returns", "the", "materialized", "RkNNs", "of", "the", "specified", "id", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/knn/MaterializeKNNAndRKNNPreprocessor.java#L335-L346
63,288
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/CFTree.java
CFTree.insert
public void insert(NumberVector nv) { final int dim = nv.getDimensionality(); // No root created yet: if(root == null) { ClusteringFeature leaf = new ClusteringFeature(dim); leaf.addToStatistics(nv); root = new TreeNode(dim, capacity); root.children[0] = leaf; root.addToStatist...
java
public void insert(NumberVector nv) { final int dim = nv.getDimensionality(); // No root created yet: if(root == null) { ClusteringFeature leaf = new ClusteringFeature(dim); leaf.addToStatistics(nv); root = new TreeNode(dim, capacity); root.children[0] = leaf; root.addToStatist...
[ "public", "void", "insert", "(", "NumberVector", "nv", ")", "{", "final", "int", "dim", "=", "nv", ".", "getDimensionality", "(", ")", ";", "// No root created yet:", "if", "(", "root", "==", "null", ")", "{", "ClusteringFeature", "leaf", "=", "new", "Clus...
Insert a data point into the tree. @param nv Object data
[ "Insert", "a", "data", "point", "into", "the", "tree", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/CFTree.java#L143-L163
63,289
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/CFTree.java
CFTree.rebuildTree
protected void rebuildTree() { final int dim = root.getDimensionality(); double t = estimateThreshold(root) / leaves; t *= t; // Never decrease the threshold. thresholdsq = t > thresholdsq ? t : thresholdsq; LOG.debug("New squared threshold: " + thresholdsq); LeafIterator iter = new LeafIte...
java
protected void rebuildTree() { final int dim = root.getDimensionality(); double t = estimateThreshold(root) / leaves; t *= t; // Never decrease the threshold. thresholdsq = t > thresholdsq ? t : thresholdsq; LOG.debug("New squared threshold: " + thresholdsq); LeafIterator iter = new LeafIte...
[ "protected", "void", "rebuildTree", "(", ")", "{", "final", "int", "dim", "=", "root", ".", "getDimensionality", "(", ")", ";", "double", "t", "=", "estimateThreshold", "(", "root", ")", "/", "leaves", ";", "t", "*=", "t", ";", "// Never decrease the thres...
Rebuild the CFTree to condense it to approximately half the size.
[ "Rebuild", "the", "CFTree", "to", "condense", "it", "to", "approximately", "half", "the", "size", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/CFTree.java#L168-L196
63,290
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/CFTree.java
CFTree.insert
private TreeNode insert(TreeNode node, NumberVector nv) { // Find closest child: ClusteringFeature[] cfs = node.children; assert (cfs[0] != null) : "Unexpected empty node!"; // Find the best child: ClusteringFeature best = cfs[0]; double bestd = distance.squaredDistance(nv, best); for(int i...
java
private TreeNode insert(TreeNode node, NumberVector nv) { // Find closest child: ClusteringFeature[] cfs = node.children; assert (cfs[0] != null) : "Unexpected empty node!"; // Find the best child: ClusteringFeature best = cfs[0]; double bestd = distance.squaredDistance(nv, best); for(int i...
[ "private", "TreeNode", "insert", "(", "TreeNode", "node", ",", "NumberVector", "nv", ")", "{", "// Find closest child:", "ClusteringFeature", "[", "]", "cfs", "=", "node", ".", "children", ";", "assert", "(", "cfs", "[", "0", "]", "!=", "null", ")", ":", ...
Recursive insertion. @param node Current node @param nv Object data @return New sibling, if the node was split.
[ "Recursive", "insertion", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/CFTree.java#L253-L297
63,291
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/CFTree.java
CFTree.add
private boolean add(ClusteringFeature[] children, ClusteringFeature child) { for(int i = 0; i < children.length; i++) { if(children[i] == null) { children[i] = child; return true; } } return false; }
java
private boolean add(ClusteringFeature[] children, ClusteringFeature child) { for(int i = 0; i < children.length; i++) { if(children[i] == null) { children[i] = child; return true; } } return false; }
[ "private", "boolean", "add", "(", "ClusteringFeature", "[", "]", "children", ",", "ClusteringFeature", "child", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "if", "(", "children", "["...
Add a node to the first unused slot. @param children Children list @param child Child to add @return {@code false} if node is full
[ "Add", "a", "node", "to", "the", "first", "unused", "slot", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/CFTree.java#L472-L480
63,292
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/CFTree.java
CFTree.printDebug
protected StringBuilder printDebug(StringBuilder buf, ClusteringFeature n, int d) { FormatUtil.appendSpace(buf, d).append(n.n); for(int i = 0; i < n.getDimensionality(); i++) { buf.append(' ').append(n.centroid(i)); } buf.append(" - ").append(n.n).append('\n'); if(n instanceof TreeNode) { ...
java
protected StringBuilder printDebug(StringBuilder buf, ClusteringFeature n, int d) { FormatUtil.appendSpace(buf, d).append(n.n); for(int i = 0; i < n.getDimensionality(); i++) { buf.append(' ').append(n.centroid(i)); } buf.append(" - ").append(n.n).append('\n'); if(n instanceof TreeNode) { ...
[ "protected", "StringBuilder", "printDebug", "(", "StringBuilder", "buf", ",", "ClusteringFeature", "n", ",", "int", "d", ")", "{", "FormatUtil", ".", "appendSpace", "(", "buf", ",", "d", ")", ".", "append", "(", "n", ".", "n", ")", ";", "for", "(", "in...
Utility function for debugging. @param buf Output buffer @param n Current node @param d Depth @return Output buffer
[ "Utility", "function", "for", "debugging", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/CFTree.java#L577-L593
63,293
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/StudentsTDistribution.java
StudentsTDistribution.cdf
public static double cdf(double val, int v) { double x = v / (val * val + v); return 1 - (0.5 * BetaDistribution.regularizedIncBeta(x, v * .5, 0.5)); }
java
public static double cdf(double val, int v) { double x = v / (val * val + v); return 1 - (0.5 * BetaDistribution.regularizedIncBeta(x, v * .5, 0.5)); }
[ "public", "static", "double", "cdf", "(", "double", "val", ",", "int", "v", ")", "{", "double", "x", "=", "v", "/", "(", "val", "*", "val", "+", "v", ")", ";", "return", "1", "-", "(", "0.5", "*", "BetaDistribution", ".", "regularizedIncBeta", "(",...
Static version of the CDF of the t-distribution for t &gt; 0 @param val value to evaluate @param v degrees of freedom @return F(val, v)
[ "Static", "version", "of", "the", "CDF", "of", "the", "t", "-", "distribution", "for", "t", "&gt", ";", "0" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/StudentsTDistribution.java#L136-L139
63,294
elki-project/elki
elki-timeseries/src/main/java/de/lmu/ifi/dbs/elki/algorithm/timeseries/ChangePoints.java
ChangePoints.add
public void add(DBIDRef iter, int column, double score) { changepoints.add(new ChangePoint(iter, column, score)); }
java
public void add(DBIDRef iter, int column, double score) { changepoints.add(new ChangePoint(iter, column, score)); }
[ "public", "void", "add", "(", "DBIDRef", "iter", ",", "int", "column", ",", "double", "score", ")", "{", "changepoints", ".", "add", "(", "new", "ChangePoint", "(", "iter", ",", "column", ",", "score", ")", ")", ";", "}" ]
Add a change point to the result. @param iter Time reference @param column Column @param score Score
[ "Add", "a", "change", "point", "to", "the", "result", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-timeseries/src/main/java/de/lmu/ifi/dbs/elki/algorithm/timeseries/ChangePoints.java#L75-L77
63,295
elki-project/elki
elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/spatial/PolygonsObject.java
PolygonsObject.appendToBuffer
public void appendToBuffer(StringBuilder buf) { Iterator<Polygon> iter = polygons.iterator(); while(iter.hasNext()) { Polygon poly = iter.next(); poly.appendToBuffer(buf); if(iter.hasNext()) { buf.append(" -- "); } } }
java
public void appendToBuffer(StringBuilder buf) { Iterator<Polygon> iter = polygons.iterator(); while(iter.hasNext()) { Polygon poly = iter.next(); poly.appendToBuffer(buf); if(iter.hasNext()) { buf.append(" -- "); } } }
[ "public", "void", "appendToBuffer", "(", "StringBuilder", "buf", ")", "{", "Iterator", "<", "Polygon", ">", "iter", "=", "polygons", ".", "iterator", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "{", "Polygon", "poly", "=", "iter...
Append polygons to the buffer. @param buf Buffer to append to
[ "Append", "polygons", "to", "the", "buffer", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/spatial/PolygonsObject.java#L80-L89
63,296
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/Tokenizer.java
Tokenizer.initialize
public void initialize(CharSequence input, int begin, int end) { this.input = input; this.send = end; this.matcher.reset(input).region(begin, end); this.index = begin; advance(); }
java
public void initialize(CharSequence input, int begin, int end) { this.input = input; this.send = end; this.matcher.reset(input).region(begin, end); this.index = begin; advance(); }
[ "public", "void", "initialize", "(", "CharSequence", "input", ",", "int", "begin", ",", "int", "end", ")", "{", "this", ".", "input", "=", "input", ";", "this", ".", "send", "=", "end", ";", "this", ".", "matcher", ".", "reset", "(", "input", ")", ...
Initialize parser with a new string. @param input New string to parse. @param begin Begin @param end End
[ "Initialize", "parser", "with", "a", "new", "string", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/Tokenizer.java#L96-L102
63,297
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/Tokenizer.java
Tokenizer.getStrippedSubstring
public String getStrippedSubstring() { // TODO: detect Java <6 and make sure we only return the substring? // With java 7, String.substring will arraycopy the characters. int sstart = start, send = end; while(sstart < send) { char c = input.charAt(sstart); if(c != ' ' || c != '\n' || c != '\...
java
public String getStrippedSubstring() { // TODO: detect Java <6 and make sure we only return the substring? // With java 7, String.substring will arraycopy the characters. int sstart = start, send = end; while(sstart < send) { char c = input.charAt(sstart); if(c != ' ' || c != '\n' || c != '\...
[ "public", "String", "getStrippedSubstring", "(", ")", "{", "// TODO: detect Java <6 and make sure we only return the substring?", "// With java 7, String.substring will arraycopy the characters.", "int", "sstart", "=", "start", ",", "send", "=", "end", ";", "while", "(", "sstar...
Get the current part as substring @return Current value as substring.
[ "Get", "the", "current", "part", "as", "substring" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/Tokenizer.java#L168-L187
63,298
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/Tokenizer.java
Tokenizer.isQuote
private char isQuote(int index) { if(index >= input.length()) { return 0; } char c = input.charAt(index); for(int i = 0; i < quoteChars.length; i++) { if(c == quoteChars[i]) { return c; } } return 0; }
java
private char isQuote(int index) { if(index >= input.length()) { return 0; } char c = input.charAt(index); for(int i = 0; i < quoteChars.length; i++) { if(c == quoteChars[i]) { return c; } } return 0; }
[ "private", "char", "isQuote", "(", "int", "index", ")", "{", "if", "(", "index", ">=", "input", ".", "length", "(", ")", ")", "{", "return", "0", ";", "}", "char", "c", "=", "input", ".", "charAt", "(", "index", ")", ";", "for", "(", "int", "i"...
Detect quote characters. TODO: support more than one quote character, make sure opening and closing quotes match then. @param index Position @return {@code 1} when a quote character, {@code 0} otherwise.
[ "Detect", "quote", "characters", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/Tokenizer.java#L237-L248
63,299
elki-project/elki
elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/datastore/DataStoreUtil.java
DataStoreUtil.makeRecordStorage
public static WritableRecordStore makeRecordStorage(DBIDs ids, int hints, Class<?>... dataclasses) { return DataStoreFactory.FACTORY.makeRecordStorage(ids, hints, dataclasses); }
java
public static WritableRecordStore makeRecordStorage(DBIDs ids, int hints, Class<?>... dataclasses) { return DataStoreFactory.FACTORY.makeRecordStorage(ids, hints, dataclasses); }
[ "public", "static", "WritableRecordStore", "makeRecordStorage", "(", "DBIDs", "ids", ",", "int", "hints", ",", "Class", "<", "?", ">", "...", "dataclasses", ")", "{", "return", "DataStoreFactory", ".", "FACTORY", ".", "makeRecordStorage", "(", "ids", ",", "hin...
Make a new record storage, to associate the given ids with an object of class dataclass. @param ids DBIDs to store data for @param hints Hints for the storage manager @param dataclasses classes to store @return new record store
[ "Make", "a", "new", "record", "storage", "to", "associate", "the", "given", "ids", "with", "an", "object", "of", "class", "dataclass", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/datastore/DataStoreUtil.java#L138-L140