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,500
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/trivial/ByLabelClustering.java
ByLabelClustering.singleAssignment
private HashMap<String, DBIDs> singleAssignment(Relation<?> data) { HashMap<String, DBIDs> labelMap = new HashMap<>(); for(DBIDIter iditer = data.iterDBIDs(); iditer.valid(); iditer.advance()) { final Object val = data.get(iditer); String label = (val != null) ? val.toString() : null; assign(...
java
private HashMap<String, DBIDs> singleAssignment(Relation<?> data) { HashMap<String, DBIDs> labelMap = new HashMap<>(); for(DBIDIter iditer = data.iterDBIDs(); iditer.valid(); iditer.advance()) { final Object val = data.get(iditer); String label = (val != null) ? val.toString() : null; assign(...
[ "private", "HashMap", "<", "String", ",", "DBIDs", ">", "singleAssignment", "(", "Relation", "<", "?", ">", "data", ")", "{", "HashMap", "<", "String", ",", "DBIDs", ">", "labelMap", "=", "new", "HashMap", "<>", "(", ")", ";", "for", "(", "DBIDIter", ...
Assigns the objects of the database to single clusters according to their labels. @param data the database storing the objects @return a mapping of labels to ids
[ "Assigns", "the", "objects", "of", "the", "database", "to", "single", "clusters", "according", "to", "their", "labels", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/trivial/ByLabelClustering.java#L167-L176
63,501
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/trivial/ByLabelClustering.java
ByLabelClustering.multipleAssignment
private HashMap<String, DBIDs> multipleAssignment(Relation<?> data) { HashMap<String, DBIDs> labelMap = new HashMap<>(); for(DBIDIter iditer = data.iterDBIDs(); iditer.valid(); iditer.advance()) { String[] labels = data.get(iditer).toString().split(" "); for(String label : labels) { assign(...
java
private HashMap<String, DBIDs> multipleAssignment(Relation<?> data) { HashMap<String, DBIDs> labelMap = new HashMap<>(); for(DBIDIter iditer = data.iterDBIDs(); iditer.valid(); iditer.advance()) { String[] labels = data.get(iditer).toString().split(" "); for(String label : labels) { assign(...
[ "private", "HashMap", "<", "String", ",", "DBIDs", ">", "multipleAssignment", "(", "Relation", "<", "?", ">", "data", ")", "{", "HashMap", "<", "String", ",", "DBIDs", ">", "labelMap", "=", "new", "HashMap", "<>", "(", ")", ";", "for", "(", "DBIDIter",...
Assigns the objects of the database to multiple clusters according to their labels. @param data the database storing the objects @return a mapping of labels to ids
[ "Assigns", "the", "objects", "of", "the", "database", "to", "multiple", "clusters", "according", "to", "their", "labels", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/trivial/ByLabelClustering.java#L185-L195
63,502
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/trivial/ByLabelClustering.java
ByLabelClustering.assign
private void assign(HashMap<String, DBIDs> labelMap, String label, DBIDRef id) { if(labelMap.containsKey(label)) { DBIDs exist = labelMap.get(label); if(exist instanceof DBID) { ModifiableDBIDs n = DBIDUtil.newHashSet(); n.add((DBID) exist); n.add(id); labelMap.put(label,...
java
private void assign(HashMap<String, DBIDs> labelMap, String label, DBIDRef id) { if(labelMap.containsKey(label)) { DBIDs exist = labelMap.get(label); if(exist instanceof DBID) { ModifiableDBIDs n = DBIDUtil.newHashSet(); n.add((DBID) exist); n.add(id); labelMap.put(label,...
[ "private", "void", "assign", "(", "HashMap", "<", "String", ",", "DBIDs", ">", "labelMap", ",", "String", "label", ",", "DBIDRef", "id", ")", "{", "if", "(", "labelMap", ".", "containsKey", "(", "label", ")", ")", "{", "DBIDs", "exist", "=", "labelMap"...
Assigns the specified id to the labelMap according to its label @param labelMap the mapping of label to ids @param label the label of the object to be assigned @param id the id of the object to be assigned
[ "Assigns", "the", "specified", "id", "to", "the", "labelMap", "according", "to", "its", "label" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/trivial/ByLabelClustering.java#L204-L222
63,503
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/DoubleMinMax.java
DoubleMinMax.put
public void put(double val) { min = val < min ? val : min; max = val > max ? val : max; }
java
public void put(double val) { min = val < min ? val : min; max = val > max ? val : max; }
[ "public", "void", "put", "(", "double", "val", ")", "{", "min", "=", "val", "<", "min", "?", "val", ":", "min", ";", "max", "=", "val", ">", "max", "?", "val", ":", "max", ";", "}" ]
Process a single double value. If the new value is smaller than the current minimum, it will become the new minimum. If the new value is larger than the current maximum, it will become the new maximum. @param val New value
[ "Process", "a", "single", "double", "value", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/DoubleMinMax.java#L73-L76
63,504
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGEffects.java
SVGEffects.addShadowFilter
public static void addShadowFilter(SVGPlot svgp) { Element shadow = svgp.getIdElement(SHADOW_ID); if(shadow == null) { shadow = svgp.svgElement(SVGConstants.SVG_FILTER_TAG); shadow.setAttribute(SVGConstants.SVG_ID_ATTRIBUTE, SHADOW_ID); shadow.setAttribute(SVGConstants.SVG_WIDTH_ATTRIBUTE, "14...
java
public static void addShadowFilter(SVGPlot svgp) { Element shadow = svgp.getIdElement(SHADOW_ID); if(shadow == null) { shadow = svgp.svgElement(SVGConstants.SVG_FILTER_TAG); shadow.setAttribute(SVGConstants.SVG_ID_ATTRIBUTE, SHADOW_ID); shadow.setAttribute(SVGConstants.SVG_WIDTH_ATTRIBUTE, "14...
[ "public", "static", "void", "addShadowFilter", "(", "SVGPlot", "svgp", ")", "{", "Element", "shadow", "=", "svgp", ".", "getIdElement", "(", "SHADOW_ID", ")", ";", "if", "(", "shadow", "==", "null", ")", "{", "shadow", "=", "svgp", ".", "svgElement", "("...
Static method to prepare a SVG document for drop shadow effects. Invoke this from an appropriate update thread! @param svgp Plot to prepare
[ "Static", "method", "to", "prepare", "a", "SVG", "document", "for", "drop", "shadow", "effects", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGEffects.java#L57-L87
63,505
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGEffects.java
SVGEffects.addLightGradient
public static void addLightGradient(SVGPlot svgp) { Element gradient = svgp.getIdElement(LIGHT_GRADIENT_ID); if(gradient == null) { gradient = svgp.svgElement(SVGConstants.SVG_LINEAR_GRADIENT_TAG); gradient.setAttribute(SVGConstants.SVG_ID_ATTRIBUTE, LIGHT_GRADIENT_ID); gradient.setAttribute(S...
java
public static void addLightGradient(SVGPlot svgp) { Element gradient = svgp.getIdElement(LIGHT_GRADIENT_ID); if(gradient == null) { gradient = svgp.svgElement(SVGConstants.SVG_LINEAR_GRADIENT_TAG); gradient.setAttribute(SVGConstants.SVG_ID_ATTRIBUTE, LIGHT_GRADIENT_ID); gradient.setAttribute(S...
[ "public", "static", "void", "addLightGradient", "(", "SVGPlot", "svgp", ")", "{", "Element", "gradient", "=", "svgp", ".", "getIdElement", "(", "LIGHT_GRADIENT_ID", ")", ";", "if", "(", "gradient", "==", "null", ")", "{", "gradient", "=", "svgp", ".", "svg...
Static method to prepare a SVG document for light gradient effects. Invoke this from an appropriate update thread! @param svgp Plot to prepare
[ "Static", "method", "to", "prepare", "a", "SVG", "document", "for", "light", "gradient", "effects", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGEffects.java#L96-L133
63,506
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGEffects.java
SVGEffects.makeCheckmark
public static Element makeCheckmark(SVGPlot svgp) { Element checkmark = svgp.svgElement(SVGConstants.SVG_PATH_TAG); checkmark.setAttribute(SVGConstants.SVG_D_ATTRIBUTE, SVG_CHECKMARK_PATH); checkmark.setAttribute(SVGConstants.SVG_FILL_ATTRIBUTE, SVGConstants.CSS_BLACK_VALUE); checkmark.setAttribute(SVGC...
java
public static Element makeCheckmark(SVGPlot svgp) { Element checkmark = svgp.svgElement(SVGConstants.SVG_PATH_TAG); checkmark.setAttribute(SVGConstants.SVG_D_ATTRIBUTE, SVG_CHECKMARK_PATH); checkmark.setAttribute(SVGConstants.SVG_FILL_ATTRIBUTE, SVGConstants.CSS_BLACK_VALUE); checkmark.setAttribute(SVGC...
[ "public", "static", "Element", "makeCheckmark", "(", "SVGPlot", "svgp", ")", "{", "Element", "checkmark", "=", "svgp", ".", "svgElement", "(", "SVGConstants", ".", "SVG_PATH_TAG", ")", ";", "checkmark", ".", "setAttribute", "(", "SVGConstants", ".", "SVG_D_ATTRI...
Creates a 15x15 big checkmark @param svgp Plot to create the element for @return Element
[ "Creates", "a", "15x15", "big", "checkmark" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGEffects.java#L146-L152
63,507
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/CanvasSize.java
CanvasSize.continueToMargin
public double continueToMargin(double[] origin, double[] delta) { assert (delta.length == 2 && origin.length == 2); double factor = Double.POSITIVE_INFINITY; if(delta[0] > 0) { factor = Math.min(factor, (maxx - origin[0]) / delta[0]); } else if(delta[0] < 0) { factor = Math.min(factor, (...
java
public double continueToMargin(double[] origin, double[] delta) { assert (delta.length == 2 && origin.length == 2); double factor = Double.POSITIVE_INFINITY; if(delta[0] > 0) { factor = Math.min(factor, (maxx - origin[0]) / delta[0]); } else if(delta[0] < 0) { factor = Math.min(factor, (...
[ "public", "double", "continueToMargin", "(", "double", "[", "]", "origin", ",", "double", "[", "]", "delta", ")", "{", "assert", "(", "delta", ".", "length", "==", "2", "&&", "origin", ".", "length", "==", "2", ")", ";", "double", "factor", "=", "Dou...
Continue a line along a given direction to the margin. @param origin Origin point @param delta Direction vector @return scaling factor for delta vector
[ "Continue", "a", "line", "along", "a", "given", "direction", "to", "the", "margin", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/projections/CanvasSize.java#L116-L132
63,508
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/PersistentPageFile.java
PersistentPageFile.clear
@Override public void clear() { try { file.setLength(header.size()); } catch(IOException e) { throw new RuntimeException(e); } }
java
@Override public void clear() { try { file.setLength(header.size()); } catch(IOException e) { throw new RuntimeException(e); } }
[ "@", "Override", "public", "void", "clear", "(", ")", "{", "try", "{", "file", ".", "setLength", "(", "header", ".", "size", "(", ")", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "RuntimeException", "(", "e", ")", ";"...
Clears this PageFile.
[ "Clears", "this", "PageFile", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/PersistentPageFile.java#L195-L203
63,509
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/LMCLUS.java
LMCLUS.deviation
private double deviation(double[] delta, double[][] beta) { final double a = squareSum(delta); final double b = squareSum(transposeTimes(beta, delta)); return (a > b) ? FastMath.sqrt(a - b) : 0.; }
java
private double deviation(double[] delta, double[][] beta) { final double a = squareSum(delta); final double b = squareSum(transposeTimes(beta, delta)); return (a > b) ? FastMath.sqrt(a - b) : 0.; }
[ "private", "double", "deviation", "(", "double", "[", "]", "delta", ",", "double", "[", "]", "[", "]", "beta", ")", "{", "final", "double", "a", "=", "squareSum", "(", "delta", ")", ";", "final", "double", "b", "=", "squareSum", "(", "transposeTimes", ...
Deviation from a manifold described by beta. @param delta Delta from origin vector @param beta Manifold @return Deviation score
[ "Deviation", "from", "a", "manifold", "described", "by", "beta", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/LMCLUS.java#L247-L252
63,510
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/LMCLUS.java
LMCLUS.findSeparation
private Separation findSeparation(Relation<NumberVector> relation, DBIDs currentids, int dimension, Random r) { Separation separation = new Separation(); // determine the number of samples needed, to secure that with a specific // probability // in at least on sample every sampled point is from the same...
java
private Separation findSeparation(Relation<NumberVector> relation, DBIDs currentids, int dimension, Random r) { Separation separation = new Separation(); // determine the number of samples needed, to secure that with a specific // probability // in at least on sample every sampled point is from the same...
[ "private", "Separation", "findSeparation", "(", "Relation", "<", "NumberVector", ">", "relation", ",", "DBIDs", "currentids", ",", "int", "dimension", ",", "Random", "r", ")", "{", "Separation", "separation", "=", "new", "Separation", "(", ")", ";", "// determ...
This method samples a number of linear manifolds an tries to determine which the one with the best cluster is. <PRE> A number of sample points according to the dimension of the linear manifold are taken. The basis (B) and the origin(o) of the manifold are calculated. A distance histogram using the distance function |...
[ "This", "method", "samples", "a", "number", "of", "linear", "manifolds", "an", "tries", "to", "determine", "which", "the", "one", "with", "the", "best", "cluster", "is", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/LMCLUS.java#L274-L328
63,511
elki-project/elki
elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/similarityfunction/kernel/KernelMatrix.java
KernelMatrix.getDistance
public double getDistance(final DBIDRef o1, final DBIDRef o2) { return FastMath.sqrt(getSquaredDistance(o1, o2)); }
java
public double getDistance(final DBIDRef o1, final DBIDRef o2) { return FastMath.sqrt(getSquaredDistance(o1, o2)); }
[ "public", "double", "getDistance", "(", "final", "DBIDRef", "o1", ",", "final", "DBIDRef", "o2", ")", "{", "return", "FastMath", ".", "sqrt", "(", "getSquaredDistance", "(", "o1", ",", "o2", ")", ")", ";", "}" ]
Returns the kernel distance between the two specified objects. @param o1 first ObjectID @param o2 second ObjectID @return the distance between the two objects
[ "Returns", "the", "kernel", "distance", "between", "the", "two", "specified", "objects", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/similarityfunction/kernel/KernelMatrix.java#L209-L211
63,512
elki-project/elki
elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/similarityfunction/kernel/KernelMatrix.java
KernelMatrix.getSquaredDistance
public double getSquaredDistance(final DBIDRef id1, final DBIDRef id2) { final int o1 = idmap.getOffset(id1), o2 = idmap.getOffset(id2); return kernel[o1][o1] + kernel[o2][o2] - 2 * kernel[o1][o2]; }
java
public double getSquaredDistance(final DBIDRef id1, final DBIDRef id2) { final int o1 = idmap.getOffset(id1), o2 = idmap.getOffset(id2); return kernel[o1][o1] + kernel[o2][o2] - 2 * kernel[o1][o2]; }
[ "public", "double", "getSquaredDistance", "(", "final", "DBIDRef", "id1", ",", "final", "DBIDRef", "id2", ")", "{", "final", "int", "o1", "=", "idmap", ".", "getOffset", "(", "id1", ")", ",", "o2", "=", "idmap", ".", "getOffset", "(", "id2", ")", ";", ...
Returns the squared kernel distance between the two specified objects. @param id1 first ObjectID @param id2 second ObjectID @return the distance between the two objects
[ "Returns", "the", "squared", "kernel", "distance", "between", "the", "two", "specified", "objects", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/similarityfunction/kernel/KernelMatrix.java#L229-L232
63,513
elki-project/elki
elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/similarityfunction/kernel/KernelMatrix.java
KernelMatrix.getSimilarity
public double getSimilarity(DBIDRef id1, DBIDRef id2) { return kernel[idmap.getOffset(id1)][idmap.getOffset(id2)]; }
java
public double getSimilarity(DBIDRef id1, DBIDRef id2) { return kernel[idmap.getOffset(id1)][idmap.getOffset(id2)]; }
[ "public", "double", "getSimilarity", "(", "DBIDRef", "id1", ",", "DBIDRef", "id2", ")", "{", "return", "kernel", "[", "idmap", ".", "getOffset", "(", "id1", ")", "]", "[", "idmap", ".", "getOffset", "(", "id2", ")", "]", ";", "}" ]
Get the kernel similarity for the given objects. @param id1 First object @param id2 Second object @return Similarity.
[ "Get", "the", "kernel", "similarity", "for", "the", "given", "objects", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/similarityfunction/kernel/KernelMatrix.java#L272-L274
63,514
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/AbstractKMeans.java
AbstractKMeans.initialMeans
protected double[][] initialMeans(Database database, Relation<V> relation) { Duration inittime = getLogger().newDuration(initializer.getClass() + ".time").begin(); double[][] means = initializer.chooseInitialMeans(database, relation, k, getDistanceFunction()); getLogger().statistics(inittime.end()); ret...
java
protected double[][] initialMeans(Database database, Relation<V> relation) { Duration inittime = getLogger().newDuration(initializer.getClass() + ".time").begin(); double[][] means = initializer.chooseInitialMeans(database, relation, k, getDistanceFunction()); getLogger().statistics(inittime.end()); ret...
[ "protected", "double", "[", "]", "[", "]", "initialMeans", "(", "Database", "database", ",", "Relation", "<", "V", ">", "relation", ")", "{", "Duration", "inittime", "=", "getLogger", "(", ")", ".", "newDuration", "(", "initializer", ".", "getClass", "(", ...
Choose the initial means. @param database Database @param relation Relation @return Means
[ "Choose", "the", "initial", "means", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/AbstractKMeans.java#L122-L127
63,515
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/AbstractKMeans.java
AbstractKMeans.plusEquals
public static void plusEquals(double[] sum, NumberVector vec) { for(int d = 0; d < sum.length; d++) { sum[d] += vec.doubleValue(d); } }
java
public static void plusEquals(double[] sum, NumberVector vec) { for(int d = 0; d < sum.length; d++) { sum[d] += vec.doubleValue(d); } }
[ "public", "static", "void", "plusEquals", "(", "double", "[", "]", "sum", ",", "NumberVector", "vec", ")", "{", "for", "(", "int", "d", "=", "0", ";", "d", "<", "sum", ".", "length", ";", "d", "++", ")", "{", "sum", "[", "d", "]", "+=", "vec", ...
Similar to VMath.plusEquals, but accepts a number vector. @param sum Aggregation array @param vec Vector to add
[ "Similar", "to", "VMath", ".", "plusEquals", "but", "accepts", "a", "number", "vector", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/AbstractKMeans.java#L183-L187
63,516
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/AbstractKMeans.java
AbstractKMeans.minusEquals
public static void minusEquals(double[] sum, NumberVector vec) { for(int d = 0; d < sum.length; d++) { sum[d] -= vec.doubleValue(d); } }
java
public static void minusEquals(double[] sum, NumberVector vec) { for(int d = 0; d < sum.length; d++) { sum[d] -= vec.doubleValue(d); } }
[ "public", "static", "void", "minusEquals", "(", "double", "[", "]", "sum", ",", "NumberVector", "vec", ")", "{", "for", "(", "int", "d", "=", "0", ";", "d", "<", "sum", ".", "length", ";", "d", "++", ")", "{", "sum", "[", "d", "]", "-=", "vec",...
Similar to VMath.minusEquals, but accepts a number vector. @param sum Aggregation array @param vec Vector to subtract
[ "Similar", "to", "VMath", ".", "minusEquals", "but", "accepts", "a", "number", "vector", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/AbstractKMeans.java#L195-L199
63,517
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/AbstractKMeans.java
AbstractKMeans.plusMinusEquals
public static void plusMinusEquals(double[] add, double[] sub, NumberVector vec) { for(int d = 0; d < add.length; d++) { final double v = vec.doubleValue(d); add[d] += v; sub[d] -= v; } }
java
public static void plusMinusEquals(double[] add, double[] sub, NumberVector vec) { for(int d = 0; d < add.length; d++) { final double v = vec.doubleValue(d); add[d] += v; sub[d] -= v; } }
[ "public", "static", "void", "plusMinusEquals", "(", "double", "[", "]", "add", ",", "double", "[", "]", "sub", ",", "NumberVector", "vec", ")", "{", "for", "(", "int", "d", "=", "0", ";", "d", "<", "add", ".", "length", ";", "d", "++", ")", "{", ...
Add to one, remove from another. @param add Array to add to @param sub Array to remove from @param vec Vector to subtract
[ "Add", "to", "one", "remove", "from", "another", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/AbstractKMeans.java#L208-L214
63,518
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/AbstractKMeans.java
AbstractKMeans.incrementalUpdateMean
protected static void incrementalUpdateMean(double[] mean, NumberVector vec, int newsize, double op) { if(newsize == 0) { return; // Keep old mean } // Note: numerically stabilized version: VMath.plusTimesEquals(mean, VMath.minusEquals(vec.toArray(), mean), op / newsize); }
java
protected static void incrementalUpdateMean(double[] mean, NumberVector vec, int newsize, double op) { if(newsize == 0) { return; // Keep old mean } // Note: numerically stabilized version: VMath.plusTimesEquals(mean, VMath.minusEquals(vec.toArray(), mean), op / newsize); }
[ "protected", "static", "void", "incrementalUpdateMean", "(", "double", "[", "]", "mean", ",", "NumberVector", "vec", ",", "int", "newsize", ",", "double", "op", ")", "{", "if", "(", "newsize", "==", "0", ")", "{", "return", ";", "// Keep old mean", "}", ...
Compute an incremental update for the mean. @param mean Mean to update @param vec Object vector @param newsize (New) size of cluster @param op Cluster size change / Weight change
[ "Compute", "an", "incremental", "update", "for", "the", "mean", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/AbstractKMeans.java#L278-L284
63,519
elki-project/elki
elki-index-lsh/src/main/java/de/lmu/ifi/dbs/elki/index/lsh/hashfunctions/MultipleProjectionsLocalitySensitiveHashFunction.java
MultipleProjectionsLocalitySensitiveHashFunction.fastModPrime
public static int fastModPrime(long data) { // Mix high and low 32 bit: int high = (int) (data >>> 32); // Use fast multiplication with 5 for high: int alpha = ((int) data) + (high << 2 + high); // Note that in Java, PRIME will be negative. if(alpha < 0 && alpha > -5) { alpha = alpha + 5; ...
java
public static int fastModPrime(long data) { // Mix high and low 32 bit: int high = (int) (data >>> 32); // Use fast multiplication with 5 for high: int alpha = ((int) data) + (high << 2 + high); // Note that in Java, PRIME will be negative. if(alpha < 0 && alpha > -5) { alpha = alpha + 5; ...
[ "public", "static", "int", "fastModPrime", "(", "long", "data", ")", "{", "// Mix high and low 32 bit:", "int", "high", "=", "(", "int", ")", "(", "data", ">>>", "32", ")", ";", "// Use fast multiplication with 5 for high:", "int", "alpha", "=", "(", "(", "int...
Fast modulo operation for the largest unsigned integer prime. @param data Long input @return {@code data % (2^32 - 5)}.
[ "Fast", "modulo", "operation", "for", "the", "largest", "unsigned", "integer", "prime", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-lsh/src/main/java/de/lmu/ifi/dbs/elki/index/lsh/hashfunctions/MultipleProjectionsLocalitySensitiveHashFunction.java#L127-L137
63,520
elki-project/elki
elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/query/MTreeRangeQuery.java
MTreeRangeQuery.doRangeQuery
private void doRangeQuery(DBID o_p, AbstractMTreeNode<O, ?, ?> node, O q, double r_q, ModifiableDoubleDBIDList result) { double d1 = 0.; if(o_p != null) { d1 = distanceQuery.distance(o_p, q); index.statistics.countDistanceCalculation(); } if(!node.isLeaf()) { for(int i = 0; i < node.ge...
java
private void doRangeQuery(DBID o_p, AbstractMTreeNode<O, ?, ?> node, O q, double r_q, ModifiableDoubleDBIDList result) { double d1 = 0.; if(o_p != null) { d1 = distanceQuery.distance(o_p, q); index.statistics.countDistanceCalculation(); } if(!node.isLeaf()) { for(int i = 0; i < node.ge...
[ "private", "void", "doRangeQuery", "(", "DBID", "o_p", ",", "AbstractMTreeNode", "<", "O", ",", "?", ",", "?", ">", "node", ",", "O", "q", ",", "double", "r_q", ",", "ModifiableDoubleDBIDList", "result", ")", "{", "double", "d1", "=", "0.", ";", "if", ...
Performs a range query on the specified subtree. It recursively traverses all paths from the specified node, which cannot be excluded from leading to qualifying objects. @param o_p the routing object of the specified node @param node the root of the subtree to be traversed @param q the query object @param r_q the quer...
[ "Performs", "a", "range", "query", "on", "the", "specified", "subtree", ".", "It", "recursively", "traverses", "all", "paths", "from", "the", "specified", "node", "which", "cannot", "be", "excluded", "from", "leading", "to", "qualifying", "objects", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/query/MTreeRangeQuery.java#L70-L115
63,521
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GumbelDistribution.java
GumbelDistribution.pdf
public static double pdf(double x, double mu, double beta) { final double z = (x - mu) / beta; if(x == Double.NEGATIVE_INFINITY) { return 0.; } return FastMath.exp(-z - FastMath.exp(-z)) / beta; }
java
public static double pdf(double x, double mu, double beta) { final double z = (x - mu) / beta; if(x == Double.NEGATIVE_INFINITY) { return 0.; } return FastMath.exp(-z - FastMath.exp(-z)) / beta; }
[ "public", "static", "double", "pdf", "(", "double", "x", ",", "double", "mu", ",", "double", "beta", ")", "{", "final", "double", "z", "=", "(", "x", "-", "mu", ")", "/", "beta", ";", "if", "(", "x", "==", "Double", ".", "NEGATIVE_INFINITY", ")", ...
PDF of Gumbel distribution @param x Value @param mu Mode @param beta Shape @return PDF at position x.
[ "PDF", "of", "Gumbel", "distribution" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GumbelDistribution.java#L109-L115
63,522
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GumbelDistribution.java
GumbelDistribution.logpdf
public static double logpdf(double x, double mu, double beta) { if(x == Double.NEGATIVE_INFINITY) { return Double.NEGATIVE_INFINITY; } final double z = (x - mu) / beta; return -z - FastMath.exp(-z) - FastMath.log(beta); }
java
public static double logpdf(double x, double mu, double beta) { if(x == Double.NEGATIVE_INFINITY) { return Double.NEGATIVE_INFINITY; } final double z = (x - mu) / beta; return -z - FastMath.exp(-z) - FastMath.log(beta); }
[ "public", "static", "double", "logpdf", "(", "double", "x", ",", "double", "mu", ",", "double", "beta", ")", "{", "if", "(", "x", "==", "Double", ".", "NEGATIVE_INFINITY", ")", "{", "return", "Double", ".", "NEGATIVE_INFINITY", ";", "}", "final", "double...
log PDF of Gumbel distribution @param x Value @param mu Mode @param beta Shape @return PDF at position x.
[ "log", "PDF", "of", "Gumbel", "distribution" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GumbelDistribution.java#L130-L136
63,523
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GumbelDistribution.java
GumbelDistribution.cdf
public static double cdf(double val, double mu, double beta) { return FastMath.exp(-FastMath.exp(-(val - mu) / beta)); }
java
public static double cdf(double val, double mu, double beta) { return FastMath.exp(-FastMath.exp(-(val - mu) / beta)); }
[ "public", "static", "double", "cdf", "(", "double", "val", ",", "double", "mu", ",", "double", "beta", ")", "{", "return", "FastMath", ".", "exp", "(", "-", "FastMath", ".", "exp", "(", "-", "(", "val", "-", "mu", ")", "/", "beta", ")", ")", ";",...
CDF of Gumbel distribution @param val Value @param mu Mode @param beta Shape @return CDF at position x.
[ "CDF", "of", "Gumbel", "distribution" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GumbelDistribution.java#L151-L153
63,524
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GumbelDistribution.java
GumbelDistribution.quantile
public static double quantile(double val, double mu, double beta) { return mu - beta * FastMath.log(-FastMath.log(val)); }
java
public static double quantile(double val, double mu, double beta) { return mu - beta * FastMath.log(-FastMath.log(val)); }
[ "public", "static", "double", "quantile", "(", "double", "val", ",", "double", "mu", ",", "double", "beta", ")", "{", "return", "mu", "-", "beta", "*", "FastMath", ".", "log", "(", "-", "FastMath", ".", "log", "(", "val", ")", ")", ";", "}" ]
Quantile function of Gumbel distribution @param val Value @param mu Mode @param beta Shape @return Quantile function at position x.
[ "Quantile", "function", "of", "Gumbel", "distribution" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GumbelDistribution.java#L168-L170
63,525
elki-project/elki
elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/vafile/VAFile.java
VAFile.setPartitions
public void setPartitions(Relation<V> relation) throws IllegalArgumentException { if((FastMath.log(partitions) / FastMath.log(2)) != (int) (FastMath.log(partitions) / FastMath.log(2))) { throw new IllegalArgumentException("Number of partitions must be a power of 2!"); } final int dimensions = Relatio...
java
public void setPartitions(Relation<V> relation) throws IllegalArgumentException { if((FastMath.log(partitions) / FastMath.log(2)) != (int) (FastMath.log(partitions) / FastMath.log(2))) { throw new IllegalArgumentException("Number of partitions must be a power of 2!"); } final int dimensions = Relatio...
[ "public", "void", "setPartitions", "(", "Relation", "<", "V", ">", "relation", ")", "throws", "IllegalArgumentException", "{", "if", "(", "(", "FastMath", ".", "log", "(", "partitions", ")", "/", "FastMath", ".", "log", "(", "2", ")", ")", "!=", "(", "...
Initialize the data set grid by computing quantiles. @param relation Data relation @throws IllegalArgumentException
[ "Initialize", "the", "data", "set", "grid", "by", "computing", "quantiles", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/vafile/VAFile.java#L144-L169
63,526
elki-project/elki
elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/vafile/VAFile.java
VAFile.getScannedPages
public long getScannedPages() { int vacapacity = pageSize / VectorApproximation.byteOnDisk(splitPositions.length, partitions); long vasize = (long) Math.ceil((vectorApprox.size()) / (1.0 * vacapacity)); return vasize * scans; }
java
public long getScannedPages() { int vacapacity = pageSize / VectorApproximation.byteOnDisk(splitPositions.length, partitions); long vasize = (long) Math.ceil((vectorApprox.size()) / (1.0 * vacapacity)); return vasize * scans; }
[ "public", "long", "getScannedPages", "(", ")", "{", "int", "vacapacity", "=", "pageSize", "/", "VectorApproximation", ".", "byteOnDisk", "(", "splitPositions", ".", "length", ",", "partitions", ")", ";", "long", "vasize", "=", "(", "long", ")", "Math", ".", ...
Get the number of scanned bytes. @return Number of scanned bytes.
[ "Get", "the", "number", "of", "scanned", "bytes", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/vafile/VAFile.java#L212-L216
63,527
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/EigenvalueDecomposition.java
EigenvalueDecomposition.hqr2BackTransformation
private void hqr2BackTransformation(int nn, int low, int high) { for(int j = nn - 1; j >= low; j--) { final int last = j < high ? j : high; for(int i = low; i <= high; i++) { final double[] Vi = V[i]; double sum = 0.; for(int k = low; k <= last; k++) { sum += Vi[k] * H[...
java
private void hqr2BackTransformation(int nn, int low, int high) { for(int j = nn - 1; j >= low; j--) { final int last = j < high ? j : high; for(int i = low; i <= high; i++) { final double[] Vi = V[i]; double sum = 0.; for(int k = low; k <= last; k++) { sum += Vi[k] * H[...
[ "private", "void", "hqr2BackTransformation", "(", "int", "nn", ",", "int", "low", ",", "int", "high", ")", "{", "for", "(", "int", "j", "=", "nn", "-", "1", ";", "j", ">=", "low", ";", "j", "--", ")", "{", "final", "int", "last", "=", "j", "<",...
Back transformation to get eigenvectors of original matrix.
[ "Back", "transformation", "to", "get", "eigenvectors", "of", "original", "matrix", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/EigenvalueDecomposition.java#L807-L819
63,528
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GammaDistribution.java
GammaDistribution.gammaQuantileNewtonRefinement
protected static double gammaQuantileNewtonRefinement(final double logpt, final double k, final double theta, final int maxit, double x) { final double EPS_N = 1e-15; // Precision threshold // 0 is not possible, try MIN_NORMAL instead if(x <= 0) { x = Double.MIN_NORMAL; } // Current estimation...
java
protected static double gammaQuantileNewtonRefinement(final double logpt, final double k, final double theta, final int maxit, double x) { final double EPS_N = 1e-15; // Precision threshold // 0 is not possible, try MIN_NORMAL instead if(x <= 0) { x = Double.MIN_NORMAL; } // Current estimation...
[ "protected", "static", "double", "gammaQuantileNewtonRefinement", "(", "final", "double", "logpt", ",", "final", "double", "k", ",", "final", "double", "theta", ",", "final", "int", "maxit", ",", "double", "x", ")", "{", "final", "double", "EPS_N", "=", "1e-...
Refinement of ChiSquared probit using Newton iterations. A trick used by GNU R to improve precision. @param logpt Target value of log p @param k Alpha @param theta Theta = 1 / Beta @param maxit Maximum number of iterations to do @param x Initial estimate @return Refined value
[ "Refinement", "of", "ChiSquared", "probit", "using", "Newton", "iterations", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GammaDistribution.java#L840-L876
63,529
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/style/marker/CircleMarkers.java
CircleMarkers.useMarker
@Override public Element useMarker(SVGPlot plot, Element parent, double x, double y, int stylenr, double size) { Element marker = plot.svgCircle(x, y, size * .5); final String col; if(stylenr == -1) { col = dotcolor; } else if(stylenr == -2) { col = greycolor; } else { co...
java
@Override public Element useMarker(SVGPlot plot, Element parent, double x, double y, int stylenr, double size) { Element marker = plot.svgCircle(x, y, size * .5); final String col; if(stylenr == -1) { col = dotcolor; } else if(stylenr == -2) { col = greycolor; } else { co...
[ "@", "Override", "public", "Element", "useMarker", "(", "SVGPlot", "plot", ",", "Element", "parent", ",", "double", "x", ",", "double", "y", ",", "int", "stylenr", ",", "double", "size", ")", "{", "Element", "marker", "=", "plot", ".", "svgCircle", "(", ...
Use a given marker on the document.
[ "Use", "a", "given", "marker", "on", "the", "document", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/style/marker/CircleMarkers.java#L71-L87
63,530
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/extraction/HDBSCANHierarchyExtraction.java
HDBSCANHierarchyExtraction.run
public Clustering<DendrogramModel> run(PointerHierarchyRepresentationResult pointerresult) { Clustering<DendrogramModel> result = new Instance(pointerresult).run(); result.addChildResult(pointerresult); return result; }
java
public Clustering<DendrogramModel> run(PointerHierarchyRepresentationResult pointerresult) { Clustering<DendrogramModel> result = new Instance(pointerresult).run(); result.addChildResult(pointerresult); return result; }
[ "public", "Clustering", "<", "DendrogramModel", ">", "run", "(", "PointerHierarchyRepresentationResult", "pointerresult", ")", "{", "Clustering", "<", "DendrogramModel", ">", "result", "=", "new", "Instance", "(", "pointerresult", ")", ".", "run", "(", ")", ";", ...
Process an existing result. @param pointerresult Existing result in pointer representation. @return Clustering
[ "Process", "an", "existing", "result", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/extraction/HDBSCANHierarchyExtraction.java#L128-L132
63,531
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/NormalDistribution.java
NormalDistribution.erf
public static double erf(double x) { final double w = x < 0 ? -x : x; double y; if(w < 2.2) { double t = w * w; int k = (int) t; t -= k; k *= 13; y = ((((((((((((ERF_COEFF1[k] * t + ERF_COEFF1[k + 1]) * t + // ERF_COEFF1[k + 2]) * t + ERF_COEFF1[k + 3]) * t + ERF_COEF...
java
public static double erf(double x) { final double w = x < 0 ? -x : x; double y; if(w < 2.2) { double t = w * w; int k = (int) t; t -= k; k *= 13; y = ((((((((((((ERF_COEFF1[k] * t + ERF_COEFF1[k + 1]) * t + // ERF_COEFF1[k + 2]) * t + ERF_COEFF1[k + 3]) * t + ERF_COEF...
[ "public", "static", "double", "erf", "(", "double", "x", ")", "{", "final", "double", "w", "=", "x", "<", "0", "?", "-", "x", ":", "x", ";", "double", "y", ";", "if", "(", "w", "<", "2.2", ")", "{", "double", "t", "=", "w", "*", "w", ";", ...
Error function for Gaussian distributions = Normal distributions. @param x parameter value @return erf(x)
[ "Error", "function", "for", "Gaussian", "distributions", "=", "Normal", "distributions", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/NormalDistribution.java#L292-L327
63,532
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/NormalDistribution.java
NormalDistribution.standardNormalQuantile
public static double standardNormalQuantile(double d) { return (d == 0) ? Double.NEGATIVE_INFINITY : // (d == 1) ? Double.POSITIVE_INFINITY : // (Double.isNaN(d) || d < 0 || d > 1) ? Double.NaN // : MathUtil.SQRT2 * -erfcinv(2 * d); }
java
public static double standardNormalQuantile(double d) { return (d == 0) ? Double.NEGATIVE_INFINITY : // (d == 1) ? Double.POSITIVE_INFINITY : // (Double.isNaN(d) || d < 0 || d > 1) ? Double.NaN // : MathUtil.SQRT2 * -erfcinv(2 * d); }
[ "public", "static", "double", "standardNormalQuantile", "(", "double", "d", ")", "{", "return", "(", "d", "==", "0", ")", "?", "Double", ".", "NEGATIVE_INFINITY", ":", "//", "(", "d", "==", "1", ")", "?", "Double", ".", "POSITIVE_INFINITY", ":", "//", ...
Approximate the inverse error function for normal distributions. @param d Quantile. Must be in [0:1], obviously. @return Inverse erf.
[ "Approximate", "the", "inverse", "error", "function", "for", "normal", "distributions", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/NormalDistribution.java#L533-L538
63,533
elki-project/elki
elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/strategies/bulk/MaxExtensionBulkSplit.java
MaxExtensionBulkSplit.partition
@Override public <N extends SpatialComparable> List<List<N>> partition(List<N> spatialObjects, int minEntries, int maxEntries) { List<List<N>> partitions = new ArrayList<>(); List<N> objects = new ArrayList<>(spatialObjects); while (!objects.isEmpty()) { StringBuilder msg = new StringBuilder(); ...
java
@Override public <N extends SpatialComparable> List<List<N>> partition(List<N> spatialObjects, int minEntries, int maxEntries) { List<List<N>> partitions = new ArrayList<>(); List<N> objects = new ArrayList<>(spatialObjects); while (!objects.isEmpty()) { StringBuilder msg = new StringBuilder(); ...
[ "@", "Override", "public", "<", "N", "extends", "SpatialComparable", ">", "List", "<", "List", "<", "N", ">", ">", "partition", "(", "List", "<", "N", ">", "spatialObjects", ",", "int", "minEntries", ",", "int", "maxEntries", ")", "{", "List", "<", "Li...
Partitions the specified feature vectors where the split axes are the dimensions with maximum extension. @param spatialObjects the spatial objects to be partitioned @param minEntries the minimum number of entries in a partition @param maxEntries the maximum number of entries in a partition @return the partition of the...
[ "Partitions", "the", "specified", "feature", "vectors", "where", "the", "split", "axes", "are", "the", "dimensions", "with", "maximum", "extension", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/strategies/bulk/MaxExtensionBulkSplit.java#L71-L110
63,534
elki-project/elki
elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/strategies/bulk/MaxExtensionBulkSplit.java
MaxExtensionBulkSplit.chooseMaximalExtendedSplitAxis
private int chooseMaximalExtendedSplitAxis(List<? extends SpatialComparable> objects) { // maximum and minimum value for the extension int dimension = objects.get(0).getDimensionality(); double[] maxExtension = new double[dimension]; double[] minExtension = new double[dimension]; Arrays.fill(minExte...
java
private int chooseMaximalExtendedSplitAxis(List<? extends SpatialComparable> objects) { // maximum and minimum value for the extension int dimension = objects.get(0).getDimensionality(); double[] maxExtension = new double[dimension]; double[] minExtension = new double[dimension]; Arrays.fill(minExte...
[ "private", "int", "chooseMaximalExtendedSplitAxis", "(", "List", "<", "?", "extends", "SpatialComparable", ">", "objects", ")", "{", "// maximum and minimum value for the extension", "int", "dimension", "=", "objects", ".", "get", "(", "0", ")", ".", "getDimensionalit...
Computes and returns the best split axis. The best split axis is the split axes with the maximal extension. @param objects the spatial objects to be split @return the best split axis
[ "Computes", "and", "returns", "the", "best", "split", "axis", ".", "The", "best", "split", "axis", "is", "the", "split", "axes", "with", "the", "maximal", "extension", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/strategies/bulk/MaxExtensionBulkSplit.java#L119-L154
63,535
elki-project/elki
elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/progress/MutableProgress.java
MutableProgress.setTotal
public void setTotal(int total) throws IllegalArgumentException { if(getProcessed() > total) { throw new IllegalArgumentException(getProcessed() + " exceeds total: " + total); } this.total = total; }
java
public void setTotal(int total) throws IllegalArgumentException { if(getProcessed() > total) { throw new IllegalArgumentException(getProcessed() + " exceeds total: " + total); } this.total = total; }
[ "public", "void", "setTotal", "(", "int", "total", ")", "throws", "IllegalArgumentException", "{", "if", "(", "getProcessed", "(", ")", ">", "total", ")", "{", "throw", "new", "IllegalArgumentException", "(", "getProcessed", "(", ")", "+", "\" exceeds total: \""...
Modify the total value. @param total @throws IllegalArgumentException
[ "Modify", "the", "total", "value", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/progress/MutableProgress.java#L70-L75
63,536
elki-project/elki
elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/datastore/memory/MapRecordStore.java
MapRecordStore.get
@SuppressWarnings("unchecked") protected <T> T get(DBIDRef id, int index) { Object[] d = data.get(DBIDUtil.deref(id)); if(d == null) { return null; } return (T) d[index]; }
java
@SuppressWarnings("unchecked") protected <T> T get(DBIDRef id, int index) { Object[] d = data.get(DBIDUtil.deref(id)); if(d == null) { return null; } return (T) d[index]; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "<", "T", ">", "T", "get", "(", "DBIDRef", "id", ",", "int", "index", ")", "{", "Object", "[", "]", "d", "=", "data", ".", "get", "(", "DBIDUtil", ".", "deref", "(", "id", ")", ")", ...
Actual getter. @param id Database ID @param index column index @param <T> type @return current value
[ "Actual", "getter", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/datastore/memory/MapRecordStore.java#L88-L95
63,537
elki-project/elki
elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/datastore/memory/MapRecordStore.java
MapRecordStore.set
@SuppressWarnings("unchecked") protected <T> T set(DBIDRef id, int index, T value) { Object[] d = data.get(DBIDUtil.deref(id)); if(d == null) { d = new Object[rlen]; data.put(DBIDUtil.deref(id), d); } T ret = (T) d[index]; d[index] = value; return ret; }
java
@SuppressWarnings("unchecked") protected <T> T set(DBIDRef id, int index, T value) { Object[] d = data.get(DBIDUtil.deref(id)); if(d == null) { d = new Object[rlen]; data.put(DBIDUtil.deref(id), d); } T ret = (T) d[index]; d[index] = value; return ret; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "<", "T", ">", "T", "set", "(", "DBIDRef", "id", ",", "int", "index", ",", "T", "value", ")", "{", "Object", "[", "]", "d", "=", "data", ".", "get", "(", "DBIDUtil", ".", "deref", "("...
Actual setter. @param id Database ID @param index column index @param value new value @param <T> type @return previous value
[ "Actual", "setter", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/datastore/memory/MapRecordStore.java#L106-L116
63,538
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/estimator/UniformMinMaxEstimator.java
UniformMinMaxEstimator.estimate
public UniformDistribution estimate(DoubleMinMax mm) { return new UniformDistribution(Math.max(mm.getMin(), -Double.MAX_VALUE), Math.min(mm.getMax(), Double.MAX_VALUE)); }
java
public UniformDistribution estimate(DoubleMinMax mm) { return new UniformDistribution(Math.max(mm.getMin(), -Double.MAX_VALUE), Math.min(mm.getMax(), Double.MAX_VALUE)); }
[ "public", "UniformDistribution", "estimate", "(", "DoubleMinMax", "mm", ")", "{", "return", "new", "UniformDistribution", "(", "Math", ".", "max", "(", "mm", ".", "getMin", "(", ")", ",", "-", "Double", ".", "MAX_VALUE", ")", ",", "Math", ".", "min", "("...
Estimate parameters from minimum and maximum observed. @param mm Minimum and Maximum @return Estimation
[ "Estimate", "parameters", "from", "minimum", "and", "maximum", "observed", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/estimator/UniformMinMaxEstimator.java#L69-L71
63,539
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/scatterplot/index/TreeSphereVisualization.java
TreeSphereVisualization.canVisualize
public static boolean canVisualize(Relation<?> rel, AbstractMTree<?, ?, ?, ?> tree) { if(!TypeUtil.NUMBER_VECTOR_FIELD.isAssignableFromType(rel.getDataTypeInformation())) { return false; } return getLPNormP(tree) > 0; }
java
public static boolean canVisualize(Relation<?> rel, AbstractMTree<?, ?, ?, ?> tree) { if(!TypeUtil.NUMBER_VECTOR_FIELD.isAssignableFromType(rel.getDataTypeInformation())) { return false; } return getLPNormP(tree) > 0; }
[ "public", "static", "boolean", "canVisualize", "(", "Relation", "<", "?", ">", "rel", ",", "AbstractMTree", "<", "?", ",", "?", ",", "?", ",", "?", ">", "tree", ")", "{", "if", "(", "!", "TypeUtil", ".", "NUMBER_VECTOR_FIELD", ".", "isAssignableFromType"...
Test for a visualizable index in the context's database. @param rel Vector relation @param tree Tree to visualize @return whether the tree is visualizable
[ "Test", "for", "a", "visualizable", "index", "in", "the", "context", "s", "database", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/scatterplot/index/TreeSphereVisualization.java#L146-L151
63,540
elki-project/elki
elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/NumberVectorRandomFeatureSelectionFilter.java
NumberVectorRandomFeatureSelectionFilter.initializeRandomAttributes
void initializeRandomAttributes(SimpleTypeInformation<V> in) { int d = ((VectorFieldTypeInformation<V>) in).getDimensionality(); selectedAttributes = BitsUtil.random(k, d, rnd.getSingleThreadedRandom()); }
java
void initializeRandomAttributes(SimpleTypeInformation<V> in) { int d = ((VectorFieldTypeInformation<V>) in).getDimensionality(); selectedAttributes = BitsUtil.random(k, d, rnd.getSingleThreadedRandom()); }
[ "void", "initializeRandomAttributes", "(", "SimpleTypeInformation", "<", "V", ">", "in", ")", "{", "int", "d", "=", "(", "(", "VectorFieldTypeInformation", "<", "V", ">", ")", "in", ")", ".", "getDimensionality", "(", ")", ";", "selectedAttributes", "=", "Bi...
Initialize random attributes. Invoke this from {@link #convertedType}! @param in Type information.
[ "Initialize", "random", "attributes", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/NumberVectorRandomFeatureSelectionFilter.java#L103-L106
63,541
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/application/greedyensemble/GreedyEnsembleExperiment.java
GreedyEnsembleExperiment.singleEnsemble
protected void singleEnsemble(final double[] ensemble, final NumberVector vec) { double[] buf = new double[1]; for(int i = 0; i < ensemble.length; i++) { buf[0] = vec.doubleValue(i); ensemble[i] = voting.combine(buf, 1); if(Double.isNaN(ensemble[i])) { LOG.warning("NaN after combining:...
java
protected void singleEnsemble(final double[] ensemble, final NumberVector vec) { double[] buf = new double[1]; for(int i = 0; i < ensemble.length; i++) { buf[0] = vec.doubleValue(i); ensemble[i] = voting.combine(buf, 1); if(Double.isNaN(ensemble[i])) { LOG.warning("NaN after combining:...
[ "protected", "void", "singleEnsemble", "(", "final", "double", "[", "]", "ensemble", ",", "final", "NumberVector", "vec", ")", "{", "double", "[", "]", "buf", "=", "new", "double", "[", "1", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<"...
Build a single-element "ensemble". @param ensemble @param vec
[ "Build", "a", "single", "-", "element", "ensemble", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/application/greedyensemble/GreedyEnsembleExperiment.java#L489-L499
63,542
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/OptionUtil.java
OptionUtil.getFullDescription
public static String getFullDescription(Parameter<?> param) { StringBuilder description = new StringBuilder(1000) // .append(param.getShortDescription()).append(FormatUtil.NEWLINE); param.describeValues(description); if(!FormatUtil.endsWith(description, FormatUtil.NEWLINE)) { description.appen...
java
public static String getFullDescription(Parameter<?> param) { StringBuilder description = new StringBuilder(1000) // .append(param.getShortDescription()).append(FormatUtil.NEWLINE); param.describeValues(description); if(!FormatUtil.endsWith(description, FormatUtil.NEWLINE)) { description.appen...
[ "public", "static", "String", "getFullDescription", "(", "Parameter", "<", "?", ">", "param", ")", "{", "StringBuilder", "description", "=", "new", "StringBuilder", "(", "1000", ")", "//", ".", "append", "(", "param", ".", "getShortDescription", "(", ")", ")...
Format a parameter description. @param param Parameter @return Parameter description
[ "Format", "a", "parameter", "description", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/OptionUtil.java#L78-L98
63,543
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/OptionUtil.java
OptionUtil.println
private static void println(StringBuilder buf, int width, String data) { for(String line : FormatUtil.splitAtLastBlank(data, width)) { buf.append(line); if(!line.endsWith(FormatUtil.NEWLINE)) { buf.append(FormatUtil.NEWLINE); } } }
java
private static void println(StringBuilder buf, int width, String data) { for(String line : FormatUtil.splitAtLastBlank(data, width)) { buf.append(line); if(!line.endsWith(FormatUtil.NEWLINE)) { buf.append(FormatUtil.NEWLINE); } } }
[ "private", "static", "void", "println", "(", "StringBuilder", "buf", ",", "int", "width", ",", "String", "data", ")", "{", "for", "(", "String", "line", ":", "FormatUtil", ".", "splitAtLastBlank", "(", "data", ",", "width", ")", ")", "{", "buf", ".", "...
Simple writing helper with no indentation. @param buf Buffer to write to @param width Width to use for linewraps @param data Data to write.
[ "Simple", "writing", "helper", "with", "no", "indentation", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/OptionUtil.java#L107-L114
63,544
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/internal/EvaluateSimplifiedSilhouette.java
EvaluateSimplifiedSilhouette.centroids
public static int centroids(Relation<? extends NumberVector> rel, List<? extends Cluster<?>> clusters, NumberVector[] centroids, NoiseHandling noiseOption) { assert (centroids.length == clusters.size()); int ignorednoise = 0; Iterator<? extends Cluster<?>> ci = clusters.iterator(); for(int i = 0; ci.has...
java
public static int centroids(Relation<? extends NumberVector> rel, List<? extends Cluster<?>> clusters, NumberVector[] centroids, NoiseHandling noiseOption) { assert (centroids.length == clusters.size()); int ignorednoise = 0; Iterator<? extends Cluster<?>> ci = clusters.iterator(); for(int i = 0; ci.has...
[ "public", "static", "int", "centroids", "(", "Relation", "<", "?", "extends", "NumberVector", ">", "rel", ",", "List", "<", "?", "extends", "Cluster", "<", "?", ">", ">", "clusters", ",", "NumberVector", "[", "]", "centroids", ",", "NoiseHandling", "noiseO...
Compute centroids. @param rel Data relation @param clusters Clusters @param centroids Output array for centroids @return Number of ignored noise elements.
[ "Compute", "centroids", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/internal/EvaluateSimplifiedSilhouette.java#L216-L236
63,545
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/LaplaceDistribution.java
LaplaceDistribution.cdf
public static double cdf(double val, double rate) { final double v = .5 * FastMath.exp(-rate * Math.abs(val)); return (v == Double.POSITIVE_INFINITY) ? ((val <= 0) ? 0 : 1) : // (val < 0) ? v : 1 - v; }
java
public static double cdf(double val, double rate) { final double v = .5 * FastMath.exp(-rate * Math.abs(val)); return (v == Double.POSITIVE_INFINITY) ? ((val <= 0) ? 0 : 1) : // (val < 0) ? v : 1 - v; }
[ "public", "static", "double", "cdf", "(", "double", "val", ",", "double", "rate", ")", "{", "final", "double", "v", "=", ".5", "*", "FastMath", ".", "exp", "(", "-", "rate", "*", "Math", ".", "abs", "(", "val", ")", ")", ";", "return", "(", "v", ...
Cumulative density, static version @param val Value to compute CDF at @param rate Rate parameter (1/scale) @return cumulative density
[ "Cumulative", "density", "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/LaplaceDistribution.java#L167-L171
63,546
elki-project/elki
elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/covertree/AbstractCoverTree.java
AbstractCoverTree.maxDistance
protected double maxDistance(DoubleDBIDList elems) { double max = 0; for(DoubleDBIDListIter it = elems.iter(); it.valid(); it.advance()) { final double v = it.doubleValue(); max = max > v ? max : v; } return max; }
java
protected double maxDistance(DoubleDBIDList elems) { double max = 0; for(DoubleDBIDListIter it = elems.iter(); it.valid(); it.advance()) { final double v = it.doubleValue(); max = max > v ? max : v; } return max; }
[ "protected", "double", "maxDistance", "(", "DoubleDBIDList", "elems", ")", "{", "double", "max", "=", "0", ";", "for", "(", "DoubleDBIDListIter", "it", "=", "elems", ".", "iter", "(", ")", ";", "it", ".", "valid", "(", ")", ";", "it", ".", "advance", ...
Find maximum in a list via scanning. @param elems Elements @return Maximum distance
[ "Find", "maximum", "in", "a", "list", "via", "scanning", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/covertree/AbstractCoverTree.java#L133-L140
63,547
elki-project/elki
elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/covertree/AbstractCoverTree.java
AbstractCoverTree.excludeNotCovered
protected void excludeNotCovered(ModifiableDoubleDBIDList candidates, double fmax, ModifiableDoubleDBIDList collect) { for(DoubleDBIDListIter it = candidates.iter(); it.valid();) { if(it.doubleValue() > fmax) { collect.add(it.doubleValue(), it); candidates.removeSwap(it.getOffset()); } ...
java
protected void excludeNotCovered(ModifiableDoubleDBIDList candidates, double fmax, ModifiableDoubleDBIDList collect) { for(DoubleDBIDListIter it = candidates.iter(); it.valid();) { if(it.doubleValue() > fmax) { collect.add(it.doubleValue(), it); candidates.removeSwap(it.getOffset()); } ...
[ "protected", "void", "excludeNotCovered", "(", "ModifiableDoubleDBIDList", "candidates", ",", "double", "fmax", ",", "ModifiableDoubleDBIDList", "collect", ")", "{", "for", "(", "DoubleDBIDListIter", "it", "=", "candidates", ".", "iter", "(", ")", ";", "it", ".", ...
Retain all elements within the current cover. @param candidates Candidates @param fmax Maximum distance @param collect Far neighbors
[ "Retain", "all", "elements", "within", "the", "current", "cover", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/covertree/AbstractCoverTree.java#L173-L183
63,548
elki-project/elki
elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/covertree/AbstractCoverTree.java
AbstractCoverTree.collectByCover
protected void collectByCover(DBIDRef cur, ModifiableDoubleDBIDList candidates, double fmax, ModifiableDoubleDBIDList collect) { assert (collect.size() == 0) : "Not empty"; DoubleDBIDListIter it = candidates.iter().advance(); // Except first = cur! while(it.valid()) { assert (!DBIDUtil.equal(cur, it))...
java
protected void collectByCover(DBIDRef cur, ModifiableDoubleDBIDList candidates, double fmax, ModifiableDoubleDBIDList collect) { assert (collect.size() == 0) : "Not empty"; DoubleDBIDListIter it = candidates.iter().advance(); // Except first = cur! while(it.valid()) { assert (!DBIDUtil.equal(cur, it))...
[ "protected", "void", "collectByCover", "(", "DBIDRef", "cur", ",", "ModifiableDoubleDBIDList", "candidates", ",", "double", "fmax", ",", "ModifiableDoubleDBIDList", "collect", ")", "{", "assert", "(", "collect", ".", "size", "(", ")", "==", "0", ")", ":", "\"N...
Collect all elements with respect to a new routing object. @param cur Routing object @param candidates Candidate list @param fmax Maximum distance @param collect Output list
[ "Collect", "all", "elements", "with", "respect", "to", "a", "new", "routing", "object", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/covertree/AbstractCoverTree.java#L193-L207
63,549
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/KernelDensityEstimator.java
KernelDensityEstimator.process
private void process(double[] data, double min, double max, KernelDensityFunction kernel, int window, double epsilon) { dens = new double[data.length]; var = new double[data.length]; // This is the desired bandwidth of the kernel. double halfwidth = ((max - min) / window) * .5; for (int current = ...
java
private void process(double[] data, double min, double max, KernelDensityFunction kernel, int window, double epsilon) { dens = new double[data.length]; var = new double[data.length]; // This is the desired bandwidth of the kernel. double halfwidth = ((max - min) / window) * .5; for (int current = ...
[ "private", "void", "process", "(", "double", "[", "]", "data", ",", "double", "min", ",", "double", "max", ",", "KernelDensityFunction", "kernel", ",", "int", "window", ",", "double", "epsilon", ")", "{", "dens", "=", "new", "double", "[", "data", ".", ...
Process a new array @param data data to use (must be sorted!) @param min minimum value @param max maximum value @param kernel Kernel function to use @param window window size @param epsilon Precision threshold
[ "Process", "a", "new", "array" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/KernelDensityEstimator.java#L73-L103
63,550
elki-project/elki
addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/layout/AbstractLayout3DPC.java
AbstractLayout3DPC.computeSimilarityMatrix
public static double[] computeSimilarityMatrix(DependenceMeasure sim, Relation<? extends NumberVector> rel) { final int dim = RelationUtil.dimensionality(rel); // TODO: we could use less memory (no copy), but this would likely be // slower. Maybe as a fallback option? double[][] data = new double[dim][r...
java
public static double[] computeSimilarityMatrix(DependenceMeasure sim, Relation<? extends NumberVector> rel) { final int dim = RelationUtil.dimensionality(rel); // TODO: we could use less memory (no copy), but this would likely be // slower. Maybe as a fallback option? double[][] data = new double[dim][r...
[ "public", "static", "double", "[", "]", "computeSimilarityMatrix", "(", "DependenceMeasure", "sim", ",", "Relation", "<", "?", "extends", "NumberVector", ">", "rel", ")", "{", "final", "int", "dim", "=", "RelationUtil", ".", "dimensionality", "(", "rel", ")", ...
Compute a column-wise dependency matrix for the given relation. @param sim Dependence measure @param rel Vector relation @return Similarity matrix (lower triangular form)
[ "Compute", "a", "column", "-", "wise", "dependency", "matrix", "for", "the", "given", "relation", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/layout/AbstractLayout3DPC.java#L80-L93
63,551
elki-project/elki
addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/layout/AbstractLayout3DPC.java
AbstractLayout3DPC.buildSpanningTree
protected N buildSpanningTree(int dim, double[] mat, Layout layout) { assert (layout.edges == null || layout.edges.size() == 0); int[] iedges = PrimsMinimumSpanningTree.processDense(mat, new LowerTriangularAdapter(dim)); int root = findOptimalRoot(iedges); // Convert edges: ArrayList<Edge> edges = ...
java
protected N buildSpanningTree(int dim, double[] mat, Layout layout) { assert (layout.edges == null || layout.edges.size() == 0); int[] iedges = PrimsMinimumSpanningTree.processDense(mat, new LowerTriangularAdapter(dim)); int root = findOptimalRoot(iedges); // Convert edges: ArrayList<Edge> edges = ...
[ "protected", "N", "buildSpanningTree", "(", "int", "dim", ",", "double", "[", "]", "mat", ",", "Layout", "layout", ")", "{", "assert", "(", "layout", ".", "edges", "==", "null", "||", "layout", ".", "edges", ".", "size", "(", ")", "==", "0", ")", "...
Build the minimum spanning tree. @param mat Similarity matrix @param layout Layout to write to @return Root node id
[ "Build", "the", "minimum", "spanning", "tree", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/layout/AbstractLayout3DPC.java#L133-L154
63,552
elki-project/elki
addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/layout/AbstractLayout3DPC.java
AbstractLayout3DPC.buildTree
protected N buildTree(int[] msg, int cur, int parent, ArrayList<N> nodes) { // Count the number of children: int c = 0; for(int i = 1; i < msg.length; i += 2) { if((msg[i - 1] == cur && msg[i] != parent) || (msg[i] == cur && msg[i - 1] != parent)) { c++; } } // Build children: ...
java
protected N buildTree(int[] msg, int cur, int parent, ArrayList<N> nodes) { // Count the number of children: int c = 0; for(int i = 1; i < msg.length; i += 2) { if((msg[i - 1] == cur && msg[i] != parent) || (msg[i] == cur && msg[i - 1] != parent)) { c++; } } // Build children: ...
[ "protected", "N", "buildTree", "(", "int", "[", "]", "msg", ",", "int", "cur", ",", "int", "parent", ",", "ArrayList", "<", "N", ">", "nodes", ")", "{", "// Count the number of children:", "int", "c", "=", "0", ";", "for", "(", "int", "i", "=", "1", ...
Recursive tree build method. @param msg Minimum spanning graph @param cur Current node @param parent Parent node @param nodes Nodes array to fill - must be preinitialized with nulls! @return Tree of nodes
[ "Recursive", "tree", "build", "method", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/layout/AbstractLayout3DPC.java#L167-L191
63,553
elki-project/elki
addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/layout/AbstractLayout3DPC.java
AbstractLayout3DPC.maxDepth
protected int maxDepth(Layout.Node node) { int depth = 0; for(int i = 0; i < node.numChildren(); i++) { depth = Math.max(depth, maxDepth(node.getChild(i))); } return depth + 1; }
java
protected int maxDepth(Layout.Node node) { int depth = 0; for(int i = 0; i < node.numChildren(); i++) { depth = Math.max(depth, maxDepth(node.getChild(i))); } return depth + 1; }
[ "protected", "int", "maxDepth", "(", "Layout", ".", "Node", "node", ")", "{", "int", "depth", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "node", ".", "numChildren", "(", ")", ";", "i", "++", ")", "{", "depth", "=", "Math", ...
Compute the depth of the graph. @param node Current node @return Depth
[ "Compute", "the", "depth", "of", "the", "graph", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/layout/AbstractLayout3DPC.java#L199-L205
63,554
elki-project/elki
elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/IndexTree.java
IndexTree.initialize
@Override public void initialize() { TreeIndexHeader header = createHeader(); if(this.file.initialize(header)) { initializeFromFile(header, file); } rootEntry = createRootEntry(); }
java
@Override public void initialize() { TreeIndexHeader header = createHeader(); if(this.file.initialize(header)) { initializeFromFile(header, file); } rootEntry = createRootEntry(); }
[ "@", "Override", "public", "void", "initialize", "(", ")", "{", "TreeIndexHeader", "header", "=", "createHeader", "(", ")", ";", "if", "(", "this", ".", "file", ".", "initialize", "(", "header", ")", ")", "{", "initializeFromFile", "(", "header", ",", "f...
Initialize the tree if the page file already existed.
[ "Initialize", "the", "tree", "if", "the", "page", "file", "already", "existed", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/IndexTree.java#L93-L100
63,555
elki-project/elki
elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/IndexTree.java
IndexTree.getNode
public N getNode(int nodeID) { if(nodeID == getPageID(rootEntry)) { return getRoot(); } else { return file.readPage(nodeID); } }
java
public N getNode(int nodeID) { if(nodeID == getPageID(rootEntry)) { return getRoot(); } else { return file.readPage(nodeID); } }
[ "public", "N", "getNode", "(", "int", "nodeID", ")", "{", "if", "(", "nodeID", "==", "getPageID", "(", "rootEntry", ")", ")", "{", "return", "getRoot", "(", ")", ";", "}", "else", "{", "return", "file", ".", "readPage", "(", "nodeID", ")", ";", "}"...
Returns the node with the specified id. @param nodeID the page id of the node to be returned @return the node with the specified id
[ "Returns", "the", "node", "with", "the", "specified", "id", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/IndexTree.java#L165-L172
63,556
elki-project/elki
elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/IndexTree.java
IndexTree.initializeFromFile
public void initializeFromFile(TreeIndexHeader header, PageFile<N> file) { this.dirCapacity = header.getDirCapacity(); this.leafCapacity = header.getLeafCapacity(); this.dirMinimum = header.getDirMinimum(); this.leafMinimum = header.getLeafMinimum(); if(getLogger().isDebugging()) { StringBuil...
java
public void initializeFromFile(TreeIndexHeader header, PageFile<N> file) { this.dirCapacity = header.getDirCapacity(); this.leafCapacity = header.getLeafCapacity(); this.dirMinimum = header.getDirMinimum(); this.leafMinimum = header.getLeafMinimum(); if(getLogger().isDebugging()) { StringBuil...
[ "public", "void", "initializeFromFile", "(", "TreeIndexHeader", "header", ",", "PageFile", "<", "N", ">", "file", ")", "{", "this", ".", "dirCapacity", "=", "header", ".", "getDirCapacity", "(", ")", ";", "this", ".", "leafCapacity", "=", "header", ".", "g...
Initializes this index from an existing persistent file. @param header File header @param file Page file
[ "Initializes", "this", "index", "from", "an", "existing", "persistent", "file", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/IndexTree.java#L219-L233
63,557
elki-project/elki
elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/IndexTree.java
IndexTree.initialize
protected final void initialize(E exampleLeaf) { initializeCapacities(exampleLeaf); // create empty root createEmptyRoot(exampleLeaf); final Logging log = getLogger(); if(log.isStatistics()) { String cls = this.getClass().getName(); log.statistics(new LongStatistic(cls + ".directory.ca...
java
protected final void initialize(E exampleLeaf) { initializeCapacities(exampleLeaf); // create empty root createEmptyRoot(exampleLeaf); final Logging log = getLogger(); if(log.isStatistics()) { String cls = this.getClass().getName(); log.statistics(new LongStatistic(cls + ".directory.ca...
[ "protected", "final", "void", "initialize", "(", "E", "exampleLeaf", ")", "{", "initializeCapacities", "(", "exampleLeaf", ")", ";", "// create empty root", "createEmptyRoot", "(", "exampleLeaf", ")", ";", "final", "Logging", "log", "=", "getLogger", "(", ")", "...
Initializes the index. @param exampleLeaf an object that will be stored in the index
[ "Initializes", "the", "index", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/IndexTree.java#L240-L256
63,558
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/MeanVarianceMinMax.java
MeanVarianceMinMax.newArray
public static MeanVarianceMinMax[] newArray(int dimensionality) { MeanVarianceMinMax[] arr = new MeanVarianceMinMax[dimensionality]; for(int i = 0; i < dimensionality; i++) { arr[i] = new MeanVarianceMinMax(); } return arr; }
java
public static MeanVarianceMinMax[] newArray(int dimensionality) { MeanVarianceMinMax[] arr = new MeanVarianceMinMax[dimensionality]; for(int i = 0; i < dimensionality; i++) { arr[i] = new MeanVarianceMinMax(); } return arr; }
[ "public", "static", "MeanVarianceMinMax", "[", "]", "newArray", "(", "int", "dimensionality", ")", "{", "MeanVarianceMinMax", "[", "]", "arr", "=", "new", "MeanVarianceMinMax", "[", "dimensionality", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<...
Create and initialize a new array of MeanVarianceMinMax @param dimensionality Dimensionality @return New and initialized Array
[ "Create", "and", "initialize", "a", "new", "array", "of", "MeanVarianceMinMax" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/MeanVarianceMinMax.java#L187-L193
63,559
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/weightfunctions/ExponentialStddevWeight.java
ExponentialStddevWeight.getWeight
@Override public double getWeight(double distance, double max, double stddev) { if(stddev <= 0) { return 1; } double scaleddistance = distance / stddev; return stddev * FastMath.exp(-.5 * scaleddistance); }
java
@Override public double getWeight(double distance, double max, double stddev) { if(stddev <= 0) { return 1; } double scaleddistance = distance / stddev; return stddev * FastMath.exp(-.5 * scaleddistance); }
[ "@", "Override", "public", "double", "getWeight", "(", "double", "distance", ",", "double", "max", ",", "double", "stddev", ")", "{", "if", "(", "stddev", "<=", "0", ")", "{", "return", "1", ";", "}", "double", "scaleddistance", "=", "distance", "/", "...
Get exponential weight, max is ignored.
[ "Get", "exponential", "weight", "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/ExponentialStddevWeight.java#L41-L48
63,560
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/AbstractDependenceMeasure.java
AbstractDependenceMeasure.sortedIndex
protected static <A> int[] sortedIndex(final NumberArrayAdapter<?, A> adapter, final A data, int len) { int[] s1 = MathUtil.sequence(0, len); IntegerArrayQuickSort.sort(s1, (x, y) -> Double.compare(adapter.getDouble(data, x), adapter.getDouble(data, y))); return s1; }
java
protected static <A> int[] sortedIndex(final NumberArrayAdapter<?, A> adapter, final A data, int len) { int[] s1 = MathUtil.sequence(0, len); IntegerArrayQuickSort.sort(s1, (x, y) -> Double.compare(adapter.getDouble(data, x), adapter.getDouble(data, y))); return s1; }
[ "protected", "static", "<", "A", ">", "int", "[", "]", "sortedIndex", "(", "final", "NumberArrayAdapter", "<", "?", ",", "A", ">", "adapter", ",", "final", "A", "data", ",", "int", "len", ")", "{", "int", "[", "]", "s1", "=", "MathUtil", ".", "sequ...
Build a sorted index of objects. @param adapter Data adapter @param data Data array @param len Length of data @return Sorted index
[ "Build", "a", "sorted", "index", "of", "objects", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/AbstractDependenceMeasure.java#L128-L132
63,561
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/AbstractDependenceMeasure.java
AbstractDependenceMeasure.discretize
protected static <A> int[] discretize(NumberArrayAdapter<?, A> adapter, A data, final int len, final int bins) { double min = adapter.getDouble(data, 0), max = min; for(int i = 1; i < len; i++) { double v = adapter.getDouble(data, i); if(v < min) { min = v; } else if(v > max) { ...
java
protected static <A> int[] discretize(NumberArrayAdapter<?, A> adapter, A data, final int len, final int bins) { double min = adapter.getDouble(data, 0), max = min; for(int i = 1; i < len; i++) { double v = adapter.getDouble(data, i); if(v < min) { min = v; } else if(v > max) { ...
[ "protected", "static", "<", "A", ">", "int", "[", "]", "discretize", "(", "NumberArrayAdapter", "<", "?", ",", "A", ">", "adapter", ",", "A", "data", ",", "final", "int", "len", ",", "final", "int", "bins", ")", "{", "double", "min", "=", "adapter", ...
Discretize a data set into equi-width bin numbers. @param adapter Data adapter @param data Data array @param len Length of data @param bins Number of bins @return Array of bin numbers [0;bin[
[ "Discretize", "a", "data", "set", "into", "equi", "-", "width", "bin", "numbers", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/AbstractDependenceMeasure.java#L143-L161
63,562
elki-project/elki
elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/configurator/AbstractParameterConfigurator.java
AbstractParameterConfigurator.finishGridRow
protected void finishGridRow() { GridBagConstraints constraints = new GridBagConstraints(); constraints.gridwidth = GridBagConstraints.REMAINDER; constraints.weightx = 0; final JLabel icon; if(param.isOptional()) { if(param.isDefined() && param.tookDefaultValue() && !(param instanceof Flag)) {...
java
protected void finishGridRow() { GridBagConstraints constraints = new GridBagConstraints(); constraints.gridwidth = GridBagConstraints.REMAINDER; constraints.weightx = 0; final JLabel icon; if(param.isOptional()) { if(param.isDefined() && param.tookDefaultValue() && !(param instanceof Flag)) {...
[ "protected", "void", "finishGridRow", "(", ")", "{", "GridBagConstraints", "constraints", "=", "new", "GridBagConstraints", "(", ")", ";", "constraints", ".", "gridwidth", "=", "GridBagConstraints", ".", "REMAINDER", ";", "constraints", ".", "weightx", "=", "0", ...
Complete the current grid row, adding the icon at the end
[ "Complete", "the", "current", "grid", "row", "adding", "the", "icon", "at", "the", "end" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/configurator/AbstractParameterConfigurator.java#L80-L107
63,563
elki-project/elki
elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/normalization/columnwise/AttributeWiseVarianceNormalization.java
AttributeWiseVarianceNormalization.normalize
private double normalize(int d, double val) { d = (mean.length == 1) ? 0 : d; return (val - mean[d]) / stddev[d]; }
java
private double normalize(int d, double val) { d = (mean.length == 1) ? 0 : d; return (val - mean[d]) / stddev[d]; }
[ "private", "double", "normalize", "(", "int", "d", ",", "double", "val", ")", "{", "d", "=", "(", "mean", ".", "length", "==", "1", ")", "?", "0", ":", "d", ";", "return", "(", "val", "-", "mean", "[", "d", "]", ")", "/", "stddev", "[", "d", ...
Normalize a single dimension. @param d Dimension @param val Value @return Normalized value
[ "Normalize", "a", "single", "dimension", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/normalization/columnwise/AttributeWiseVarianceNormalization.java#L170-L173
63,564
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/PCAResult.java
PCAResult.processDecomposition
private static EigenPair[] processDecomposition(EigenvalueDecomposition evd) { double[] eigenvalues = evd.getRealEigenvalues(); double[][] eigenvectors = evd.getV(); EigenPair[] eigenPairs = new EigenPair[eigenvalues.length]; for(int i = 0; i < eigenvalues.length; i++) { double e = Math.abs(eigen...
java
private static EigenPair[] processDecomposition(EigenvalueDecomposition evd) { double[] eigenvalues = evd.getRealEigenvalues(); double[][] eigenvectors = evd.getV(); EigenPair[] eigenPairs = new EigenPair[eigenvalues.length]; for(int i = 0; i < eigenvalues.length; i++) { double e = Math.abs(eigen...
[ "private", "static", "EigenPair", "[", "]", "processDecomposition", "(", "EigenvalueDecomposition", "evd", ")", "{", "double", "[", "]", "eigenvalues", "=", "evd", ".", "getRealEigenvalues", "(", ")", ";", "double", "[", "]", "[", "]", "eigenvectors", "=", "...
Convert an eigenvalue decomposition into EigenPair objects. @param evd Eigenvalue decomposition @return Eigenpairs
[ "Convert", "an", "eigenvalue", "decomposition", "into", "EigenPair", "objects", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/PCAResult.java#L85-L97
63,565
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/parallel/KMeansProcessor.java
KMeansProcessor.nextIteration
public void nextIteration(double[][] means) { this.means = means; changed = false; final int k = means.length; final int dim = means[0].length; centroids = new double[k][dim]; sizes = new int[k]; Arrays.fill(varsum, 0.); }
java
public void nextIteration(double[][] means) { this.means = means; changed = false; final int k = means.length; final int dim = means[0].length; centroids = new double[k][dim]; sizes = new int[k]; Arrays.fill(varsum, 0.); }
[ "public", "void", "nextIteration", "(", "double", "[", "]", "[", "]", "means", ")", "{", "this", ".", "means", "=", "means", ";", "changed", "=", "false", ";", "final", "int", "k", "=", "means", ".", "length", ";", "final", "int", "dim", "=", "mean...
Initialize for a new iteration. @param means New means.
[ "Initialize", "for", "a", "new", "iteration", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/parallel/KMeansProcessor.java#L118-L126
63,566
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/parallel/KMeansProcessor.java
KMeansProcessor.getMeans
public double[][] getMeans() { double[][] newmeans = new double[centroids.length][]; for(int i = 0; i < centroids.length; i++) { if(sizes[i] == 0) { newmeans[i] = means[i]; // Keep old mean. continue; } newmeans[i] = centroids[i]; } return newmeans; }
java
public double[][] getMeans() { double[][] newmeans = new double[centroids.length][]; for(int i = 0; i < centroids.length; i++) { if(sizes[i] == 0) { newmeans[i] = means[i]; // Keep old mean. continue; } newmeans[i] = centroids[i]; } return newmeans; }
[ "public", "double", "[", "]", "[", "]", "getMeans", "(", ")", "{", "double", "[", "]", "[", "]", "newmeans", "=", "new", "double", "[", "centroids", ".", "length", "]", "[", "", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "cent...
Get the new means. @return New means
[ "Get", "the", "new", "means", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/parallel/KMeansProcessor.java#L162-L172
63,567
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.format
public static String format(double[] v, int w, int d) { DecimalFormat format = new DecimalFormat(); format.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.US)); format.setMinimumIntegerDigits(1); format.setMaximumFractionDigits(d); format.setMinimumFractionDigits(d); format.setGroupingUs...
java
public static String format(double[] v, int w, int d) { DecimalFormat format = new DecimalFormat(); format.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.US)); format.setMinimumIntegerDigits(1); format.setMaximumFractionDigits(d); format.setMinimumFractionDigits(d); format.setGroupingUs...
[ "public", "static", "String", "format", "(", "double", "[", "]", "v", ",", "int", "w", ",", "int", "d", ")", "{", "DecimalFormat", "format", "=", "new", "DecimalFormat", "(", ")", ";", "format", ".", "setDecimalFormatSymbols", "(", "new", "DecimalFormatSym...
Returns a string representation of this vector. @param w column width @param d number of digits after the decimal @return a string representation of this matrix
[ "Returns", "a", "string", "representation", "of", "this", "vector", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L240-L257
63,568
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.formatTo
public static StringBuilder formatTo(StringBuilder buf, double[] d, String sep) { if(d == null) { return buf.append("null"); } if(d.length == 0) { return buf; } buf.append(d[0]); for(int i = 1; i < d.length; i++) { buf.append(sep).append(d[i]); } return buf; }
java
public static StringBuilder formatTo(StringBuilder buf, double[] d, String sep) { if(d == null) { return buf.append("null"); } if(d.length == 0) { return buf; } buf.append(d[0]); for(int i = 1; i < d.length; i++) { buf.append(sep).append(d[i]); } return buf; }
[ "public", "static", "StringBuilder", "formatTo", "(", "StringBuilder", "buf", ",", "double", "[", "]", "d", ",", "String", "sep", ")", "{", "if", "(", "d", "==", "null", ")", "{", "return", "buf", ".", "append", "(", "\"null\"", ")", ";", "}", "if", ...
Formats the double array d with the default number format. @param buf String builder to append to @param d the double array to be formatted @param sep separator between the single values of the array, e.g. ',' @return Output buffer buf
[ "Formats", "the", "double", "array", "d", "with", "the", "default", "number", "format", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L267-L279
63,569
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.format
public static String format(float[] f) { return (f == null) ? "null" : (f.length == 0) ? "" : // formatTo(new StringBuilder(), f, ", ").toString(); }
java
public static String format(float[] f) { return (f == null) ? "null" : (f.length == 0) ? "" : // formatTo(new StringBuilder(), f, ", ").toString(); }
[ "public", "static", "String", "format", "(", "float", "[", "]", "f", ")", "{", "return", "(", "f", "==", "null", ")", "?", "\"null\"", ":", "(", "f", ".", "length", "==", "0", ")", "?", "\"\"", ":", "//", "formatTo", "(", "new", "StringBuilder", ...
Formats the float array f with ',' as separator and default precision. @param f the float array to be formatted @return a String representing the float array f
[ "Formats", "the", "float", "array", "f", "with", "as", "separator", "and", "default", "precision", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L512-L515
63,570
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.format
public static String format(int[] a, String sep) { return (a == null) ? "null" : (a.length == 0) ? "" : // formatTo(new StringBuilder(), a, sep).toString(); }
java
public static String format(int[] a, String sep) { return (a == null) ? "null" : (a.length == 0) ? "" : // formatTo(new StringBuilder(), a, sep).toString(); }
[ "public", "static", "String", "format", "(", "int", "[", "]", "a", ",", "String", "sep", ")", "{", "return", "(", "a", "==", "null", ")", "?", "\"null\"", ":", "(", "a", ".", "length", "==", "0", ")", "?", "\"\"", ":", "//", "formatTo", "(", "n...
Formats the int array a for printing purposes. @param a the int array to be formatted @param sep the separator between the single values of the array, e.g. ',' @return a String representing the int array a
[ "Formats", "the", "int", "array", "a", "for", "printing", "purposes", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L524-L527
63,571
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.format
public static String format(boolean[] b, final String sep) { return (b == null) ? "null" : (b.length == 0) ? "" : // formatTo(new StringBuilder(), b, ", ").toString(); }
java
public static String format(boolean[] b, final String sep) { return (b == null) ? "null" : (b.length == 0) ? "" : // formatTo(new StringBuilder(), b, ", ").toString(); }
[ "public", "static", "String", "format", "(", "boolean", "[", "]", "b", ",", "final", "String", "sep", ")", "{", "return", "(", "b", "==", "null", ")", "?", "\"null\"", ":", "(", "b", ".", "length", "==", "0", ")", "?", "\"\"", ":", "//", "formatT...
Formats the boolean array b with ',' as separator. @param b the boolean array to be formatted @param sep separator between the single values of the array, e.g. ',' @return a String representing the boolean array b
[ "Formats", "the", "boolean", "array", "b", "with", "as", "separator", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L569-L572
63,572
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.format
public static String format(double[][] d) { return d == null ? "null" : (d.length == 0) ? "[]" : // formatTo(new StringBuilder().append("[\n"), d, " [", "]\n", ", ", NF2).append(']').toString(); }
java
public static String format(double[][] d) { return d == null ? "null" : (d.length == 0) ? "[]" : // formatTo(new StringBuilder().append("[\n"), d, " [", "]\n", ", ", NF2).append(']').toString(); }
[ "public", "static", "String", "format", "(", "double", "[", "]", "[", "]", "d", ")", "{", "return", "d", "==", "null", "?", "\"null\"", ":", "(", "d", ".", "length", "==", "0", ")", "?", "\"[]\"", ":", "//", "formatTo", "(", "new", "StringBuilder",...
Formats the double array d with ',' as separator and 2 fraction digits. @param d the double array to be formatted @return a String representing the double array d
[ "Formats", "the", "double", "array", "d", "with", "as", "separator", "and", "2", "fraction", "digits", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L615-L618
63,573
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.format
public static String format(double[][] m, int w, int d, String pre, String pos, String csep) { DecimalFormat format = new DecimalFormat(); format.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.US)); format.setMinimumIntegerDigits(1); format.setMaximumFractionDigits(d); format.setMinimumFrac...
java
public static String format(double[][] m, int w, int d, String pre, String pos, String csep) { DecimalFormat format = new DecimalFormat(); format.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.US)); format.setMinimumIntegerDigits(1); format.setMaximumFractionDigits(d); format.setMinimumFrac...
[ "public", "static", "String", "format", "(", "double", "[", "]", "[", "]", "m", ",", "int", "w", ",", "int", "d", ",", "String", "pre", ",", "String", "pos", ",", "String", "csep", ")", "{", "DecimalFormat", "format", "=", "new", "DecimalFormat", "("...
Returns a string representation of this matrix. @param w column width @param d number of digits after the decimal @param pre Row prefix (e.g. " [") @param pos Row postfix (e.g. "]\n") @param csep Column separator (e.g. ", ") @return a string representation of this matrix
[ "Returns", "a", "string", "representation", "of", "this", "matrix", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L646-L668
63,574
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.format
public static String format(double[][] m, NumberFormat nf) { return formatTo(new StringBuilder().append("[\n"), m, " [", "]\n", ", ", nf).append("]").toString(); }
java
public static String format(double[][] m, NumberFormat nf) { return formatTo(new StringBuilder().append("[\n"), m, " [", "]\n", ", ", nf).append("]").toString(); }
[ "public", "static", "String", "format", "(", "double", "[", "]", "[", "]", "m", ",", "NumberFormat", "nf", ")", "{", "return", "formatTo", "(", "new", "StringBuilder", "(", ")", ".", "append", "(", "\"[\\n\"", ")", ",", "m", ",", "\" [\"", ",", "\"]\...
returns String-representation of Matrix. @param nf NumberFormat to specify output precision @return String representation of this Matrix in precision as specified by given NumberFormat
[ "returns", "String", "-", "representation", "of", "Matrix", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L693-L695
63,575
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.format
public static String format(Collection<String> d, String sep) { if(d == null) { return "null"; } if(d.isEmpty()) { return ""; } if(d.size() == 1) { return d.iterator().next(); } int len = sep.length() * (d.size() - 1); for(String s : d) { len += s.length(); } ...
java
public static String format(Collection<String> d, String sep) { if(d == null) { return "null"; } if(d.isEmpty()) { return ""; } if(d.size() == 1) { return d.iterator().next(); } int len = sep.length() * (d.size() - 1); for(String s : d) { len += s.length(); } ...
[ "public", "static", "String", "format", "(", "Collection", "<", "String", ">", "d", ",", "String", "sep", ")", "{", "if", "(", "d", "==", "null", ")", "{", "return", "\"null\"", ";", "}", "if", "(", "d", ".", "isEmpty", "(", ")", ")", "{", "retur...
Formats the String collection with the specified separator. @param d the String collection to format @param sep separator between the single values of the array, e.g. ' ' @return a String representing the String Collection d
[ "Formats", "the", "String", "collection", "with", "the", "specified", "separator", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L704-L725
63,576
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.format
public static String format(String[] d, String sep) { if(d == null) { return "null"; } if(d.length == 0) { return ""; } if(d.length == 1) { return d[0]; } int len = sep.length() * (d.length - 1); for(String s : d) { len += s.length(); } StringBuilder buffe...
java
public static String format(String[] d, String sep) { if(d == null) { return "null"; } if(d.length == 0) { return ""; } if(d.length == 1) { return d[0]; } int len = sep.length() * (d.length - 1); for(String s : d) { len += s.length(); } StringBuilder buffe...
[ "public", "static", "String", "format", "(", "String", "[", "]", "d", ",", "String", "sep", ")", "{", "if", "(", "d", "==", "null", ")", "{", "return", "\"null\"", ";", "}", "if", "(", "d", ".", "length", "==", "0", ")", "{", "return", "\"\"", ...
Formats the string array d with the specified separator. @param d the string array to be formatted @param sep separator between the single values of the array, e.g. ',' @return a String representing the string array d
[ "Formats", "the", "string", "array", "d", "with", "the", "specified", "separator", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L734-L754
63,577
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.findSplitpoint
public static int findSplitpoint(String s, int width) { // the newline (or EOS) is the fallback split position. int in = s.indexOf(NEWLINE); in = in < 0 ? s.length() : in; // Good enough? if(in < width) { return in; } // otherwise, search for whitespace int iw = s.lastIndexOf(' ', ...
java
public static int findSplitpoint(String s, int width) { // the newline (or EOS) is the fallback split position. int in = s.indexOf(NEWLINE); in = in < 0 ? s.length() : in; // Good enough? if(in < width) { return in; } // otherwise, search for whitespace int iw = s.lastIndexOf(' ', ...
[ "public", "static", "int", "findSplitpoint", "(", "String", "s", ",", "int", "width", ")", "{", "// the newline (or EOS) is the fallback split position.", "int", "in", "=", "s", ".", "indexOf", "(", "NEWLINE", ")", ";", "in", "=", "in", "<", "0", "?", "s", ...
Find the first space before position w or if there is none after w. @param s String @param width Width @return index of best whitespace or <code>-1</code> if no whitespace was found.
[ "Find", "the", "first", "space", "before", "position", "w", "or", "if", "there", "is", "none", "after", "w", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L764-L785
63,578
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.splitAtLastBlank
public static List<String> splitAtLastBlank(String s, int width) { List<String> chunks = new ArrayList<>(); String tmp = s; while(tmp.length() > 0) { int index = findSplitpoint(tmp, width); // store first part chunks.add(tmp.substring(0, index)); // skip whitespace at beginning of l...
java
public static List<String> splitAtLastBlank(String s, int width) { List<String> chunks = new ArrayList<>(); String tmp = s; while(tmp.length() > 0) { int index = findSplitpoint(tmp, width); // store first part chunks.add(tmp.substring(0, index)); // skip whitespace at beginning of l...
[ "public", "static", "List", "<", "String", ">", "splitAtLastBlank", "(", "String", "s", ",", "int", "width", ")", "{", "List", "<", "String", ">", "chunks", "=", "new", "ArrayList", "<>", "(", ")", ";", "String", "tmp", "=", "s", ";", "while", "(", ...
Splits the specified string at the last blank before width. If there is no blank before the given width, it is split at the next. @param s the string to be split @param width int @return string fragments
[ "Splits", "the", "specified", "string", "at", "the", "last", "blank", "before", "width", ".", "If", "there", "is", "no", "blank", "before", "the", "given", "width", "it", "is", "split", "at", "the", "next", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L808-L831
63,579
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.pad
public static String pad(String o, int len) { return o.length() >= len ? o : (o + whitespace(len - o.length())); }
java
public static String pad(String o, int len) { return o.length() >= len ? o : (o + whitespace(len - o.length())); }
[ "public", "static", "String", "pad", "(", "String", "o", ",", "int", "len", ")", "{", "return", "o", ".", "length", "(", ")", ">=", "len", "?", "o", ":", "(", "o", "+", "whitespace", "(", "len", "-", "o", ".", "length", "(", ")", ")", ")", ";...
Pad a string to a given length by adding whitespace to the right. @param o original string @param len destination length @return padded string of at least length len (and o otherwise)
[ "Pad", "a", "string", "to", "a", "given", "length", "by", "adding", "whitespace", "to", "the", "right", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L869-L871
63,580
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.padRightAligned
public static String padRightAligned(String o, int len) { return o.length() >= len ? o : (whitespace(len - o.length()) + o); }
java
public static String padRightAligned(String o, int len) { return o.length() >= len ? o : (whitespace(len - o.length()) + o); }
[ "public", "static", "String", "padRightAligned", "(", "String", "o", ",", "int", "len", ")", "{", "return", "o", ".", "length", "(", ")", ">=", "len", "?", "o", ":", "(", "whitespace", "(", "len", "-", "o", ".", "length", "(", ")", ")", "+", "o",...
Pad a string to a given length by adding whitespace to the left. @param o original string @param len destination length @return padded string of at least length len (and o otherwise)
[ "Pad", "a", "string", "to", "a", "given", "length", "by", "adding", "whitespace", "to", "the", "left", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L880-L882
63,581
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.formatTimeDelta
public static String formatTimeDelta(long time, CharSequence sep) { final StringBuilder sb = new StringBuilder(); final Formatter fmt = new Formatter(sb); for(int i = TIME_UNIT_SIZES.length - 1; i >= 0; --i) { // We do not include ms if we are in the order of minutes. if(i == 0 && sb.length() >...
java
public static String formatTimeDelta(long time, CharSequence sep) { final StringBuilder sb = new StringBuilder(); final Formatter fmt = new Formatter(sb); for(int i = TIME_UNIT_SIZES.length - 1; i >= 0; --i) { // We do not include ms if we are in the order of minutes. if(i == 0 && sb.length() >...
[ "public", "static", "String", "formatTimeDelta", "(", "long", "time", ",", "CharSequence", "sep", ")", "{", "final", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "final", "Formatter", "fmt", "=", "new", "Formatter", "(", "sb", ")", ";...
Formats a time delta in human readable format. @param time time delta in ms @return Formatted string
[ "Formats", "a", "time", "delta", "in", "human", "readable", "format", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L935-L956
63,582
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.appendZeros
public static StringBuilder appendZeros(StringBuilder buf, int zeros) { for(int i = zeros; i > 0; i -= ZEROPADDING.length) { buf.append(ZEROPADDING, 0, i < ZEROPADDING.length ? i : ZEROPADDING.length); } return buf; }
java
public static StringBuilder appendZeros(StringBuilder buf, int zeros) { for(int i = zeros; i > 0; i -= ZEROPADDING.length) { buf.append(ZEROPADDING, 0, i < ZEROPADDING.length ? i : ZEROPADDING.length); } return buf; }
[ "public", "static", "StringBuilder", "appendZeros", "(", "StringBuilder", "buf", ",", "int", "zeros", ")", "{", "for", "(", "int", "i", "=", "zeros", ";", "i", ">", "0", ";", "i", "-=", "ZEROPADDING", ".", "length", ")", "{", "buf", ".", "append", "(...
Append zeros to a buffer. @param buf Buffer to append to @param zeros Number of zeros to append. @return Buffer
[ "Append", "zeros", "to", "a", "buffer", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L975-L980
63,583
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java
FormatUtil.appendSpace
public static StringBuilder appendSpace(StringBuilder buf, int spaces) { for(int i = spaces; i > 0; i -= SPACEPADDING.length) { buf.append(SPACEPADDING, 0, i < SPACEPADDING.length ? i : SPACEPADDING.length); } return buf; }
java
public static StringBuilder appendSpace(StringBuilder buf, int spaces) { for(int i = spaces; i > 0; i -= SPACEPADDING.length) { buf.append(SPACEPADDING, 0, i < SPACEPADDING.length ? i : SPACEPADDING.length); } return buf; }
[ "public", "static", "StringBuilder", "appendSpace", "(", "StringBuilder", "buf", ",", "int", "spaces", ")", "{", "for", "(", "int", "i", "=", "spaces", ";", "i", ">", "0", ";", "i", "-=", "SPACEPADDING", ".", "length", ")", "{", "buf", ".", "append", ...
Append whitespace to a buffer. @param buf Buffer to append to @param spaces Number of spaces to append. @return Buffer
[ "Append", "whitespace", "to", "a", "buffer", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L989-L994
63,584
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/optics/AbstractOPTICSVisualization.java
AbstractOPTICSVisualization.makeLayerElement
protected void makeLayerElement() { plotwidth = StyleLibrary.SCALE; plotheight = StyleLibrary.SCALE / optics.getOPTICSPlot(context).getRatio(); final double margin = context.getStyleLibrary().getSize(StyleLibrary.MARGIN); layer = SVGUtil.svgElement(svgp.getDocument(), SVGConstants.SVG_G_TAG); final ...
java
protected void makeLayerElement() { plotwidth = StyleLibrary.SCALE; plotheight = StyleLibrary.SCALE / optics.getOPTICSPlot(context).getRatio(); final double margin = context.getStyleLibrary().getSize(StyleLibrary.MARGIN); layer = SVGUtil.svgElement(svgp.getDocument(), SVGConstants.SVG_G_TAG); final ...
[ "protected", "void", "makeLayerElement", "(", ")", "{", "plotwidth", "=", "StyleLibrary", ".", "SCALE", ";", "plotheight", "=", "StyleLibrary", ".", "SCALE", "/", "optics", ".", "getOPTICSPlot", "(", "context", ")", ".", "getRatio", "(", ")", ";", "final", ...
Produce a new layer element.
[ "Produce", "a", "new", "layer", "element", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/optics/AbstractOPTICSVisualization.java#L77-L84
63,585
elki-project/elki
elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/LinearDiscriminantAnalysisFilter.java
LinearDiscriminantAnalysisFilter.computeCentroids
protected List<Centroid> computeCentroids(int dim, List<V> vectorcolumn, List<ClassLabel> keys, Map<ClassLabel, IntList> classes) { final int numc = keys.size(); List<Centroid> centroids = new ArrayList<>(numc); for(int i = 0; i < numc; i++) { Centroid c = new Centroid(dim); for(IntIterator it =...
java
protected List<Centroid> computeCentroids(int dim, List<V> vectorcolumn, List<ClassLabel> keys, Map<ClassLabel, IntList> classes) { final int numc = keys.size(); List<Centroid> centroids = new ArrayList<>(numc); for(int i = 0; i < numc; i++) { Centroid c = new Centroid(dim); for(IntIterator it =...
[ "protected", "List", "<", "Centroid", ">", "computeCentroids", "(", "int", "dim", ",", "List", "<", "V", ">", "vectorcolumn", ",", "List", "<", "ClassLabel", ">", "keys", ",", "Map", "<", "ClassLabel", ",", "IntList", ">", "classes", ")", "{", "final", ...
Compute the centroid for each class. @param dim Dimensionality @param vectorcolumn Vector column @param keys Key index @param classes Classes @return Centroids for each class.
[ "Compute", "the", "centroid", "for", "each", "class", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/LinearDiscriminantAnalysisFilter.java#L126-L137
63,586
elki-project/elki
elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkmax/MkMaxTreeNode.java
MkMaxTreeNode.kNNDistance
protected double kNNDistance() { double knnDist = 0.; for(int i = 0; i < getNumEntries(); i++) { MkMaxEntry entry = getEntry(i); knnDist = Math.max(knnDist, entry.getKnnDistance()); } return knnDist; }
java
protected double kNNDistance() { double knnDist = 0.; for(int i = 0; i < getNumEntries(); i++) { MkMaxEntry entry = getEntry(i); knnDist = Math.max(knnDist, entry.getKnnDistance()); } return knnDist; }
[ "protected", "double", "kNNDistance", "(", ")", "{", "double", "knnDist", "=", "0.", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "getNumEntries", "(", ")", ";", "i", "++", ")", "{", "MkMaxEntry", "entry", "=", "getEntry", "(", "i", ")", ...
Determines and returns the k-nearest neighbor distance of this node as the maximum of the k-nearest neighbor distances of all entries. @return the knn distance of this node
[ "Determines", "and", "returns", "the", "k", "-", "nearest", "neighbor", "distance", "of", "this", "node", "as", "the", "maximum", "of", "the", "k", "-", "nearest", "neighbor", "distances", "of", "all", "entries", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkmax/MkMaxTreeNode.java#L67-L74
63,587
elki-project/elki
elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkmax/MkMaxTreeNode.java
MkMaxTreeNode.adjustEntry
@Override public boolean adjustEntry(MkMaxEntry entry, DBID routingObjectID, double parentDistance, AbstractMTree<O, MkMaxTreeNode<O>, MkMaxEntry, ?> mTree) { super.adjustEntry(entry, routingObjectID, parentDistance, mTree); // adjust knn distance entry.setKnnDistance(kNNDistance()); return true; // T...
java
@Override public boolean adjustEntry(MkMaxEntry entry, DBID routingObjectID, double parentDistance, AbstractMTree<O, MkMaxTreeNode<O>, MkMaxEntry, ?> mTree) { super.adjustEntry(entry, routingObjectID, parentDistance, mTree); // adjust knn distance entry.setKnnDistance(kNNDistance()); return true; // T...
[ "@", "Override", "public", "boolean", "adjustEntry", "(", "MkMaxEntry", "entry", ",", "DBID", "routingObjectID", ",", "double", "parentDistance", ",", "AbstractMTree", "<", "O", ",", "MkMaxTreeNode", "<", "O", ">", ",", "MkMaxEntry", ",", "?", ">", "mTree", ...
Calls the super method and adjust additionally the k-nearest neighbor distance of this node as the maximum of the k-nearest neighbor distances of all its entries.
[ "Calls", "the", "super", "method", "and", "adjust", "additionally", "the", "k", "-", "nearest", "neighbor", "distance", "of", "this", "node", "as", "the", "maximum", "of", "the", "k", "-", "nearest", "neighbor", "distances", "of", "all", "its", "entries", ...
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkmax/MkMaxTreeNode.java#L81-L87
63,588
elki-project/elki
elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkmax/MkMaxTreeNode.java
MkMaxTreeNode.integrityCheckParameters
@Override protected void integrityCheckParameters(MkMaxEntry parentEntry, MkMaxTreeNode<O> parent, int index, AbstractMTree<O, MkMaxTreeNode<O>, MkMaxEntry, ?> mTree) { super.integrityCheckParameters(parentEntry, parent, index, mTree); // test if knn distance is correctly set MkMaxEntry entry = parent.get...
java
@Override protected void integrityCheckParameters(MkMaxEntry parentEntry, MkMaxTreeNode<O> parent, int index, AbstractMTree<O, MkMaxTreeNode<O>, MkMaxEntry, ?> mTree) { super.integrityCheckParameters(parentEntry, parent, index, mTree); // test if knn distance is correctly set MkMaxEntry entry = parent.get...
[ "@", "Override", "protected", "void", "integrityCheckParameters", "(", "MkMaxEntry", "parentEntry", ",", "MkMaxTreeNode", "<", "O", ">", "parent", ",", "int", "index", ",", "AbstractMTree", "<", "O", ",", "MkMaxTreeNode", "<", "O", ">", ",", "MkMaxEntry", ",",...
Calls the super method and tests if the k-nearest neighbor distance of this node is correctly set.
[ "Calls", "the", "super", "method", "and", "tests", "if", "the", "k", "-", "nearest", "neighbor", "distance", "of", "this", "node", "is", "correctly", "set", "." ]
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/mkmax/MkMaxTreeNode.java#L93-L102
63,589
elki-project/elki
elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/StaticArrayDatabase.java
StaticArrayDatabase.initialize
@Override public void initialize() { if(databaseConnection == null) { return; // Supposedly we initialized already. } if(LOG.isDebugging()) { LOG.debugFine("Loading data from database connection."); } MultipleObjectsBundle bundle = databaseConnection.loadData(); // Run at most once...
java
@Override public void initialize() { if(databaseConnection == null) { return; // Supposedly we initialized already. } if(LOG.isDebugging()) { LOG.debugFine("Loading data from database connection."); } MultipleObjectsBundle bundle = databaseConnection.loadData(); // Run at most once...
[ "@", "Override", "public", "void", "initialize", "(", ")", "{", "if", "(", "databaseConnection", "==", "null", ")", "{", "return", ";", "// Supposedly we initialized already.", "}", "if", "(", "LOG", ".", "isDebugging", "(", ")", ")", "{", "LOG", ".", "deb...
Initialize the database by getting the initial data from the database connection.
[ "Initialize", "the", "database", "by", "getting", "the", "initial", "data", "from", "the", "database", "connection", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/StaticArrayDatabase.java#L114-L180
63,590
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/spacefillingcurves/ZCurveSpatialSorter.java
ZCurveSpatialSorter.zSort
protected void zSort(List<? extends SpatialComparable> objs, int start, int end, double[] mms, int[] dims, int depth) { final int numdim = (dims != null) ? dims.length : (mms.length >> 1); final int edim = (dims != null) ? dims[depth] : depth; // Find the splitting points. final double min = mms[2 * edi...
java
protected void zSort(List<? extends SpatialComparable> objs, int start, int end, double[] mms, int[] dims, int depth) { final int numdim = (dims != null) ? dims.length : (mms.length >> 1); final int edim = (dims != null) ? dims[depth] : depth; // Find the splitting points. final double min = mms[2 * edi...
[ "protected", "void", "zSort", "(", "List", "<", "?", "extends", "SpatialComparable", ">", "objs", ",", "int", "start", ",", "int", "end", ",", "double", "[", "]", "mms", ",", "int", "[", "]", "dims", ",", "int", "depth", ")", "{", "final", "int", "...
The actual Z sorting function @param objs Objects to sort @param start Start @param end End @param mms Min-Max value ranges @param dims Dimensions to process @param depth Current dimension
[ "The", "actual", "Z", "sorting", "function" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/spacefillingcurves/ZCurveSpatialSorter.java#L68-L104
63,591
elki-project/elki
elki-timeseries/src/main/java/de/lmu/ifi/dbs/elki/algorithm/timeseries/ChangePoint.java
ChangePoint.appendTo
public StringBuilder appendTo(StringBuilder buf) { return buf.append(DBIDUtil.toString((DBIDRef) id)).append(" ").append(column).append(" ").append(score); }
java
public StringBuilder appendTo(StringBuilder buf) { return buf.append(DBIDUtil.toString((DBIDRef) id)).append(" ").append(column).append(" ").append(score); }
[ "public", "StringBuilder", "appendTo", "(", "StringBuilder", "buf", ")", "{", "return", "buf", ".", "append", "(", "DBIDUtil", ".", "toString", "(", "(", "DBIDRef", ")", "id", ")", ")", ".", "append", "(", "\" \"", ")", ".", "append", "(", "column", ")...
Append to a text buffer. @param buf Text buffer @return Text buffer
[ "Append", "to", "a", "text", "buffer", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-timeseries/src/main/java/de/lmu/ifi/dbs/elki/algorithm/timeseries/ChangePoint.java#L69-L71
63,592
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/DOC.java
DOC.runDOC
protected Cluster<SubspaceModel> runDOC(Database database, Relation<V> relation, ArrayModifiableDBIDs S, final int d, int n, int m, int r, int minClusterSize) { // Best cluster for the current run. DBIDs C = null; // Relevant attributes for the best cluster. long[] D = null; // Quality of the best c...
java
protected Cluster<SubspaceModel> runDOC(Database database, Relation<V> relation, ArrayModifiableDBIDs S, final int d, int n, int m, int r, int minClusterSize) { // Best cluster for the current run. DBIDs C = null; // Relevant attributes for the best cluster. long[] D = null; // Quality of the best c...
[ "protected", "Cluster", "<", "SubspaceModel", ">", "runDOC", "(", "Database", "database", ",", "Relation", "<", "V", ">", "relation", ",", "ArrayModifiableDBIDs", "S", ",", "final", "int", "d", ",", "int", "n", ",", "int", "m", ",", "int", "r", ",", "i...
Performs a single run of DOC, finding a single cluster. @param database Database context @param relation used to get actual values for DBIDs. @param S The set of points we're working on. @param d Dimensionality of the data set we're currently working on. @param r Size of random samples. @param m Number of inner iterat...
[ "Performs", "a", "single", "run", "of", "DOC", "finding", "a", "single", "cluster", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/DOC.java#L197-L269
63,593
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/DOC.java
DOC.findNeighbors
protected DBIDs findNeighbors(DBIDRef q, long[] nD, ArrayModifiableDBIDs S, Relation<V> relation) { // Weights for distance (= rectangle query) DistanceQuery<V> dq = relation.getDistanceQuery(new SubspaceMaximumDistanceFunction(nD)); // TODO: add filtering capabilities into query API! // Until then, us...
java
protected DBIDs findNeighbors(DBIDRef q, long[] nD, ArrayModifiableDBIDs S, Relation<V> relation) { // Weights for distance (= rectangle query) DistanceQuery<V> dq = relation.getDistanceQuery(new SubspaceMaximumDistanceFunction(nD)); // TODO: add filtering capabilities into query API! // Until then, us...
[ "protected", "DBIDs", "findNeighbors", "(", "DBIDRef", "q", ",", "long", "[", "]", "nD", ",", "ArrayModifiableDBIDs", "S", ",", "Relation", "<", "V", ">", "relation", ")", "{", "// Weights for distance (= rectangle query)", "DistanceQuery", "<", "V", ">", "dq", ...
Find the neighbors of point q in the given subspace @param q Query point @param nD Subspace mask @param S Remaining data points @param relation Data relation @return Neighbors
[ "Find", "the", "neighbors", "of", "point", "q", "in", "the", "given", "subspace" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/DOC.java#L280-L294
63,594
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/DOC.java
DOC.makeCluster
protected Cluster<SubspaceModel> makeCluster(Relation<V> relation, DBIDs C, long[] D) { DBIDs ids = DBIDUtil.newHashSet(C); // copy, also to lose distance values! Cluster<SubspaceModel> cluster = new Cluster<>(ids); cluster.setModel(new SubspaceModel(new Subspace(D), Centroid.make(relation, ids).getArrayRef...
java
protected Cluster<SubspaceModel> makeCluster(Relation<V> relation, DBIDs C, long[] D) { DBIDs ids = DBIDUtil.newHashSet(C); // copy, also to lose distance values! Cluster<SubspaceModel> cluster = new Cluster<>(ids); cluster.setModel(new SubspaceModel(new Subspace(D), Centroid.make(relation, ids).getArrayRef...
[ "protected", "Cluster", "<", "SubspaceModel", ">", "makeCluster", "(", "Relation", "<", "V", ">", "relation", ",", "DBIDs", "C", ",", "long", "[", "]", "D", ")", "{", "DBIDs", "ids", "=", "DBIDUtil", ".", "newHashSet", "(", "C", ")", ";", "// copy, als...
Utility method to create a subspace cluster from a list of DBIDs and the relevant attributes. @param relation to compute a centroid. @param C the cluster points. @param D the relevant dimensions. @return an object representing the subspace cluster.
[ "Utility", "method", "to", "create", "a", "subspace", "cluster", "from", "a", "list", "of", "DBIDs", "and", "the", "relevant", "attributes", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/DOC.java#L328-L333
63,595
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/visunproj/KeyVisualization.java
KeyVisualization.findDepth
protected static <M extends Model> int[] findDepth(Clustering<M> c) { final Hierarchy<Cluster<M>> hier = c.getClusterHierarchy(); int[] size = { 0, 0 }; for(It<Cluster<M>> iter = c.iterToplevelClusters(); iter.valid(); iter.advance()) { findDepth(hier, iter.get(), size); } return size; }
java
protected static <M extends Model> int[] findDepth(Clustering<M> c) { final Hierarchy<Cluster<M>> hier = c.getClusterHierarchy(); int[] size = { 0, 0 }; for(It<Cluster<M>> iter = c.iterToplevelClusters(); iter.valid(); iter.advance()) { findDepth(hier, iter.get(), size); } return size; }
[ "protected", "static", "<", "M", "extends", "Model", ">", "int", "[", "]", "findDepth", "(", "Clustering", "<", "M", ">", "c", ")", "{", "final", "Hierarchy", "<", "Cluster", "<", "M", ">", ">", "hier", "=", "c", ".", "getClusterHierarchy", "(", ")",...
Compute the size of the clustering. @param c Clustering @return Array storing the depth and the number of leaf nodes.
[ "Compute", "the", "size", "of", "the", "clustering", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/visunproj/KeyVisualization.java#L93-L100
63,596
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/visunproj/KeyVisualization.java
KeyVisualization.findDepth
private static <M extends Model> void findDepth(Hierarchy<Cluster<M>> hier, Cluster<M> cluster, int[] size) { if(hier.numChildren(cluster) > 0) { for(It<Cluster<M>> iter = hier.iterChildren(cluster); iter.valid(); iter.advance()) { findDepth(hier, iter.get(), size); } size[0] += 1; // Dept...
java
private static <M extends Model> void findDepth(Hierarchy<Cluster<M>> hier, Cluster<M> cluster, int[] size) { if(hier.numChildren(cluster) > 0) { for(It<Cluster<M>> iter = hier.iterChildren(cluster); iter.valid(); iter.advance()) { findDepth(hier, iter.get(), size); } size[0] += 1; // Dept...
[ "private", "static", "<", "M", "extends", "Model", ">", "void", "findDepth", "(", "Hierarchy", "<", "Cluster", "<", "M", ">", ">", "hier", ",", "Cluster", "<", "M", ">", "cluster", ",", "int", "[", "]", "size", ")", "{", "if", "(", "hier", ".", "...
Recursive depth computation. @param hier Hierarchy @param cluster Current cluster @param size Counting array.
[ "Recursive", "depth", "computation", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/visunproj/KeyVisualization.java#L109-L119
63,597
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/visunproj/KeyVisualization.java
KeyVisualization.getPreferredColumns
protected static int getPreferredColumns(double width, double height, int numc, double maxwidth) { // Maximum width (compared to height) of labels - guess. // FIXME: do we really need to do this three-step computation? // Number of rows we'd use in a squared layout: final double rows = Math.ceil(FastMat...
java
protected static int getPreferredColumns(double width, double height, int numc, double maxwidth) { // Maximum width (compared to height) of labels - guess. // FIXME: do we really need to do this three-step computation? // Number of rows we'd use in a squared layout: final double rows = Math.ceil(FastMat...
[ "protected", "static", "int", "getPreferredColumns", "(", "double", "width", ",", "double", "height", ",", "int", "numc", ",", "double", "maxwidth", ")", "{", "// Maximum width (compared to height) of labels - guess.", "// FIXME: do we really need to do this three-step computat...
Compute the preferred number of columns. @param width Target width @param height Target height @param numc Number of clusters @param maxwidth Max width of entries @return Preferred number of columns
[ "Compute", "the", "preferred", "number", "of", "columns", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/visunproj/KeyVisualization.java#L130-L137
63,598
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIBuilder.java
ELKIBuilder.with
public ELKIBuilder<T> with(String opt, Object value) { p.addParameter(opt, value); return this; }
java
public ELKIBuilder<T> with(String opt, Object value) { p.addParameter(opt, value); return this; }
[ "public", "ELKIBuilder", "<", "T", ">", "with", "(", "String", "opt", ",", "Object", "value", ")", "{", "p", ".", "addParameter", "(", "opt", ",", "value", ")", ";", "return", "this", ";", "}" ]
Add an option to the builder. @param opt Option ID (usually found in the Parameterizer class) @param value Value @return The same builder
[ "Add", "an", "option", "to", "the", "builder", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIBuilder.java#L130-L133
63,599
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIBuilder.java
ELKIBuilder.build
@SuppressWarnings("unchecked") public <C extends T> C build() { if(p == null) { throw new AbortException("build() may be called only once."); } final T obj = ClassGenericsUtil.parameterizeOrAbort(clazz, p); if(p.hasUnusedParameters()) { LOG.warning("Unused parameters: " + p.getRemainingPar...
java
@SuppressWarnings("unchecked") public <C extends T> C build() { if(p == null) { throw new AbortException("build() may be called only once."); } final T obj = ClassGenericsUtil.parameterizeOrAbort(clazz, p); if(p.hasUnusedParameters()) { LOG.warning("Unused parameters: " + p.getRemainingPar...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "C", "extends", "T", ">", "C", "build", "(", ")", "{", "if", "(", "p", "==", "null", ")", "{", "throw", "new", "AbortException", "(", "\"build() may be called only once.\"", ")", ";", "}", ...
Instantiate, consuming the parameter list. This will throw an {@link AbortException} if the parameters are incomplete, or {@code build()} is called twice. We lose some type safety here, for convenience. The type {@code <C>} is meant to be {@code <T>} with generics added only, which is necessary because generics are i...
[ "Instantiate", "consuming", "the", "parameter", "list", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIBuilder.java#L159-L170