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,700 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java | SVGPath.relativeSmoothQuadTo | public SVGPath relativeSmoothQuadTo(double x, double y) {
return append(PATH_SMOOTH_QUAD_TO_RELATIVE).append(x).append(y);
} | java | public SVGPath relativeSmoothQuadTo(double x, double y) {
return append(PATH_SMOOTH_QUAD_TO_RELATIVE).append(x).append(y);
} | [
"public",
"SVGPath",
"relativeSmoothQuadTo",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"return",
"append",
"(",
"PATH_SMOOTH_QUAD_TO_RELATIVE",
")",
".",
"append",
"(",
"x",
")",
".",
"append",
"(",
"y",
")",
";",
"}"
] | Smooth quadratic Bezier line to the given relative coordinates.
@param x new coordinates
@param y new coordinates
@return path object, for compact syntax. | [
"Smooth",
"quadratic",
"Bezier",
"line",
"to",
"the",
"given",
"relative",
"coordinates",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java#L524-L526 |
63,701 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java | SVGPath.append | private SVGPath append(char action) {
assert lastaction != 0 || action == PATH_MOVE : "Paths must begin with a move to the initial position!";
if(lastaction != action) {
buf.append(action);
lastaction = action;
}
return this;
} | java | private SVGPath append(char action) {
assert lastaction != 0 || action == PATH_MOVE : "Paths must begin with a move to the initial position!";
if(lastaction != action) {
buf.append(action);
lastaction = action;
}
return this;
} | [
"private",
"SVGPath",
"append",
"(",
"char",
"action",
")",
"{",
"assert",
"lastaction",
"!=",
"0",
"||",
"action",
"==",
"PATH_MOVE",
":",
"\"Paths must begin with a move to the initial position!\"",
";",
"if",
"(",
"lastaction",
"!=",
"action",
")",
"{",
"buf",
... | Append an action to the current path.
@param action Current action | [
"Append",
"an",
"action",
"to",
"the",
"current",
"path",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java#L627-L634 |
63,702 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java | SVGPath.append | private SVGPath append(double x) {
if(!Double.isFinite(x)) {
throw new IllegalArgumentException("Cannot draw an infinite/NaN position.");
}
if(x >= 0) {
final int l = buf.length();
if(l > 0) {
char c = buf.charAt(l - 1);
assert c != 'e' && c != 'E' : "Invalid exponential in... | java | private SVGPath append(double x) {
if(!Double.isFinite(x)) {
throw new IllegalArgumentException("Cannot draw an infinite/NaN position.");
}
if(x >= 0) {
final int l = buf.length();
if(l > 0) {
char c = buf.charAt(l - 1);
assert c != 'e' && c != 'E' : "Invalid exponential in... | [
"private",
"SVGPath",
"append",
"(",
"double",
"x",
")",
"{",
"if",
"(",
"!",
"Double",
".",
"isFinite",
"(",
"x",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot draw an infinite/NaN position.\"",
")",
";",
"}",
"if",
"(",
"x",
"... | Append a value to the current path.
@param x coordinate. | [
"Append",
"a",
"value",
"to",
"the",
"current",
"path",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java#L641-L656 |
63,703 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java | SVGPath.close | public SVGPath close() {
assert lastaction != 0 : "Paths must begin with a move to the initial position!";
if(lastaction != PATH_CLOSE) {
buf.append(' ').append(PATH_CLOSE);
lastaction = PATH_CLOSE;
}
return this;
} | java | public SVGPath close() {
assert lastaction != 0 : "Paths must begin with a move to the initial position!";
if(lastaction != PATH_CLOSE) {
buf.append(' ').append(PATH_CLOSE);
lastaction = PATH_CLOSE;
}
return this;
} | [
"public",
"SVGPath",
"close",
"(",
")",
"{",
"assert",
"lastaction",
"!=",
"0",
":",
"\"Paths must begin with a move to the initial position!\"",
";",
"if",
"(",
"lastaction",
"!=",
"PATH_CLOSE",
")",
"{",
"buf",
".",
"append",
"(",
"'",
"'",
")",
".",
"append... | Close the path.
@return path object, for compact syntax. | [
"Close",
"the",
"path",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java#L663-L670 |
63,704 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java | SVGPath.makeElement | public Element makeElement(SVGPlot plot) {
Element elem = plot.svgElement(SVGConstants.SVG_PATH_TAG);
elem.setAttribute(SVGConstants.SVG_D_ATTRIBUTE, buf.toString());
return elem;
} | java | public Element makeElement(SVGPlot plot) {
Element elem = plot.svgElement(SVGConstants.SVG_PATH_TAG);
elem.setAttribute(SVGConstants.SVG_D_ATTRIBUTE, buf.toString());
return elem;
} | [
"public",
"Element",
"makeElement",
"(",
"SVGPlot",
"plot",
")",
"{",
"Element",
"elem",
"=",
"plot",
".",
"svgElement",
"(",
"SVGConstants",
".",
"SVG_PATH_TAG",
")",
";",
"elem",
".",
"setAttribute",
"(",
"SVGConstants",
".",
"SVG_D_ATTRIBUTE",
",",
"buf",
... | Turn the path buffer into an SVG element.
@param plot Plot context (= element factory)
@return SVG Element | [
"Turn",
"the",
"path",
"buffer",
"into",
"an",
"SVG",
"element",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java#L678-L682 |
63,705 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/multistep/MultiStepGUI.java | MultiStepGUI.setParameters | public void setParameters(Parameterization config) {
// Clear errors after each step, so they don't consider themselves failed
// because of earlier errors.
logTab.setParameters(config);
// config.clearErrors();
inputTab.setParameters(config);
// config.clearErrors();
algTab.setParameters(co... | java | public void setParameters(Parameterization config) {
// Clear errors after each step, so they don't consider themselves failed
// because of earlier errors.
logTab.setParameters(config);
// config.clearErrors();
inputTab.setParameters(config);
// config.clearErrors();
algTab.setParameters(co... | [
"public",
"void",
"setParameters",
"(",
"Parameterization",
"config",
")",
"{",
"// Clear errors after each step, so they don't consider themselves failed",
"// because of earlier errors.",
"logTab",
".",
"setParameters",
"(",
"config",
")",
";",
"// config.clearErrors();",
"inpu... | Set the parameters.
@param config Parameterization | [
"Set",
"the",
"parameters",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/multistep/MultiStepGUI.java#L203-L216 |
63,706 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/multistep/MultiStepGUI.java | MultiStepGUI.serializeParameters | public ArrayList<String> serializeParameters() {
ListParameterization params = new ListParameterization();
logTab.appendParameters(params);
inputTab.appendParameters(params);
algTab.appendParameters(params);
evalTab.appendParameters(params);
outTab.appendParameters(params);
return params.ser... | java | public ArrayList<String> serializeParameters() {
ListParameterization params = new ListParameterization();
logTab.appendParameters(params);
inputTab.appendParameters(params);
algTab.appendParameters(params);
evalTab.appendParameters(params);
outTab.appendParameters(params);
return params.ser... | [
"public",
"ArrayList",
"<",
"String",
">",
"serializeParameters",
"(",
")",
"{",
"ListParameterization",
"params",
"=",
"new",
"ListParameterization",
"(",
")",
";",
"logTab",
".",
"appendParameters",
"(",
"params",
")",
";",
"inputTab",
".",
"appendParameters",
... | Get the serialized parameters
@return Serialized parameters | [
"Get",
"the",
"serialized",
"parameters"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/multistep/MultiStepGUI.java#L223-L231 |
63,707 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/multistep/MultiStepGUI.java | MultiStepGUI.main | public static void main(final String[] args) {
GUIUtil.logUncaughtExceptions(LOG);
GUIUtil.setLookAndFeel();
OutputStep.setDefaultHandlerVisualizer();
javax.swing.SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
try {
final MultiStepGUI gui = new M... | java | public static void main(final String[] args) {
GUIUtil.logUncaughtExceptions(LOG);
GUIUtil.setLookAndFeel();
OutputStep.setDefaultHandlerVisualizer();
javax.swing.SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
try {
final MultiStepGUI gui = new M... | [
"public",
"static",
"void",
"main",
"(",
"final",
"String",
"[",
"]",
"args",
")",
"{",
"GUIUtil",
".",
"logUncaughtExceptions",
"(",
"LOG",
")",
";",
"GUIUtil",
".",
"setLookAndFeel",
"(",
")",
";",
"OutputStep",
".",
"setDefaultHandlerVisualizer",
"(",
")"... | Main method that just spawns the UI.
@param args command line parameters | [
"Main",
"method",
"that",
"just",
"spawns",
"the",
"UI",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/multistep/MultiStepGUI.java#L244-L269 |
63,708 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/statistics/EvaluateRetrievalPerformance.java | EvaluateRetrievalPerformance.match | protected static boolean match(Object ref, Object test) {
if(ref == null) {
return false;
}
// Cheap and fast, may hold for class labels!
if(ref == test) {
return true;
}
if(ref instanceof LabelList && test instanceof LabelList) {
final LabelList lref = (LabelList) ref;
f... | java | protected static boolean match(Object ref, Object test) {
if(ref == null) {
return false;
}
// Cheap and fast, may hold for class labels!
if(ref == test) {
return true;
}
if(ref instanceof LabelList && test instanceof LabelList) {
final LabelList lref = (LabelList) ref;
f... | [
"protected",
"static",
"boolean",
"match",
"(",
"Object",
"ref",
",",
"Object",
"test",
")",
"{",
"if",
"(",
"ref",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"// Cheap and fast, may hold for class labels!",
"if",
"(",
"ref",
"==",
"test",
")",
"... | Test whether two relation agree.
@param ref Reference object
@param test Test object
@return {@code true} if the objects match | [
"Test",
"whether",
"two",
"relation",
"agree",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/statistics/EvaluateRetrievalPerformance.java#L189-L218 |
63,709 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/statistics/EvaluateRetrievalPerformance.java | EvaluateRetrievalPerformance.findMatches | private void findMatches(ModifiableDBIDs posn, Relation<?> lrelation, Object label) {
posn.clear();
for(DBIDIter ri = lrelation.iterDBIDs(); ri.valid(); ri.advance()) {
if(match(label, lrelation.get(ri))) {
posn.add(ri);
}
}
} | java | private void findMatches(ModifiableDBIDs posn, Relation<?> lrelation, Object label) {
posn.clear();
for(DBIDIter ri = lrelation.iterDBIDs(); ri.valid(); ri.advance()) {
if(match(label, lrelation.get(ri))) {
posn.add(ri);
}
}
} | [
"private",
"void",
"findMatches",
"(",
"ModifiableDBIDs",
"posn",
",",
"Relation",
"<",
"?",
">",
"lrelation",
",",
"Object",
"label",
")",
"{",
"posn",
".",
"clear",
"(",
")",
";",
"for",
"(",
"DBIDIter",
"ri",
"=",
"lrelation",
".",
"iterDBIDs",
"(",
... | Find all matching objects.
@param posn Output set.
@param lrelation Label relation
@param label Query object label | [
"Find",
"all",
"matching",
"objects",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/statistics/EvaluateRetrievalPerformance.java#L227-L234 |
63,710 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/statistics/EvaluateRetrievalPerformance.java | EvaluateRetrievalPerformance.computeDistances | private void computeDistances(ModifiableDoubleDBIDList nlist, DBIDIter query, final DistanceQuery<O> distQuery, Relation<O> relation) {
nlist.clear();
O qo = relation.get(query);
for(DBIDIter ri = relation.iterDBIDs(); ri.valid(); ri.advance()) {
if(!includeSelf && DBIDUtil.equal(ri, query)) {
... | java | private void computeDistances(ModifiableDoubleDBIDList nlist, DBIDIter query, final DistanceQuery<O> distQuery, Relation<O> relation) {
nlist.clear();
O qo = relation.get(query);
for(DBIDIter ri = relation.iterDBIDs(); ri.valid(); ri.advance()) {
if(!includeSelf && DBIDUtil.equal(ri, query)) {
... | [
"private",
"void",
"computeDistances",
"(",
"ModifiableDoubleDBIDList",
"nlist",
",",
"DBIDIter",
"query",
",",
"final",
"DistanceQuery",
"<",
"O",
">",
"distQuery",
",",
"Relation",
"<",
"O",
">",
"relation",
")",
"{",
"nlist",
".",
"clear",
"(",
")",
";",
... | Compute the distances to the neighbor objects.
@param nlist Neighbor list (output)
@param query Query object
@param distQuery Distance function
@param relation Data relation | [
"Compute",
"the",
"distances",
"to",
"the",
"neighbor",
"objects",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/statistics/EvaluateRetrievalPerformance.java#L244-L258 |
63,711 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/result/textwriter/MultipleFilesOutput.java | MultipleFilesOutput.newStream | private PrintStream newStream(String name) throws IOException {
if(LOG.isDebuggingFiner()) {
LOG.debugFiner("Requested stream: " + name);
}
// Ensure the directory exists:
if(!basename.exists()) {
basename.mkdirs();
}
String fn = basename.getAbsolutePath() + File.separator + name + E... | java | private PrintStream newStream(String name) throws IOException {
if(LOG.isDebuggingFiner()) {
LOG.debugFiner("Requested stream: " + name);
}
// Ensure the directory exists:
if(!basename.exists()) {
basename.mkdirs();
}
String fn = basename.getAbsolutePath() + File.separator + name + E... | [
"private",
"PrintStream",
"newStream",
"(",
"String",
"name",
")",
"throws",
"IOException",
"{",
"if",
"(",
"LOG",
".",
"isDebuggingFiner",
"(",
")",
")",
"{",
"LOG",
".",
"debugFiner",
"(",
"\"Requested stream: \"",
"+",
"name",
")",
";",
"}",
"// Ensure th... | Open a new stream of the given name
@param name file name (which will be appended to the base name)
@return stream object for the given name
@throws IOException | [
"Open",
"a",
"new",
"stream",
"of",
"the",
"given",
"name"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/result/textwriter/MultipleFilesOutput.java#L91-L112 |
63,712 | elki-project/elki | elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/PagedIndexFactory.java | PagedIndexFactory.makePageFile | protected <N extends Page & Externalizable> PageFile<N> makePageFile(Class<N> cls) {
@SuppressWarnings("unchecked")
final PageFileFactory<N> castFactory = (PageFileFactory<N>) pageFileFactory;
return castFactory.newPageFile(cls);
} | java | protected <N extends Page & Externalizable> PageFile<N> makePageFile(Class<N> cls) {
@SuppressWarnings("unchecked")
final PageFileFactory<N> castFactory = (PageFileFactory<N>) pageFileFactory;
return castFactory.newPageFile(cls);
} | [
"protected",
"<",
"N",
"extends",
"Page",
"&",
"Externalizable",
">",
"PageFile",
"<",
"N",
">",
"makePageFile",
"(",
"Class",
"<",
"N",
">",
"cls",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"final",
"PageFileFactory",
"<",
"N",
">",
... | Make the page file for this index.
@param <N>
page type
@param cls
Class information
@return Page file | [
"Make",
"the",
"page",
"file",
"for",
"this",
"index",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/PagedIndexFactory.java#L71-L75 |
63,713 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/scatterplot/selection/DistanceFunctionVisualization.java | DistanceFunctionVisualization.isAngularDistance | public static boolean isAngularDistance(AbstractMaterializeKNNPreprocessor<?> kNN) {
DistanceFunction<?> distanceFunction = kNN.getDistanceQuery().getDistanceFunction();
return CosineDistanceFunction.class.isInstance(distanceFunction) //
|| ArcCosineDistanceFunction.class.isInstance(distanceFunction);
... | java | public static boolean isAngularDistance(AbstractMaterializeKNNPreprocessor<?> kNN) {
DistanceFunction<?> distanceFunction = kNN.getDistanceQuery().getDistanceFunction();
return CosineDistanceFunction.class.isInstance(distanceFunction) //
|| ArcCosineDistanceFunction.class.isInstance(distanceFunction);
... | [
"public",
"static",
"boolean",
"isAngularDistance",
"(",
"AbstractMaterializeKNNPreprocessor",
"<",
"?",
">",
"kNN",
")",
"{",
"DistanceFunction",
"<",
"?",
">",
"distanceFunction",
"=",
"kNN",
".",
"getDistanceQuery",
"(",
")",
".",
"getDistanceFunction",
"(",
")... | Test whether the given preprocessor used an angular distance function
@param kNN kNN preprocessor
@return true when angular | [
"Test",
"whether",
"the",
"given",
"preprocessor",
"used",
"an",
"angular",
"distance",
"function"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/scatterplot/selection/DistanceFunctionVisualization.java#L131-L135 |
63,714 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/scatterplot/selection/DistanceFunctionVisualization.java | DistanceFunctionVisualization.drawCosine | public static Element drawCosine(SVGPlot svgp, Projection2D proj, NumberVector mid, double angle) {
// Project origin
double[] pointOfOrigin = proj.fastProjectDataToRenderSpace(new double[proj.getInputDimensionality()]);
// direction of the selected Point
double[] selPoint = proj.fastProjectDataToRende... | java | public static Element drawCosine(SVGPlot svgp, Projection2D proj, NumberVector mid, double angle) {
// Project origin
double[] pointOfOrigin = proj.fastProjectDataToRenderSpace(new double[proj.getInputDimensionality()]);
// direction of the selected Point
double[] selPoint = proj.fastProjectDataToRende... | [
"public",
"static",
"Element",
"drawCosine",
"(",
"SVGPlot",
"svgp",
",",
"Projection2D",
"proj",
",",
"NumberVector",
"mid",
",",
"double",
"angle",
")",
"{",
"// Project origin",
"double",
"[",
"]",
"pointOfOrigin",
"=",
"proj",
".",
"fastProjectDataToRenderSpac... | Visualizes Cosine and ArcCosine distance functions
@param svgp SVG Plot
@param proj Visualization projection
@param mid mean vector
@param angle Opening angle in radians
@return path element | [
"Visualizes",
"Cosine",
"and",
"ArcCosine",
"distance",
"functions"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/scatterplot/selection/DistanceFunctionVisualization.java#L146-L200 |
63,715 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/fastoptics/RandomProjectedNeighborsAndDensities.java | RandomProjectedNeighborsAndDensities.splitupNoSort | public void splitupNoSort(ArrayModifiableDBIDs ind, int begin, int end, int dim, Random rand) {
final int nele = end - begin;
dim = dim % projectedPoints.length;// choose a projection of points
DoubleDataStore tpro = projectedPoints[dim];
// save set such that used for density or neighborhood computati... | java | public void splitupNoSort(ArrayModifiableDBIDs ind, int begin, int end, int dim, Random rand) {
final int nele = end - begin;
dim = dim % projectedPoints.length;// choose a projection of points
DoubleDataStore tpro = projectedPoints[dim];
// save set such that used for density or neighborhood computati... | [
"public",
"void",
"splitupNoSort",
"(",
"ArrayModifiableDBIDs",
"ind",
",",
"int",
"begin",
",",
"int",
"end",
",",
"int",
"dim",
",",
"Random",
"rand",
")",
"{",
"final",
"int",
"nele",
"=",
"end",
"-",
"begin",
";",
"dim",
"=",
"dim",
"%",
"projected... | Recursively splits entire point set until the set is below a threshold
@param ind points that are in the current set
@param begin Interval begin in the ind array
@param end Interval end in the ind array
@param dim depth of projection (how many times point set has been split
already)
@param rand Random generator | [
"Recursively",
"splits",
"entire",
"point",
"set",
"until",
"the",
"set",
"is",
"below",
"a",
"threshold"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/fastoptics/RandomProjectedNeighborsAndDensities.java#L246-L276 |
63,716 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/fastoptics/RandomProjectedNeighborsAndDensities.java | RandomProjectedNeighborsAndDensities.splitRandomly | public int splitRandomly(ArrayModifiableDBIDs ind, int begin, int end, DoubleDataStore tpro, Random rand) {
final int nele = end - begin;
DBIDArrayIter it = ind.iter();
// pick random splitting element based on position
double rs = tpro.doubleValue(it.seek(begin + rand.nextInt(nele)));
int minInd = ... | java | public int splitRandomly(ArrayModifiableDBIDs ind, int begin, int end, DoubleDataStore tpro, Random rand) {
final int nele = end - begin;
DBIDArrayIter it = ind.iter();
// pick random splitting element based on position
double rs = tpro.doubleValue(it.seek(begin + rand.nextInt(nele)));
int minInd = ... | [
"public",
"int",
"splitRandomly",
"(",
"ArrayModifiableDBIDs",
"ind",
",",
"int",
"begin",
",",
"int",
"end",
",",
"DoubleDataStore",
"tpro",
",",
"Random",
"rand",
")",
"{",
"final",
"int",
"nele",
"=",
"end",
"-",
"begin",
";",
"DBIDArrayIter",
"it",
"="... | Split the data set randomly.
@param ind Object index
@param begin Interval begin
@param end Interval end
@param tpro Projection
@param rand Random generator
@return Splitting point | [
"Split",
"the",
"data",
"set",
"randomly",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/fastoptics/RandomProjectedNeighborsAndDensities.java#L288-L315 |
63,717 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/fastoptics/RandomProjectedNeighborsAndDensities.java | RandomProjectedNeighborsAndDensities.splitByDistance | public int splitByDistance(ArrayModifiableDBIDs ind, int begin, int end, DoubleDataStore tpro, Random rand) {
DBIDArrayIter it = ind.iter();
// pick random splitting point based on distance
double rmin = Double.MAX_VALUE * .5, rmax = -Double.MAX_VALUE * .5;
int minInd = begin, maxInd = end - 1;
for(... | java | public int splitByDistance(ArrayModifiableDBIDs ind, int begin, int end, DoubleDataStore tpro, Random rand) {
DBIDArrayIter it = ind.iter();
// pick random splitting point based on distance
double rmin = Double.MAX_VALUE * .5, rmax = -Double.MAX_VALUE * .5;
int minInd = begin, maxInd = end - 1;
for(... | [
"public",
"int",
"splitByDistance",
"(",
"ArrayModifiableDBIDs",
"ind",
",",
"int",
"begin",
",",
"int",
"end",
",",
"DoubleDataStore",
"tpro",
",",
"Random",
"rand",
")",
"{",
"DBIDArrayIter",
"it",
"=",
"ind",
".",
"iter",
"(",
")",
";",
"// pick random sp... | Split the data set by distances.
@param ind Object index
@param begin Interval begin
@param end Interval end
@param tpro Projection
@param rand Random generator
@return Splitting point | [
"Split",
"the",
"data",
"set",
"by",
"distances",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/fastoptics/RandomProjectedNeighborsAndDensities.java#L327-L363 |
63,718 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/fastoptics/RandomProjectedNeighborsAndDensities.java | RandomProjectedNeighborsAndDensities.getNeighs | public DataStore<? extends DBIDs> getNeighs() {
final DBIDs ids = points.getDBIDs();
// init lists
WritableDataStore<ModifiableDBIDs> neighs = DataStoreUtil.makeStorage(ids, DataStoreFactory.HINT_HOT, ModifiableDBIDs.class);
for(DBIDIter it = ids.iter(); it.valid(); it.advance()) {
neighs.put(it, ... | java | public DataStore<? extends DBIDs> getNeighs() {
final DBIDs ids = points.getDBIDs();
// init lists
WritableDataStore<ModifiableDBIDs> neighs = DataStoreUtil.makeStorage(ids, DataStoreFactory.HINT_HOT, ModifiableDBIDs.class);
for(DBIDIter it = ids.iter(); it.valid(); it.advance()) {
neighs.put(it, ... | [
"public",
"DataStore",
"<",
"?",
"extends",
"DBIDs",
">",
"getNeighs",
"(",
")",
"{",
"final",
"DBIDs",
"ids",
"=",
"points",
".",
"getDBIDs",
"(",
")",
";",
"// init lists",
"WritableDataStore",
"<",
"ModifiableDBIDs",
">",
"neighs",
"=",
"DataStoreUtil",
"... | Compute list of neighbors for each point from sets resulting from
projection
@return list of neighbors for each point | [
"Compute",
"list",
"of",
"neighbors",
"for",
"each",
"point",
"from",
"sets",
"resulting",
"from",
"projection"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/fastoptics/RandomProjectedNeighborsAndDensities.java#L371-L399 |
63,719 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/fastoptics/RandomProjectedNeighborsAndDensities.java | RandomProjectedNeighborsAndDensities.computeAverageDistInSet | public DoubleDataStore computeAverageDistInSet() {
WritableDoubleDataStore davg = DataStoreUtil.makeDoubleStorage(points.getDBIDs(), DataStoreFactory.HINT_HOT);
WritableIntegerDataStore nDists = DataStoreUtil.makeIntegerStorage(points.getDBIDs(), DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP);
Fini... | java | public DoubleDataStore computeAverageDistInSet() {
WritableDoubleDataStore davg = DataStoreUtil.makeDoubleStorage(points.getDBIDs(), DataStoreFactory.HINT_HOT);
WritableIntegerDataStore nDists = DataStoreUtil.makeIntegerStorage(points.getDBIDs(), DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP);
Fini... | [
"public",
"DoubleDataStore",
"computeAverageDistInSet",
"(",
")",
"{",
"WritableDoubleDataStore",
"davg",
"=",
"DataStoreUtil",
".",
"makeDoubleStorage",
"(",
"points",
".",
"getDBIDs",
"(",
")",
",",
"DataStoreFactory",
".",
"HINT_HOT",
")",
";",
"WritableIntegerData... | Compute for each point a density estimate as inverse of average distance to
a point in a projected set
@return for each point average distance to point in a set | [
"Compute",
"for",
"each",
"point",
"a",
"density",
"estimate",
"as",
"inverse",
"of",
"average",
"distance",
"to",
"a",
"point",
"in",
"a",
"projected",
"set"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/fastoptics/RandomProjectedNeighborsAndDensities.java#L407-L442 |
63,720 | elki-project/elki | elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/Itemset.java | Itemset.containedIn | public boolean containedIn(SparseNumberVector bv) {
int i1 = this.iter(), i2 = bv.iter();
while(this.iterValid(i1)) {
if(!bv.iterValid(i2)) {
return false;
}
int d1 = this.iterDim(i1), d2 = bv.iterDim(i2);
if(d1 < d2) {
return false; // Missing
}
if(d1 == d2) ... | java | public boolean containedIn(SparseNumberVector bv) {
int i1 = this.iter(), i2 = bv.iter();
while(this.iterValid(i1)) {
if(!bv.iterValid(i2)) {
return false;
}
int d1 = this.iterDim(i1), d2 = bv.iterDim(i2);
if(d1 < d2) {
return false; // Missing
}
if(d1 == d2) ... | [
"public",
"boolean",
"containedIn",
"(",
"SparseNumberVector",
"bv",
")",
"{",
"int",
"i1",
"=",
"this",
".",
"iter",
"(",
")",
",",
"i2",
"=",
"bv",
".",
"iter",
"(",
")",
";",
"while",
"(",
"this",
".",
"iterValid",
"(",
"i1",
")",
")",
"{",
"i... | Test whether the itemset is contained in a bit vector.
@param bv Bit vector
@return {@code true} when the itemset is contained in this vector. | [
"Test",
"whether",
"the",
"itemset",
"is",
"contained",
"in",
"a",
"bit",
"vector",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/Itemset.java#L65-L84 |
63,721 | elki-project/elki | elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/Itemset.java | Itemset.toBitset | public static long[] toBitset(Itemset i, long[] bits) {
for(int it = i.iter(); i.iterValid(it); it = i.iterAdvance(it)) {
BitsUtil.setI(bits, i.iterDim(it));
}
return bits;
} | java | public static long[] toBitset(Itemset i, long[] bits) {
for(int it = i.iter(); i.iterValid(it); it = i.iterAdvance(it)) {
BitsUtil.setI(bits, i.iterDim(it));
}
return bits;
} | [
"public",
"static",
"long",
"[",
"]",
"toBitset",
"(",
"Itemset",
"i",
",",
"long",
"[",
"]",
"bits",
")",
"{",
"for",
"(",
"int",
"it",
"=",
"i",
".",
"iter",
"(",
")",
";",
"i",
".",
"iterValid",
"(",
"it",
")",
";",
"it",
"=",
"i",
".",
... | Get the items.
@param i Itemset
@param bits Output bitset (must be zeros)
@return Output bitset | [
"Get",
"the",
"items",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/Itemset.java#L100-L105 |
63,722 | elki-project/elki | elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/Itemset.java | Itemset.compareLexicographical | protected static int compareLexicographical(Itemset a, Itemset o) {
int i1 = a.iter(), i2 = o.iter();
while(a.iterValid(i1) && o.iterValid(i2)) {
int v1 = a.iterDim(i1), v2 = o.iterDim(i2);
if(v1 < v2) {
return -1;
}
if(v2 < v1) {
return +1;
}
i1 = a.iterAdvan... | java | protected static int compareLexicographical(Itemset a, Itemset o) {
int i1 = a.iter(), i2 = o.iter();
while(a.iterValid(i1) && o.iterValid(i2)) {
int v1 = a.iterDim(i1), v2 = o.iterDim(i2);
if(v1 < v2) {
return -1;
}
if(v2 < v1) {
return +1;
}
i1 = a.iterAdvan... | [
"protected",
"static",
"int",
"compareLexicographical",
"(",
"Itemset",
"a",
",",
"Itemset",
"o",
")",
"{",
"int",
"i1",
"=",
"a",
".",
"iter",
"(",
")",
",",
"i2",
"=",
"o",
".",
"iter",
"(",
")",
";",
"while",
"(",
"a",
".",
"iterValid",
"(",
"... | Robust compare using the iterators, lexicographical only!
Note: This does NOT take length into account.
@param o Other itemset.
@return Comparison result. | [
"Robust",
"compare",
"using",
"the",
"iterators",
"lexicographical",
"only!"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/Itemset.java#L195-L209 |
63,723 | elki-project/elki | elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/Itemset.java | Itemset.appendTo | public final StringBuilder appendTo(StringBuilder buf, VectorFieldTypeInformation<BitVector> meta) {
appendItemsTo(buf, meta);
return buf.append(": ").append(support);
} | java | public final StringBuilder appendTo(StringBuilder buf, VectorFieldTypeInformation<BitVector> meta) {
appendItemsTo(buf, meta);
return buf.append(": ").append(support);
} | [
"public",
"final",
"StringBuilder",
"appendTo",
"(",
"StringBuilder",
"buf",
",",
"VectorFieldTypeInformation",
"<",
"BitVector",
">",
"meta",
")",
"{",
"appendItemsTo",
"(",
"buf",
",",
"meta",
")",
";",
"return",
"buf",
".",
"append",
"(",
"\": \"",
")",
"... | Append items and support to a string buffer.
@param buf Buffer
@param meta Relation metadata (for labels)
@return String buffer for chaining. | [
"Append",
"items",
"and",
"support",
"to",
"a",
"string",
"buffer",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/Itemset.java#L223-L226 |
63,724 | elki-project/elki | elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/Itemset.java | Itemset.appendItemsTo | public StringBuilder appendItemsTo(StringBuilder buf, VectorFieldTypeInformation<BitVector> meta) {
int it = this.iter();
if(this.iterValid(it)) {
while(true) {
int v = this.iterDim(it);
String lbl = (meta != null) ? meta.getLabel(v) : null;
if(lbl == null) {
buf.append(v... | java | public StringBuilder appendItemsTo(StringBuilder buf, VectorFieldTypeInformation<BitVector> meta) {
int it = this.iter();
if(this.iterValid(it)) {
while(true) {
int v = this.iterDim(it);
String lbl = (meta != null) ? meta.getLabel(v) : null;
if(lbl == null) {
buf.append(v... | [
"public",
"StringBuilder",
"appendItemsTo",
"(",
"StringBuilder",
"buf",
",",
"VectorFieldTypeInformation",
"<",
"BitVector",
">",
"meta",
")",
"{",
"int",
"it",
"=",
"this",
".",
"iter",
"(",
")",
";",
"if",
"(",
"this",
".",
"iterValid",
"(",
"it",
")",
... | Only append the items to a string buffer.
@param buf Buffer
@param meta Relation metadata (for labels)
@return String buffer for chaining. | [
"Only",
"append",
"the",
"items",
"to",
"a",
"string",
"buffer",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/Itemset.java#L235-L255 |
63,725 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/weightfunctions/GaussWeight.java | GaussWeight.getWeight | @Override
public double getWeight(double distance, double max, double stddev) {
if(max <= 0) {
return 1.0;
}
double relativedistance = distance / max;
// -2.303 is log(.1) to suit the intended range of 1.0-0.1
return FastMath.exp(-2.3025850929940455 * relativedistance * relativedistance);
... | java | @Override
public double getWeight(double distance, double max, double stddev) {
if(max <= 0) {
return 1.0;
}
double relativedistance = distance / max;
// -2.303 is log(.1) to suit the intended range of 1.0-0.1
return FastMath.exp(-2.3025850929940455 * relativedistance * relativedistance);
... | [
"@",
"Override",
"public",
"double",
"getWeight",
"(",
"double",
"distance",
",",
"double",
"max",
",",
"double",
"stddev",
")",
"{",
"if",
"(",
"max",
"<=",
"0",
")",
"{",
"return",
"1.0",
";",
"}",
"double",
"relativedistance",
"=",
"distance",
"/",
... | Get Gaussian weight. stddev is not used, scaled using max. | [
"Get",
"Gaussian",
"weight",
".",
"stddev",
"is",
"not",
"used",
"scaled",
"using",
"max",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/weightfunctions/GaussWeight.java#L36-L44 |
63,726 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArrayPageFile.java | OnDiskArrayPageFile.writePage | @Override
public void writePage(int pageID, P page) {
if (page.isDirty()) {
try {
countWrite();
byte[] array = pageToByteArray(page);
file.getRecordBuffer(pageID).put(array);
page.setDirty(false);
} catch (IOException e) {
throw new RuntimeException(e);
}
... | java | @Override
public void writePage(int pageID, P page) {
if (page.isDirty()) {
try {
countWrite();
byte[] array = pageToByteArray(page);
file.getRecordBuffer(pageID).put(array);
page.setDirty(false);
} catch (IOException e) {
throw new RuntimeException(e);
}
... | [
"@",
"Override",
"public",
"void",
"writePage",
"(",
"int",
"pageID",
",",
"P",
"page",
")",
"{",
"if",
"(",
"page",
".",
"isDirty",
"(",
")",
")",
"{",
"try",
"{",
"countWrite",
"(",
")",
";",
"byte",
"[",
"]",
"array",
"=",
"pageToByteArray",
"("... | Write page to disk.
@param pageID page id
@param page the page which has to be written to disk | [
"Write",
"page",
"to",
"disk",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArrayPageFile.java#L144-L156 |
63,727 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArrayPageFile.java | OnDiskArrayPageFile.pageToByteArray | private byte[] pageToByteArray(P page) {
try {
if (page == null) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeInt(EMPTY_PAGE);
oos.close();
baos.close();
byte[] array = baos.toByteArr... | java | private byte[] pageToByteArray(P page) {
try {
if (page == null) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeInt(EMPTY_PAGE);
oos.close();
baos.close();
byte[] array = baos.toByteArr... | [
"private",
"byte",
"[",
"]",
"pageToByteArray",
"(",
"P",
"page",
")",
"{",
"try",
"{",
"if",
"(",
"page",
"==",
"null",
")",
"{",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"ObjectOutputStream",
"oos",
"=",
"new",... | Serializes an object into a byte array.
@param page the object to be serialized
@return the byte array | [
"Serializes",
"an",
"object",
"into",
"a",
"byte",
"array",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArrayPageFile.java#L213-L248 |
63,728 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/SinCosTable.java | SinCosTable.make | public static SinCosTable make(int steps) {
if ((steps & 0x3) == 0) {
return new QuarterTable(steps);
}
if ((steps & 0x1) == 0) {
return new HalfTable(steps);
}
return new FullTable(steps);
} | java | public static SinCosTable make(int steps) {
if ((steps & 0x3) == 0) {
return new QuarterTable(steps);
}
if ((steps & 0x1) == 0) {
return new HalfTable(steps);
}
return new FullTable(steps);
} | [
"public",
"static",
"SinCosTable",
"make",
"(",
"int",
"steps",
")",
"{",
"if",
"(",
"(",
"steps",
"&",
"0x3",
")",
"==",
"0",
")",
"{",
"return",
"new",
"QuarterTable",
"(",
"steps",
")",
";",
"}",
"if",
"(",
"(",
"steps",
"&",
"0x1",
")",
"==",... | Make a table for the given number of steps.
For step numbers divisible by 4, an optimized implementation will be used.
@param steps Number of steps
@return Table | [
"Make",
"a",
"table",
"for",
"the",
"given",
"number",
"of",
"steps",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/SinCosTable.java#L295-L303 |
63,729 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/CLINK.java | CLINK.process | @Override
protected void process(DBIDRef id, ArrayDBIDs ids, DBIDArrayIter it, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, WritableDoubleDataStore m) {
clinkstep3(id, it, n, pi, lambda, m);
clinkstep4567(id, ids, it, n, pi, lambda, m);
clinkstep8(id, it, n, pi, lambda, m);
} | java | @Override
protected void process(DBIDRef id, ArrayDBIDs ids, DBIDArrayIter it, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, WritableDoubleDataStore m) {
clinkstep3(id, it, n, pi, lambda, m);
clinkstep4567(id, ids, it, n, pi, lambda, m);
clinkstep8(id, it, n, pi, lambda, m);
} | [
"@",
"Override",
"protected",
"void",
"process",
"(",
"DBIDRef",
"id",
",",
"ArrayDBIDs",
"ids",
",",
"DBIDArrayIter",
"it",
",",
"int",
"n",
",",
"WritableDBIDDataStore",
"pi",
",",
"WritableDoubleDataStore",
"lambda",
",",
"WritableDoubleDataStore",
"m",
")",
... | CLINK main loop, based on the SLINK main loop.
@param id Current object
@param ids All objects
@param it Array iterator
@param n Last object to process at this run
@param pi Parent
@param lambda Height
@param m Distance | [
"CLINK",
"main",
"loop",
"based",
"on",
"the",
"SLINK",
"main",
"loop",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/CLINK.java#L89-L94 |
63,730 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/CLINK.java | CLINK.clinkstep8 | private void clinkstep8(DBIDRef id, DBIDArrayIter it, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, WritableDoubleDataStore m) {
DBIDVar p_i = DBIDUtil.newVar(), pp_i = DBIDUtil.newVar();
for(it.seek(0); it.getOffset() < n; it.advance()) {
p_i.from(pi, it); // p_i = pi[i]
pp_i.fro... | java | private void clinkstep8(DBIDRef id, DBIDArrayIter it, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, WritableDoubleDataStore m) {
DBIDVar p_i = DBIDUtil.newVar(), pp_i = DBIDUtil.newVar();
for(it.seek(0); it.getOffset() < n; it.advance()) {
p_i.from(pi, it); // p_i = pi[i]
pp_i.fro... | [
"private",
"void",
"clinkstep8",
"(",
"DBIDRef",
"id",
",",
"DBIDArrayIter",
"it",
",",
"int",
"n",
",",
"WritableDBIDDataStore",
"pi",
",",
"WritableDoubleDataStore",
"lambda",
",",
"WritableDoubleDataStore",
"m",
")",
"{",
"DBIDVar",
"p_i",
"=",
"DBIDUtil",
".... | Update hierarchy.
@param id Current object
@param it Iterator
@param n Last object to process
@param pi Parent data store
@param lambda Height data store
@param m Distance data store | [
"Update",
"hierarchy",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/CLINK.java#L195-L204 |
63,731 | elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/strings/LevenshteinDistanceFunction.java | LevenshteinDistanceFunction.levenshteinDistance | public static int levenshteinDistance(String o1, String o2) {
// Let o1 be the shorter one:
if(o1.length() > o2.length()) {
return levenshteinDistance(o2, o1);
}
final int l1 = o1.length(), l2 = o2.length();
// Exploit that Java caches the hash code of strings:
if(l1 == l2 && o1.hashCode()... | java | public static int levenshteinDistance(String o1, String o2) {
// Let o1 be the shorter one:
if(o1.length() > o2.length()) {
return levenshteinDistance(o2, o1);
}
final int l1 = o1.length(), l2 = o2.length();
// Exploit that Java caches the hash code of strings:
if(l1 == l2 && o1.hashCode()... | [
"public",
"static",
"int",
"levenshteinDistance",
"(",
"String",
"o1",
",",
"String",
"o2",
")",
"{",
"// Let o1 be the shorter one:",
"if",
"(",
"o1",
".",
"length",
"(",
")",
">",
"o2",
".",
"length",
"(",
")",
")",
"{",
"return",
"levenshteinDistance",
... | Levenshtein distance for two strings.
@param o1 First string
@param o2 Second string
@return Levenshtein distance | [
"Levenshtein",
"distance",
"for",
"two",
"strings",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/strings/LevenshteinDistanceFunction.java#L84-L106 |
63,732 | elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/strings/LevenshteinDistanceFunction.java | LevenshteinDistanceFunction.prefixLen | private static int prefixLen(String o1, String o2) {
final int l1 = o1.length(), l2 = o2.length(), l = l1 < l2 ? l1 : l2;
int prefix = 0;
while(prefix < l && (o1.charAt(prefix) == o2.charAt(prefix))) {
prefix++;
}
return prefix;
} | java | private static int prefixLen(String o1, String o2) {
final int l1 = o1.length(), l2 = o2.length(), l = l1 < l2 ? l1 : l2;
int prefix = 0;
while(prefix < l && (o1.charAt(prefix) == o2.charAt(prefix))) {
prefix++;
}
return prefix;
} | [
"private",
"static",
"int",
"prefixLen",
"(",
"String",
"o1",
",",
"String",
"o2",
")",
"{",
"final",
"int",
"l1",
"=",
"o1",
".",
"length",
"(",
")",
",",
"l2",
"=",
"o2",
".",
"length",
"(",
")",
",",
"l",
"=",
"l1",
"<",
"l2",
"?",
"l1",
"... | Compute the length of the prefix.
@param o1 First string
@param o2 Second string
@return Prefix length | [
"Compute",
"the",
"length",
"of",
"the",
"prefix",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/strings/LevenshteinDistanceFunction.java#L115-L122 |
63,733 | elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/strings/LevenshteinDistanceFunction.java | LevenshteinDistanceFunction.postfixLen | private static int postfixLen(String o1, String o2, int prefix) {
int postfix = 0;
int p1 = o1.length(), p2 = o2.length();
while(p1 > prefix && p2 > prefix && (o1.charAt(--p1) == o2.charAt(--p2))) {
++postfix;
}
return postfix;
} | java | private static int postfixLen(String o1, String o2, int prefix) {
int postfix = 0;
int p1 = o1.length(), p2 = o2.length();
while(p1 > prefix && p2 > prefix && (o1.charAt(--p1) == o2.charAt(--p2))) {
++postfix;
}
return postfix;
} | [
"private",
"static",
"int",
"postfixLen",
"(",
"String",
"o1",
",",
"String",
"o2",
",",
"int",
"prefix",
")",
"{",
"int",
"postfix",
"=",
"0",
";",
"int",
"p1",
"=",
"o1",
".",
"length",
"(",
")",
",",
"p2",
"=",
"o2",
".",
"length",
"(",
")",
... | Compute the postfix length.
@param o1 First object
@param o2 Second object
@param prefix Known prefix length
@return Postfix length | [
"Compute",
"the",
"postfix",
"length",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/strings/LevenshteinDistanceFunction.java#L132-L139 |
63,734 | elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/strings/LevenshteinDistanceFunction.java | LevenshteinDistanceFunction.levenshteinDistance | public static int levenshteinDistance(String o1, String o2, int prefix, int postfix) {
final int l1 = o1.length(), l2 = o2.length();
// Buffer, interleaved. Even and odd values are our rows.
int[] buf = new int[(l2 + 1 - (prefix + postfix)) << 1];
// Initial "row", on even positions
for(int j = 0; j... | java | public static int levenshteinDistance(String o1, String o2, int prefix, int postfix) {
final int l1 = o1.length(), l2 = o2.length();
// Buffer, interleaved. Even and odd values are our rows.
int[] buf = new int[(l2 + 1 - (prefix + postfix)) << 1];
// Initial "row", on even positions
for(int j = 0; j... | [
"public",
"static",
"int",
"levenshteinDistance",
"(",
"String",
"o1",
",",
"String",
"o2",
",",
"int",
"prefix",
",",
"int",
"postfix",
")",
"{",
"final",
"int",
"l1",
"=",
"o1",
".",
"length",
"(",
")",
",",
"l2",
"=",
"o2",
".",
"length",
"(",
"... | Compute the Levenshtein distance, except for prefix and postfix.
@param o1 First object
@param o2 Second object
@param prefix Prefix length
@param postfix Postfix length
@return Levenshtein distance | [
"Compute",
"the",
"Levenshtein",
"distance",
"except",
"for",
"prefix",
"and",
"postfix",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/strings/LevenshteinDistanceFunction.java#L150-L167 |
63,735 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/range/ParseIntRanges.java | ParseIntRanges.nextSep | private static int nextSep(String str, int start) {
int next = str.indexOf(',', start);
return next == -1 ? str.length() : next;
} | java | private static int nextSep(String str, int start) {
int next = str.indexOf(',', start);
return next == -1 ? str.length() : next;
} | [
"private",
"static",
"int",
"nextSep",
"(",
"String",
"str",
",",
"int",
"start",
")",
"{",
"int",
"next",
"=",
"str",
".",
"indexOf",
"(",
"'",
"'",
",",
"start",
")",
";",
"return",
"next",
"==",
"-",
"1",
"?",
"str",
".",
"length",
"(",
")",
... | Find the next separator.
TODO: allow other separators, too?
@param str String
@param start Starting position
@return Next separator position, or end of string. | [
"Find",
"the",
"next",
"separator",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/range/ParseIntRanges.java#L168-L171 |
63,736 | elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/colorhistogram/HSBHistogramQuadraticDistanceFunction.java | HSBHistogramQuadraticDistanceFunction.computeWeightMatrix | public static double[][] computeWeightMatrix(final int quanth, final int quants, final int quantb) {
final int dim = quanth * quants * quantb;
final DoubleWrapper tmp = new DoubleWrapper(); // To return cosine
assert (dim > 0);
final double[][] m = new double[dim][dim];
for(int x = 0; x < dim; x++) ... | java | public static double[][] computeWeightMatrix(final int quanth, final int quants, final int quantb) {
final int dim = quanth * quants * quantb;
final DoubleWrapper tmp = new DoubleWrapper(); // To return cosine
assert (dim > 0);
final double[][] m = new double[dim][dim];
for(int x = 0; x < dim; x++) ... | [
"public",
"static",
"double",
"[",
"]",
"[",
"]",
"computeWeightMatrix",
"(",
"final",
"int",
"quanth",
",",
"final",
"int",
"quants",
",",
"final",
"int",
"quantb",
")",
"{",
"final",
"int",
"dim",
"=",
"quanth",
"*",
"quants",
"*",
"quantb",
";",
"fi... | Compute the weight matrix for HSB similarity.
@param quanth H bins
@param quants S bins
@param quantb B bins
@return Weight matrix | [
"Compute",
"the",
"weight",
"matrix",
"for",
"HSB",
"similarity",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/colorhistogram/HSBHistogramQuadraticDistanceFunction.java#L74-L100 |
63,737 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.plus | public static double[] plus(final double[] v1, final double[] v2) {
assert v1.length == v2.length : ERR_VEC_DIMENSIONS;
final double[] result = new double[v1.length];
for(int i = 0; i < result.length; i++) {
result[i] = v1[i] + v2[i];
}
return result;
} | java | public static double[] plus(final double[] v1, final double[] v2) {
assert v1.length == v2.length : ERR_VEC_DIMENSIONS;
final double[] result = new double[v1.length];
for(int i = 0; i < result.length; i++) {
result[i] = v1[i] + v2[i];
}
return result;
} | [
"public",
"static",
"double",
"[",
"]",
"plus",
"(",
"final",
"double",
"[",
"]",
"v1",
",",
"final",
"double",
"[",
"]",
"v2",
")",
"{",
"assert",
"v1",
".",
"length",
"==",
"v2",
".",
"length",
":",
"ERR_VEC_DIMENSIONS",
";",
"final",
"double",
"["... | Computes component-wise v1 + v2 for vectors.
@param v1 first vector
@param v2 second vector
@return the sum v1 + v2 | [
"Computes",
"component",
"-",
"wise",
"v1",
"+",
"v2",
"for",
"vectors",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L138-L145 |
63,738 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.plusEquals | public static double[] plusEquals(final double[] v1, final double[] v2) {
assert v1.length == v2.length : ERR_VEC_DIMENSIONS;
for(int i = 0; i < v1.length; i++) {
v1[i] += v2[i];
}
return v1;
} | java | public static double[] plusEquals(final double[] v1, final double[] v2) {
assert v1.length == v2.length : ERR_VEC_DIMENSIONS;
for(int i = 0; i < v1.length; i++) {
v1[i] += v2[i];
}
return v1;
} | [
"public",
"static",
"double",
"[",
"]",
"plusEquals",
"(",
"final",
"double",
"[",
"]",
"v1",
",",
"final",
"double",
"[",
"]",
"v2",
")",
"{",
"assert",
"v1",
".",
"length",
"==",
"v2",
".",
"length",
":",
"ERR_VEC_DIMENSIONS",
";",
"for",
"(",
"int... | Computes component-wise v1 = v1 + v2,
overwriting the vector v1.
@param v1 first vector (overwritten)
@param v2 second vector
@return v1 = v1 + v2 | [
"Computes",
"component",
"-",
"wise",
"v1",
"=",
"v1",
"+",
"v2",
"overwriting",
"the",
"vector",
"v1",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L207-L213 |
63,739 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.plus | public static double[] plus(final double[] v1, final double s1) {
final double[] result = new double[v1.length];
for(int i = 0; i < result.length; i++) {
result[i] = v1[i] + s1;
}
return result;
} | java | public static double[] plus(final double[] v1, final double s1) {
final double[] result = new double[v1.length];
for(int i = 0; i < result.length; i++) {
result[i] = v1[i] + s1;
}
return result;
} | [
"public",
"static",
"double",
"[",
"]",
"plus",
"(",
"final",
"double",
"[",
"]",
"v1",
",",
"final",
"double",
"s1",
")",
"{",
"final",
"double",
"[",
"]",
"result",
"=",
"new",
"double",
"[",
"v1",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i... | Computes component-wise v1 + s1.
@param v1 vector to add to
@param s1 constant value to add
@return v1 + s1 | [
"Computes",
"component",
"-",
"wise",
"v1",
"+",
"s1",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L274-L280 |
63,740 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.plusEquals | public static double[] plusEquals(final double[] v1, final double s1) {
for(int i = 0; i < v1.length; i++) {
v1[i] += s1;
}
return v1;
} | java | public static double[] plusEquals(final double[] v1, final double s1) {
for(int i = 0; i < v1.length; i++) {
v1[i] += s1;
}
return v1;
} | [
"public",
"static",
"double",
"[",
"]",
"plusEquals",
"(",
"final",
"double",
"[",
"]",
"v1",
",",
"final",
"double",
"s1",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"v1",
".",
"length",
";",
"i",
"++",
")",
"{",
"v1",
"[",
"... | Computes component-wise v1 = v1 + s1,
overwriting the vector v1.
@param v1 vector to add to (overwritten)
@param s1 constant value to add
@return Modified vector | [
"Computes",
"component",
"-",
"wise",
"v1",
"=",
"v1",
"+",
"s1",
"overwriting",
"the",
"vector",
"v1",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L290-L295 |
63,741 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.minus | public static double[] minus(final double[] v1, final double[] v2) {
assert v1.length == v2.length : ERR_VEC_DIMENSIONS;
final double[] sub = new double[v1.length];
for(int i = 0; i < v1.length; i++) {
sub[i] = v1[i] - v2[i];
}
return sub;
} | java | public static double[] minus(final double[] v1, final double[] v2) {
assert v1.length == v2.length : ERR_VEC_DIMENSIONS;
final double[] sub = new double[v1.length];
for(int i = 0; i < v1.length; i++) {
sub[i] = v1[i] - v2[i];
}
return sub;
} | [
"public",
"static",
"double",
"[",
"]",
"minus",
"(",
"final",
"double",
"[",
"]",
"v1",
",",
"final",
"double",
"[",
"]",
"v2",
")",
"{",
"assert",
"v1",
".",
"length",
"==",
"v2",
".",
"length",
":",
"ERR_VEC_DIMENSIONS",
";",
"final",
"double",
"[... | Computes component-wise v1 - v2.
@param v1 first vector
@param v2 the vector to be subtracted from this vector
@return v1 - v2 | [
"Computes",
"component",
"-",
"wise",
"v1",
"-",
"v2",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L304-L311 |
63,742 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.minusEquals | public static double[] minusEquals(final double[] v1, final double[] v2) {
assert v1.length == v2.length : ERR_VEC_DIMENSIONS;
for(int i = 0; i < v1.length; i++) {
v1[i] -= v2[i];
}
return v1;
} | java | public static double[] minusEquals(final double[] v1, final double[] v2) {
assert v1.length == v2.length : ERR_VEC_DIMENSIONS;
for(int i = 0; i < v1.length; i++) {
v1[i] -= v2[i];
}
return v1;
} | [
"public",
"static",
"double",
"[",
"]",
"minusEquals",
"(",
"final",
"double",
"[",
"]",
"v1",
",",
"final",
"double",
"[",
"]",
"v2",
")",
"{",
"assert",
"v1",
".",
"length",
"==",
"v2",
".",
"length",
":",
"ERR_VEC_DIMENSIONS",
";",
"for",
"(",
"in... | Computes component-wise v1 = v1 - v2,
overwriting the vector v1.
@param v1 vector
@param v2 another vector
@return v1 = v1 - v2 | [
"Computes",
"component",
"-",
"wise",
"v1",
"=",
"v1",
"-",
"v2",
"overwriting",
"the",
"vector",
"v1",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L373-L379 |
63,743 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.minus | public static double[] minus(final double[] v1, final double s1) {
final double[] result = new double[v1.length];
for(int i = 0; i < v1.length; i++) {
result[i] = v1[i] - s1;
}
return result;
} | java | public static double[] minus(final double[] v1, final double s1) {
final double[] result = new double[v1.length];
for(int i = 0; i < v1.length; i++) {
result[i] = v1[i] - s1;
}
return result;
} | [
"public",
"static",
"double",
"[",
"]",
"minus",
"(",
"final",
"double",
"[",
"]",
"v1",
",",
"final",
"double",
"s1",
")",
"{",
"final",
"double",
"[",
"]",
"result",
"=",
"new",
"double",
"[",
"v1",
".",
"length",
"]",
";",
"for",
"(",
"int",
"... | Subtract component-wise v1 - s1.
@param v1 original vector
@param s1 Value to subtract
@return v1 - s1 | [
"Subtract",
"component",
"-",
"wise",
"v1",
"-",
"s1",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L440-L446 |
63,744 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.minusEquals | public static double[] minusEquals(final double[] v1, final double s1) {
for(int i = 0; i < v1.length; i++) {
v1[i] -= s1;
}
return v1;
} | java | public static double[] minusEquals(final double[] v1, final double s1) {
for(int i = 0; i < v1.length; i++) {
v1[i] -= s1;
}
return v1;
} | [
"public",
"static",
"double",
"[",
"]",
"minusEquals",
"(",
"final",
"double",
"[",
"]",
"v1",
",",
"final",
"double",
"s1",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"v1",
".",
"length",
";",
"i",
"++",
")",
"{",
"v1",
"[",
... | Subtract component-wise in-place v1 = v1 - s1,
overwriting the vector v1.
@param v1 original vector
@param s1 Value to subtract
@return v1 = v1 - s1 | [
"Subtract",
"component",
"-",
"wise",
"in",
"-",
"place",
"v1",
"=",
"v1",
"-",
"s1",
"overwriting",
"the",
"vector",
"v1",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L456-L461 |
63,745 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.sum | public static double sum(final double[] v1) {
double acc = 0.;
for(int row = 0; row < v1.length; row++) {
acc += v1[row];
}
return acc;
} | java | public static double sum(final double[] v1) {
double acc = 0.;
for(int row = 0; row < v1.length; row++) {
acc += v1[row];
}
return acc;
} | [
"public",
"static",
"double",
"sum",
"(",
"final",
"double",
"[",
"]",
"v1",
")",
"{",
"double",
"acc",
"=",
"0.",
";",
"for",
"(",
"int",
"row",
"=",
"0",
";",
"row",
"<",
"v1",
".",
"length",
";",
"row",
"++",
")",
"{",
"acc",
"+=",
"v1",
"... | Sum of the vector components.
@param v1 vector
@return sum of this vector | [
"Sum",
"of",
"the",
"vector",
"components",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L653-L659 |
63,746 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.argmax | public static int argmax(double[] v) {
assert (v.length > 0);
int maxIndex = 0;
double currentMax = v[0];
for(int i = 1; i < v.length; i++) {
final double x = v[i];
if(x > currentMax) {
maxIndex = i;
currentMax = x;
}
}
return maxIndex;
} | java | public static int argmax(double[] v) {
assert (v.length > 0);
int maxIndex = 0;
double currentMax = v[0];
for(int i = 1; i < v.length; i++) {
final double x = v[i];
if(x > currentMax) {
maxIndex = i;
currentMax = x;
}
}
return maxIndex;
} | [
"public",
"static",
"int",
"argmax",
"(",
"double",
"[",
"]",
"v",
")",
"{",
"assert",
"(",
"v",
".",
"length",
">",
"0",
")",
";",
"int",
"maxIndex",
"=",
"0",
";",
"double",
"currentMax",
"=",
"v",
"[",
"0",
"]",
";",
"for",
"(",
"int",
"i",
... | Find the maximum value.
@param v Vector
@return Position of maximum | [
"Find",
"the",
"maximum",
"value",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L692-L704 |
63,747 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.normalize | public static double[] normalize(final double[] v1) {
final double norm = 1. / euclideanLength(v1);
double[] re = new double[v1.length];
if(norm < Double.POSITIVE_INFINITY) {
for(int row = 0; row < v1.length; row++) {
re[row] = v1[row] * norm;
}
}
return re;
} | java | public static double[] normalize(final double[] v1) {
final double norm = 1. / euclideanLength(v1);
double[] re = new double[v1.length];
if(norm < Double.POSITIVE_INFINITY) {
for(int row = 0; row < v1.length; row++) {
re[row] = v1[row] * norm;
}
}
return re;
} | [
"public",
"static",
"double",
"[",
"]",
"normalize",
"(",
"final",
"double",
"[",
"]",
"v1",
")",
"{",
"final",
"double",
"norm",
"=",
"1.",
"/",
"euclideanLength",
"(",
"v1",
")",
";",
"double",
"[",
"]",
"re",
"=",
"new",
"double",
"[",
"v1",
"."... | Normalizes v1 to the length of 1.0.
@param v1 vector
@return normalized copy of v1 | [
"Normalizes",
"v1",
"to",
"the",
"length",
"of",
"1",
".",
"0",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L712-L721 |
63,748 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.normalizeEquals | public static double[] normalizeEquals(final double[] v1) {
final double norm = 1. / euclideanLength(v1);
if(norm < Double.POSITIVE_INFINITY) {
for(int row = 0; row < v1.length; row++) {
v1[row] *= norm;
}
}
return v1;
} | java | public static double[] normalizeEquals(final double[] v1) {
final double norm = 1. / euclideanLength(v1);
if(norm < Double.POSITIVE_INFINITY) {
for(int row = 0; row < v1.length; row++) {
v1[row] *= norm;
}
}
return v1;
} | [
"public",
"static",
"double",
"[",
"]",
"normalizeEquals",
"(",
"final",
"double",
"[",
"]",
"v1",
")",
"{",
"final",
"double",
"norm",
"=",
"1.",
"/",
"euclideanLength",
"(",
"v1",
")",
";",
"if",
"(",
"norm",
"<",
"Double",
".",
"POSITIVE_INFINITY",
... | Normalizes v1 to the length of 1.0 in place.
@param v1 vector (overwritten)
@return normalized v1 | [
"Normalizes",
"v1",
"to",
"the",
"length",
"of",
"1",
".",
"0",
"in",
"place",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L729-L737 |
63,749 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.clear | public static void clear(final double[][] m) {
for(int i = 0; i < m.length; i++) {
Arrays.fill(m[i], 0.0);
}
} | java | public static void clear(final double[][] m) {
for(int i = 0; i < m.length; i++) {
Arrays.fill(m[i], 0.0);
}
} | [
"public",
"static",
"void",
"clear",
"(",
"final",
"double",
"[",
"]",
"[",
"]",
"m",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"m",
".",
"length",
";",
"i",
"++",
")",
"{",
"Arrays",
".",
"fill",
"(",
"m",
"[",
"i",
"]",
... | Reset the matrix to 0.
@param m Matrix | [
"Reset",
"the",
"matrix",
"to",
"0",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L774-L778 |
63,750 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.rotate90Equals | public static double[] rotate90Equals(final double[] v1) {
assert v1.length == 2 : "rotate90Equals is only valid for 2d vectors.";
final double temp = v1[0];
v1[0] = v1[1];
v1[1] = -temp;
return v1;
} | java | public static double[] rotate90Equals(final double[] v1) {
assert v1.length == 2 : "rotate90Equals is only valid for 2d vectors.";
final double temp = v1[0];
v1[0] = v1[1];
v1[1] = -temp;
return v1;
} | [
"public",
"static",
"double",
"[",
"]",
"rotate90Equals",
"(",
"final",
"double",
"[",
"]",
"v1",
")",
"{",
"assert",
"v1",
".",
"length",
"==",
"2",
":",
"\"rotate90Equals is only valid for 2d vectors.\"",
";",
"final",
"double",
"temp",
"=",
"v1",
"[",
"0"... | Rotate the two-dimensional vector by 90 degrees.
@param v1 first vector
@return modified v1, rotated by 90 degrees | [
"Rotate",
"the",
"two",
"-",
"dimensional",
"vector",
"by",
"90",
"degrees",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L786-L792 |
63,751 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.diagonal | public static double[][] diagonal(final double[] v1) {
final int dim = v1.length;
final double[][] result = new double[dim][dim];
for(int i = 0; i < dim; i++) {
result[i][i] = v1[i];
}
return result;
} | java | public static double[][] diagonal(final double[] v1) {
final int dim = v1.length;
final double[][] result = new double[dim][dim];
for(int i = 0; i < dim; i++) {
result[i][i] = v1[i];
}
return result;
} | [
"public",
"static",
"double",
"[",
"]",
"[",
"]",
"diagonal",
"(",
"final",
"double",
"[",
"]",
"v1",
")",
"{",
"final",
"int",
"dim",
"=",
"v1",
".",
"length",
";",
"final",
"double",
"[",
"]",
"[",
"]",
"result",
"=",
"new",
"double",
"[",
"dim... | Returns a quadratic matrix consisting of zeros and of the given values on
the diagonal.
@param v1 the values on the diagonal
@return the resulting matrix | [
"Returns",
"a",
"quadratic",
"matrix",
"consisting",
"of",
"zeros",
"and",
"of",
"the",
"given",
"values",
"on",
"the",
"diagonal",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L843-L850 |
63,752 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.copy | public static double[][] copy(final double[][] m1) {
final int rowdim = m1.length, coldim = getColumnDimensionality(m1);
final double[][] X = new double[rowdim][coldim];
for(int i = 0; i < rowdim; i++) {
System.arraycopy(m1[i], 0, X[i], 0, coldim);
}
return X;
} | java | public static double[][] copy(final double[][] m1) {
final int rowdim = m1.length, coldim = getColumnDimensionality(m1);
final double[][] X = new double[rowdim][coldim];
for(int i = 0; i < rowdim; i++) {
System.arraycopy(m1[i], 0, X[i], 0, coldim);
}
return X;
} | [
"public",
"static",
"double",
"[",
"]",
"[",
"]",
"copy",
"(",
"final",
"double",
"[",
"]",
"[",
"]",
"m1",
")",
"{",
"final",
"int",
"rowdim",
"=",
"m1",
".",
"length",
",",
"coldim",
"=",
"getColumnDimensionality",
"(",
"m1",
")",
";",
"final",
"... | Make a deep copy of a matrix.
@param m1 Input matrix
@return a new matrix containing the same values as this matrix | [
"Make",
"a",
"deep",
"copy",
"of",
"a",
"matrix",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L858-L865 |
63,753 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.getCol | public static double[] getCol(double[][] m1, int col) {
double[] ret = new double[m1.length];
for(int i = 0; i < ret.length; i++) {
ret[i] = m1[i][col];
}
return ret;
} | java | public static double[] getCol(double[][] m1, int col) {
double[] ret = new double[m1.length];
for(int i = 0; i < ret.length; i++) {
ret[i] = m1[i][col];
}
return ret;
} | [
"public",
"static",
"double",
"[",
"]",
"getCol",
"(",
"double",
"[",
"]",
"[",
"]",
"m1",
",",
"int",
"col",
")",
"{",
"double",
"[",
"]",
"ret",
"=",
"new",
"double",
"[",
"m1",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";"... | Get a column from a matrix as vector.
@param m1 Matrix to extract the column from
@param col Column number
@return Column | [
"Get",
"a",
"column",
"from",
"a",
"matrix",
"as",
"vector",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L1091-L1097 |
63,754 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.getDiagonal | public static double[] getDiagonal(final double[][] m1) {
final int dim = Math.min(getColumnDimensionality(m1), m1.length);
final double[] diagonal = new double[dim];
for(int i = 0; i < dim; i++) {
diagonal[i] = m1[i][i];
}
return diagonal;
} | java | public static double[] getDiagonal(final double[][] m1) {
final int dim = Math.min(getColumnDimensionality(m1), m1.length);
final double[] diagonal = new double[dim];
for(int i = 0; i < dim; i++) {
diagonal[i] = m1[i][i];
}
return diagonal;
} | [
"public",
"static",
"double",
"[",
"]",
"getDiagonal",
"(",
"final",
"double",
"[",
"]",
"[",
"]",
"m1",
")",
"{",
"final",
"int",
"dim",
"=",
"Math",
".",
"min",
"(",
"getColumnDimensionality",
"(",
"m1",
")",
",",
"m1",
".",
"length",
")",
";",
"... | getDiagonal returns array of diagonal-elements.
@param m1 Input matrix
@return values on the diagonal of the Matrix | [
"getDiagonal",
"returns",
"array",
"of",
"diagonal",
"-",
"elements",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L1555-L1562 |
63,755 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.normalizeColumns | public static void normalizeColumns(final double[][] m1) {
final int columndimension = getColumnDimensionality(m1);
for(int col = 0; col < columndimension; col++) {
double norm = 0.0;
for(int row = 0; row < m1.length; row++) {
final double v = m1[row][col];
norm += v * v;
}
... | java | public static void normalizeColumns(final double[][] m1) {
final int columndimension = getColumnDimensionality(m1);
for(int col = 0; col < columndimension; col++) {
double norm = 0.0;
for(int row = 0; row < m1.length; row++) {
final double v = m1[row][col];
norm += v * v;
}
... | [
"public",
"static",
"void",
"normalizeColumns",
"(",
"final",
"double",
"[",
"]",
"[",
"]",
"m1",
")",
"{",
"final",
"int",
"columndimension",
"=",
"getColumnDimensionality",
"(",
"m1",
")",
";",
"for",
"(",
"int",
"col",
"=",
"0",
";",
"col",
"<",
"co... | Normalizes the columns of this matrix to length of 1.0.
Note: if a column has length 0, it will remain unmodified.
@param m1 Input matrix | [
"Normalizes",
"the",
"columns",
"of",
"this",
"matrix",
"to",
"length",
"of",
"1",
".",
"0",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L1571-L1586 |
63,756 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.appendColumns | public static double[][] appendColumns(final double[][] m1, final double[][] m2) {
final int columndimension = getColumnDimensionality(m1);
final int ccolumndimension = getColumnDimensionality(m2);
assert m1.length == m2.length : "m.getRowDimension() != column.getRowDimension()";
final int rcolumndimen... | java | public static double[][] appendColumns(final double[][] m1, final double[][] m2) {
final int columndimension = getColumnDimensionality(m1);
final int ccolumndimension = getColumnDimensionality(m2);
assert m1.length == m2.length : "m.getRowDimension() != column.getRowDimension()";
final int rcolumndimen... | [
"public",
"static",
"double",
"[",
"]",
"[",
"]",
"appendColumns",
"(",
"final",
"double",
"[",
"]",
"[",
"]",
"m1",
",",
"final",
"double",
"[",
"]",
"[",
"]",
"m2",
")",
"{",
"final",
"int",
"columndimension",
"=",
"getColumnDimensionality",
"(",
"m1... | Returns a matrix which consists of this matrix and the specified columns.
@param m1 Input matrix
@param m2 the columns to be appended
@return the new matrix with the appended columns | [
"Returns",
"a",
"matrix",
"which",
"consists",
"of",
"this",
"matrix",
"and",
"the",
"specified",
"columns",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L1595-L1612 |
63,757 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.orthonormalize | public static double[][] orthonormalize(final double[][] m1) {
final int columndimension = getColumnDimensionality(m1);
final double[][] v = copy(m1);
// FIXME: optimize - excess copying!
for(int i = 1; i < columndimension; i++) {
final double[] u_i = getCol(m1, i);
final double[] sum = new... | java | public static double[][] orthonormalize(final double[][] m1) {
final int columndimension = getColumnDimensionality(m1);
final double[][] v = copy(m1);
// FIXME: optimize - excess copying!
for(int i = 1; i < columndimension; i++) {
final double[] u_i = getCol(m1, i);
final double[] sum = new... | [
"public",
"static",
"double",
"[",
"]",
"[",
"]",
"orthonormalize",
"(",
"final",
"double",
"[",
"]",
"[",
"]",
"m1",
")",
"{",
"final",
"int",
"columndimension",
"=",
"getColumnDimensionality",
"(",
"m1",
")",
";",
"final",
"double",
"[",
"]",
"[",
"]... | Returns an orthonormalization of this matrix.
@param m1 Input matrix
@return the orthonormalized matrix | [
"Returns",
"an",
"orthonormalization",
"of",
"this",
"matrix",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L1620-L1639 |
63,758 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.inverse | public static double[][] inverse(double[][] A) {
final int rows = A.length, cols = A[0].length;
return rows == cols //
? (new LUDecomposition(A, rows, cols)).inverse() //
: (new QRDecomposition(A, rows, cols)).inverse();
} | java | public static double[][] inverse(double[][] A) {
final int rows = A.length, cols = A[0].length;
return rows == cols //
? (new LUDecomposition(A, rows, cols)).inverse() //
: (new QRDecomposition(A, rows, cols)).inverse();
} | [
"public",
"static",
"double",
"[",
"]",
"[",
"]",
"inverse",
"(",
"double",
"[",
"]",
"[",
"]",
"A",
")",
"{",
"final",
"int",
"rows",
"=",
"A",
".",
"length",
",",
"cols",
"=",
"A",
"[",
"0",
"]",
".",
"length",
";",
"return",
"rows",
"==",
... | Matrix inverse or pseudoinverse
@param A matrix to invert
@return inverse(A) if A is square, pseudoinverse otherwise. | [
"Matrix",
"inverse",
"or",
"pseudoinverse"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L1673-L1678 |
63,759 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.almostEquals | public static boolean almostEquals(final double[] m1, final double[] m2, final double maxdelta) {
if(m1 == m2) {
return true;
}
if(m1 == null || m2 == null) {
return false;
}
final int rowdim = m1.length;
if(rowdim != m2.length) {
return false;
}
for(int i = 0; i < rowd... | java | public static boolean almostEquals(final double[] m1, final double[] m2, final double maxdelta) {
if(m1 == m2) {
return true;
}
if(m1 == null || m2 == null) {
return false;
}
final int rowdim = m1.length;
if(rowdim != m2.length) {
return false;
}
for(int i = 0; i < rowd... | [
"public",
"static",
"boolean",
"almostEquals",
"(",
"final",
"double",
"[",
"]",
"m1",
",",
"final",
"double",
"[",
"]",
"m2",
",",
"final",
"double",
"maxdelta",
")",
"{",
"if",
"(",
"m1",
"==",
"m2",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(... | Compare two matrices with a delta parameter to take numerical errors into
account.
@param m1 Input matrix
@param m2 other matrix to compare with
@param maxdelta maximum delta allowed
@return true if delta smaller than maximum | [
"Compare",
"two",
"matrices",
"with",
"a",
"delta",
"parameter",
"to",
"take",
"numerical",
"errors",
"into",
"account",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L1771-L1788 |
63,760 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.angle | public static double angle(double[] v1, double[] v2) {
final int mindim = (v1.length <= v2.length) ? v1.length : v2.length;
// Essentially, we want to compute this:
// v1.transposeTimes(v2) / (v1.euclideanLength() * v2.euclideanLength());
// We can just compute all three in parallel.
double s = 0, e... | java | public static double angle(double[] v1, double[] v2) {
final int mindim = (v1.length <= v2.length) ? v1.length : v2.length;
// Essentially, we want to compute this:
// v1.transposeTimes(v2) / (v1.euclideanLength() * v2.euclideanLength());
// We can just compute all three in parallel.
double s = 0, e... | [
"public",
"static",
"double",
"angle",
"(",
"double",
"[",
"]",
"v1",
",",
"double",
"[",
"]",
"v2",
")",
"{",
"final",
"int",
"mindim",
"=",
"(",
"v1",
".",
"length",
"<=",
"v2",
".",
"length",
")",
"?",
"v1",
".",
"length",
":",
"v2",
".",
"l... | Compute the cosine of the angle between two vectors,
where the smaller angle between those vectors is viewed.
@param v1 first vector
@param v2 second vector
@return cosine of the smaller angle | [
"Compute",
"the",
"cosine",
"of",
"the",
"angle",
"between",
"two",
"vectors",
"where",
"the",
"smaller",
"angle",
"between",
"those",
"vectors",
"is",
"viewed",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L1830-L1852 |
63,761 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/SelectionTableWindow.java | SelectionTableWindow.updateFromSelection | protected void updateFromSelection() {
DBIDSelection sel = context.getSelection();
if(sel != null) {
this.dbids = DBIDUtil.newArray(sel.getSelectedIds());
this.dbids.sort();
}
else {
this.dbids = DBIDUtil.newArray();
}
} | java | protected void updateFromSelection() {
DBIDSelection sel = context.getSelection();
if(sel != null) {
this.dbids = DBIDUtil.newArray(sel.getSelectedIds());
this.dbids.sort();
}
else {
this.dbids = DBIDUtil.newArray();
}
} | [
"protected",
"void",
"updateFromSelection",
"(",
")",
"{",
"DBIDSelection",
"sel",
"=",
"context",
".",
"getSelection",
"(",
")",
";",
"if",
"(",
"sel",
"!=",
"null",
")",
"{",
"this",
".",
"dbids",
"=",
"DBIDUtil",
".",
"newArray",
"(",
"sel",
".",
"g... | Update our selection | [
"Update",
"our",
"selection"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/SelectionTableWindow.java#L188-L197 |
63,762 | elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/datastore/DataStoreEvent.java | DataStoreEvent.insertionEvent | public static DataStoreEvent insertionEvent(DBIDs inserts) {
return new DataStoreEvent(inserts, DBIDUtil.EMPTYDBIDS, DBIDUtil.EMPTYDBIDS);
} | java | public static DataStoreEvent insertionEvent(DBIDs inserts) {
return new DataStoreEvent(inserts, DBIDUtil.EMPTYDBIDS, DBIDUtil.EMPTYDBIDS);
} | [
"public",
"static",
"DataStoreEvent",
"insertionEvent",
"(",
"DBIDs",
"inserts",
")",
"{",
"return",
"new",
"DataStoreEvent",
"(",
"inserts",
",",
"DBIDUtil",
".",
"EMPTYDBIDS",
",",
"DBIDUtil",
".",
"EMPTYDBIDS",
")",
";",
"}"
] | Insertion event.
@param inserts Insertions
@return Event | [
"Insertion",
"event",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/datastore/DataStoreEvent.java#L73-L75 |
63,763 | elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/datastore/DataStoreEvent.java | DataStoreEvent.removalEvent | public static DataStoreEvent removalEvent(DBIDs removals) {
return new DataStoreEvent(DBIDUtil.EMPTYDBIDS, removals, DBIDUtil.EMPTYDBIDS);
} | java | public static DataStoreEvent removalEvent(DBIDs removals) {
return new DataStoreEvent(DBIDUtil.EMPTYDBIDS, removals, DBIDUtil.EMPTYDBIDS);
} | [
"public",
"static",
"DataStoreEvent",
"removalEvent",
"(",
"DBIDs",
"removals",
")",
"{",
"return",
"new",
"DataStoreEvent",
"(",
"DBIDUtil",
".",
"EMPTYDBIDS",
",",
"removals",
",",
"DBIDUtil",
".",
"EMPTYDBIDS",
")",
";",
"}"
] | Removal event.
@param removals Removal
@return Event | [
"Removal",
"event",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/datastore/DataStoreEvent.java#L83-L85 |
63,764 | elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/datastore/DataStoreEvent.java | DataStoreEvent.updateEvent | public static DataStoreEvent updateEvent(DBIDs updates) {
return new DataStoreEvent(DBIDUtil.EMPTYDBIDS, DBIDUtil.EMPTYDBIDS, updates);
} | java | public static DataStoreEvent updateEvent(DBIDs updates) {
return new DataStoreEvent(DBIDUtil.EMPTYDBIDS, DBIDUtil.EMPTYDBIDS, updates);
} | [
"public",
"static",
"DataStoreEvent",
"updateEvent",
"(",
"DBIDs",
"updates",
")",
"{",
"return",
"new",
"DataStoreEvent",
"(",
"DBIDUtil",
".",
"EMPTYDBIDS",
",",
"DBIDUtil",
".",
"EMPTYDBIDS",
",",
"updates",
")",
";",
"}"
] | Update event.
@param updates Updates
@return Event | [
"Update",
"event",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/datastore/DataStoreEvent.java#L93-L95 |
63,765 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/detail/DetailView.java | DetailView.instantiateVisualization | private Visualization instantiateVisualization(VisualizationTask task) {
try {
Visualization v = task.getFactory().makeVisualization(context, task, this, width, height, item.proj);
if(task.has(RenderFlag.NO_EXPORT)) {
v.getLayer().setAttribute(NO_EXPORT_ATTRIBUTE, NO_EXPORT_ATTRIBUTE);
}
... | java | private Visualization instantiateVisualization(VisualizationTask task) {
try {
Visualization v = task.getFactory().makeVisualization(context, task, this, width, height, item.proj);
if(task.has(RenderFlag.NO_EXPORT)) {
v.getLayer().setAttribute(NO_EXPORT_ATTRIBUTE, NO_EXPORT_ATTRIBUTE);
}
... | [
"private",
"Visualization",
"instantiateVisualization",
"(",
"VisualizationTask",
"task",
")",
"{",
"try",
"{",
"Visualization",
"v",
"=",
"task",
".",
"getFactory",
"(",
")",
".",
"makeVisualization",
"(",
"context",
",",
"task",
",",
"this",
",",
"width",
",... | Instantiate a visualization.
@param task Task to instantiate
@return Visualization | [
"Instantiate",
"a",
"visualization",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/detail/DetailView.java#L226-L243 |
63,766 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/detail/DetailView.java | DetailView.destroy | public void destroy() {
context.removeVisualizationListener(this);
context.removeResultListener(this);
for(Entry<VisualizationTask, Visualization> v : taskmap.entrySet()) {
Visualization vis = v.getValue();
if(vis != null) {
vis.destroy();
}
}
taskmap.clear();
} | java | public void destroy() {
context.removeVisualizationListener(this);
context.removeResultListener(this);
for(Entry<VisualizationTask, Visualization> v : taskmap.entrySet()) {
Visualization vis = v.getValue();
if(vis != null) {
vis.destroy();
}
}
taskmap.clear();
} | [
"public",
"void",
"destroy",
"(",
")",
"{",
"context",
".",
"removeVisualizationListener",
"(",
"this",
")",
";",
"context",
".",
"removeResultListener",
"(",
"this",
")",
";",
"for",
"(",
"Entry",
"<",
"VisualizationTask",
",",
"Visualization",
">",
"v",
":... | Cleanup function. To remove listeners. | [
"Cleanup",
"function",
".",
"To",
"remove",
"listeners",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/detail/DetailView.java#L248-L258 |
63,767 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/detail/DetailView.java | DetailView.lazyRefresh | private void lazyRefresh() {
Runnable pr = new Runnable() {
@Override
public void run() {
if(pendingRefresh.compareAndSet(this, null)) {
refresh();
}
}
};
pendingRefresh.set(pr);
scheduleUpdate(pr);
} | java | private void lazyRefresh() {
Runnable pr = new Runnable() {
@Override
public void run() {
if(pendingRefresh.compareAndSet(this, null)) {
refresh();
}
}
};
pendingRefresh.set(pr);
scheduleUpdate(pr);
} | [
"private",
"void",
"lazyRefresh",
"(",
")",
"{",
"Runnable",
"pr",
"=",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"if",
"(",
"pendingRefresh",
".",
"compareAndSet",
"(",
"this",
",",
"null",
")",
")",
... | Trigger a refresh. | [
"Trigger",
"a",
"refresh",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/detail/DetailView.java#L288-L299 |
63,768 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/BufferedLineReader.java | BufferedLineReader.nextLine | public boolean nextLine() throws IOException {
while(reader.readLine(buf.delete(0, buf.length()))) {
++lineNumber;
if(lengthWithoutLinefeed(buf) > 0) {
return true;
}
}
return false;
} | java | public boolean nextLine() throws IOException {
while(reader.readLine(buf.delete(0, buf.length()))) {
++lineNumber;
if(lengthWithoutLinefeed(buf) > 0) {
return true;
}
}
return false;
} | [
"public",
"boolean",
"nextLine",
"(",
")",
"throws",
"IOException",
"{",
"while",
"(",
"reader",
".",
"readLine",
"(",
"buf",
".",
"delete",
"(",
"0",
",",
"buf",
".",
"length",
"(",
")",
")",
")",
")",
"{",
"++",
"lineNumber",
";",
"if",
"(",
"len... | Read the next line.
@return {@code true} if another line was read successfully.
@throws IOException on IO errors. | [
"Read",
"the",
"next",
"line",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/BufferedLineReader.java#L160-L168 |
63,769 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/BufferedLineReader.java | BufferedLineReader.lengthWithoutLinefeed | public static int lengthWithoutLinefeed(CharSequence line) {
int length = line.length();
while(length > 0) {
char last = line.charAt(length - 1);
if(last != '\n' && last != '\r') {
break;
}
--length;
}
return length;
} | java | public static int lengthWithoutLinefeed(CharSequence line) {
int length = line.length();
while(length > 0) {
char last = line.charAt(length - 1);
if(last != '\n' && last != '\r') {
break;
}
--length;
}
return length;
} | [
"public",
"static",
"int",
"lengthWithoutLinefeed",
"(",
"CharSequence",
"line",
")",
"{",
"int",
"length",
"=",
"line",
".",
"length",
"(",
")",
";",
"while",
"(",
"length",
">",
"0",
")",
"{",
"char",
"last",
"=",
"line",
".",
"charAt",
"(",
"length"... | Get the length of the string, not taking trailing linefeeds into account.
@param line Input line
@return Length | [
"Get",
"the",
"length",
"of",
"the",
"string",
"not",
"taking",
"trailing",
"linefeeds",
"into",
"account",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/BufferedLineReader.java#L185-L195 |
63,770 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameterization/AbstractParameterization.java | AbstractParameterization.logAndClearReportedErrors | public synchronized void logAndClearReportedErrors() {
for(ParameterException e : getErrors()) {
if(LOG.isDebugging()) {
LOG.warning(e.getMessage(), e);
}
else {
LOG.warning(e.getMessage());
}
}
clearErrors();
} | java | public synchronized void logAndClearReportedErrors() {
for(ParameterException e : getErrors()) {
if(LOG.isDebugging()) {
LOG.warning(e.getMessage(), e);
}
else {
LOG.warning(e.getMessage());
}
}
clearErrors();
} | [
"public",
"synchronized",
"void",
"logAndClearReportedErrors",
"(",
")",
"{",
"for",
"(",
"ParameterException",
"e",
":",
"getErrors",
"(",
")",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugging",
"(",
")",
")",
"{",
"LOG",
".",
"warning",
"(",
"e",
".",
"... | Log any error that has accumulated. | [
"Log",
"any",
"error",
"that",
"has",
"accumulated",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameterization/AbstractParameterization.java#L61-L71 |
63,771 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/configurator/ConfiguratorPanel.java | ConfiguratorPanel.addParameter | public void addParameter(Object owner, Parameter<?> param, TrackParameters track) {
this.setBorder(new SoftBevelBorder(SoftBevelBorder.LOWERED));
ParameterConfigurator cfg = null;
{ // Find
Object cur = owner;
while(cur != null) {
cfg = childconfig.get(cur);
if(cfg != null) {
... | java | public void addParameter(Object owner, Parameter<?> param, TrackParameters track) {
this.setBorder(new SoftBevelBorder(SoftBevelBorder.LOWERED));
ParameterConfigurator cfg = null;
{ // Find
Object cur = owner;
while(cur != null) {
cfg = childconfig.get(cur);
if(cfg != null) {
... | [
"public",
"void",
"addParameter",
"(",
"Object",
"owner",
",",
"Parameter",
"<",
"?",
">",
"param",
",",
"TrackParameters",
"track",
")",
"{",
"this",
".",
"setBorder",
"(",
"new",
"SoftBevelBorder",
"(",
"SoftBevelBorder",
".",
"LOWERED",
")",
")",
";",
"... | Add parameter to this panel.
@param param Parameter to add
@param track Parameter tracking object | [
"Add",
"parameter",
"to",
"this",
"panel",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/configurator/ConfiguratorPanel.java#L87-L109 |
63,772 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/strategies/split/AbstractMTreeSplit.java | AbstractMTreeSplit.computeDistanceMatrix | protected static <E extends MTreeEntry, N extends AbstractMTreeNode<?, N, E>> double[][] computeDistanceMatrix(AbstractMTree<?, N, E, ?> tree, N node) {
final int n = node.getNumEntries();
double[][] distancematrix = new double[n][n];
// Build distance matrix
for(int i = 0; i < n; i++) {
E ei = no... | java | protected static <E extends MTreeEntry, N extends AbstractMTreeNode<?, N, E>> double[][] computeDistanceMatrix(AbstractMTree<?, N, E, ?> tree, N node) {
final int n = node.getNumEntries();
double[][] distancematrix = new double[n][n];
// Build distance matrix
for(int i = 0; i < n; i++) {
E ei = no... | [
"protected",
"static",
"<",
"E",
"extends",
"MTreeEntry",
",",
"N",
"extends",
"AbstractMTreeNode",
"<",
"?",
",",
"N",
",",
"E",
">",
">",
"double",
"[",
"]",
"[",
"]",
"computeDistanceMatrix",
"(",
"AbstractMTree",
"<",
"?",
",",
"N",
",",
"E",
",",
... | Compute the pairwise distances in the given node.
@param tree Tree
@param node Node
@return Distance matrix | [
"Compute",
"the",
"pairwise",
"distances",
"in",
"the",
"given",
"node",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/strategies/split/AbstractMTreeSplit.java#L66-L78 |
63,773 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/AbstractAggarwalYuOutlier.java | AbstractAggarwalYuOutlier.sparsity | protected static double sparsity(final int setsize, final int dbsize, final int k, final double phi) {
// calculate sparsity c
final double fK = MathUtil.powi(1. / phi, k);
return (setsize - (dbsize * fK)) / FastMath.sqrt(dbsize * fK * (1 - fK));
} | java | protected static double sparsity(final int setsize, final int dbsize, final int k, final double phi) {
// calculate sparsity c
final double fK = MathUtil.powi(1. / phi, k);
return (setsize - (dbsize * fK)) / FastMath.sqrt(dbsize * fK * (1 - fK));
} | [
"protected",
"static",
"double",
"sparsity",
"(",
"final",
"int",
"setsize",
",",
"final",
"int",
"dbsize",
",",
"final",
"int",
"k",
",",
"final",
"double",
"phi",
")",
"{",
"// calculate sparsity c",
"final",
"double",
"fK",
"=",
"MathUtil",
".",
"powi",
... | Method to calculate the sparsity coefficient of.
@param setsize Size of subset
@param dbsize Size of database
@param k Dimensionality
@param phi Phi parameter
@return sparsity coefficient | [
"Method",
"to",
"calculate",
"the",
"sparsity",
"coefficient",
"of",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/AbstractAggarwalYuOutlier.java#L145-L149 |
63,774 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/AbstractAggarwalYuOutlier.java | AbstractAggarwalYuOutlier.computeSubspace | protected DBIDs computeSubspace(int[] subspace, ArrayList<ArrayList<DBIDs>> ranges) {
HashSetModifiableDBIDs ids = DBIDUtil.newHashSet(ranges.get(subspace[0]).get(subspace[1]));
// intersect all selected dimensions
for(int i = 2, e = subspace.length - 1; i < e; i += 2) {
DBIDs current = ranges.get(sub... | java | protected DBIDs computeSubspace(int[] subspace, ArrayList<ArrayList<DBIDs>> ranges) {
HashSetModifiableDBIDs ids = DBIDUtil.newHashSet(ranges.get(subspace[0]).get(subspace[1]));
// intersect all selected dimensions
for(int i = 2, e = subspace.length - 1; i < e; i += 2) {
DBIDs current = ranges.get(sub... | [
"protected",
"DBIDs",
"computeSubspace",
"(",
"int",
"[",
"]",
"subspace",
",",
"ArrayList",
"<",
"ArrayList",
"<",
"DBIDs",
">",
">",
"ranges",
")",
"{",
"HashSetModifiableDBIDs",
"ids",
"=",
"DBIDUtil",
".",
"newHashSet",
"(",
"ranges",
".",
"get",
"(",
... | Method to get the ids in the given subspace.
@param subspace Subspace to process
@param ranges List of DBID ranges
@return ids | [
"Method",
"to",
"get",
"the",
"ids",
"in",
"the",
"given",
"subspace",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/AbstractAggarwalYuOutlier.java#L158-L169 |
63,775 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/AbstractAggarwalYuOutlier.java | AbstractAggarwalYuOutlier.computeSubspaceForGene | protected DBIDs computeSubspaceForGene(short[] gene, ArrayList<ArrayList<DBIDs>> ranges) {
HashSetModifiableDBIDs m = null;
// intersect all present restrictions
for(int i = 0; i < gene.length; i++) {
if(gene[i] != DONT_CARE) {
DBIDs current = ranges.get(i).get(gene[i] - GENE_OFFSET);
... | java | protected DBIDs computeSubspaceForGene(short[] gene, ArrayList<ArrayList<DBIDs>> ranges) {
HashSetModifiableDBIDs m = null;
// intersect all present restrictions
for(int i = 0; i < gene.length; i++) {
if(gene[i] != DONT_CARE) {
DBIDs current = ranges.get(i).get(gene[i] - GENE_OFFSET);
... | [
"protected",
"DBIDs",
"computeSubspaceForGene",
"(",
"short",
"[",
"]",
"gene",
",",
"ArrayList",
"<",
"ArrayList",
"<",
"DBIDs",
">",
">",
"ranges",
")",
"{",
"HashSetModifiableDBIDs",
"m",
"=",
"null",
";",
"// intersect all present restrictions",
"for",
"(",
... | Get the DBIDs in the current subspace.
@param gene gene data
@param ranges Database ranges
@return resulting DBIDs | [
"Get",
"the",
"DBIDs",
"in",
"the",
"current",
"subspace",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/AbstractAggarwalYuOutlier.java#L178-L194 |
63,776 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/optics/OPTICSXi.java | OPTICSXi.updateFilterSDASet | private static void updateFilterSDASet(double mib, List<SteepDownArea> sdaset, double ixi) {
Iterator<SteepDownArea> iter = sdaset.iterator();
while(iter.hasNext()) {
SteepDownArea sda = iter.next();
if(sda.getMaximum() * ixi <= mib) {
iter.remove();
}
else {
// Update
... | java | private static void updateFilterSDASet(double mib, List<SteepDownArea> sdaset, double ixi) {
Iterator<SteepDownArea> iter = sdaset.iterator();
while(iter.hasNext()) {
SteepDownArea sda = iter.next();
if(sda.getMaximum() * ixi <= mib) {
iter.remove();
}
else {
// Update
... | [
"private",
"static",
"void",
"updateFilterSDASet",
"(",
"double",
"mib",
",",
"List",
"<",
"SteepDownArea",
">",
"sdaset",
",",
"double",
"ixi",
")",
"{",
"Iterator",
"<",
"SteepDownArea",
">",
"iter",
"=",
"sdaset",
".",
"iterator",
"(",
")",
";",
"while"... | Update the mib values of SteepDownAreas, and remove obsolete areas.
@param mib Maximum in-between value
@param sdaset Set of steep down areas. | [
"Update",
"the",
"mib",
"values",
"of",
"SteepDownAreas",
"and",
"remove",
"obsolete",
"areas",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/optics/OPTICSXi.java#L380-L394 |
63,777 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/arrays/DoubleIntegerArrayQuickSort.java | DoubleIntegerArrayQuickSort.sort5 | private static void sort5(double[] keys, int[] vals, final int m1, final int m2, final int m3, final int m4, final int m5) {
if(keys[m1] > keys[m2]) {
swap(keys, vals, m1, m2);
}
if(keys[m3] > keys[m4]) {
swap(keys, vals, m3, m4);
}
// Merge 1+2 and 3+4
if(keys[m2] > keys[m4]) {
... | java | private static void sort5(double[] keys, int[] vals, final int m1, final int m2, final int m3, final int m4, final int m5) {
if(keys[m1] > keys[m2]) {
swap(keys, vals, m1, m2);
}
if(keys[m3] > keys[m4]) {
swap(keys, vals, m3, m4);
}
// Merge 1+2 and 3+4
if(keys[m2] > keys[m4]) {
... | [
"private",
"static",
"void",
"sort5",
"(",
"double",
"[",
"]",
"keys",
",",
"int",
"[",
"]",
"vals",
",",
"final",
"int",
"m1",
",",
"final",
"int",
"m2",
",",
"final",
"int",
"m3",
",",
"final",
"int",
"m4",
",",
"final",
"int",
"m5",
")",
"{",
... | An explicit sort, for the five pivot candidates.
Note that this <em>must</em> only be used with
{@code m1 < m2 < m3 < m4 < m5}.
@param keys Keys
@param vals Values
@param m1 Pivot candidate position
@param m2 Pivot candidate position
@param m3 Pivot candidate position
@param m4 Pivot candidate position
@param m5 Pivo... | [
"An",
"explicit",
"sort",
"for",
"the",
"five",
"pivot",
"candidates",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/arrays/DoubleIntegerArrayQuickSort.java#L155-L185 |
63,778 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/arrays/DoubleIntegerArrayQuickSort.java | DoubleIntegerArrayQuickSort.swap | private static void swap(double[] keys, int[] vals, int j, int i) {
double td = keys[j];
keys[j] = keys[i];
keys[i] = td;
int ti = vals[j];
vals[j] = vals[i];
vals[i] = ti;
} | java | private static void swap(double[] keys, int[] vals, int j, int i) {
double td = keys[j];
keys[j] = keys[i];
keys[i] = td;
int ti = vals[j];
vals[j] = vals[i];
vals[i] = ti;
} | [
"private",
"static",
"void",
"swap",
"(",
"double",
"[",
"]",
"keys",
",",
"int",
"[",
"]",
"vals",
",",
"int",
"j",
",",
"int",
"i",
")",
"{",
"double",
"td",
"=",
"keys",
"[",
"j",
"]",
";",
"keys",
"[",
"j",
"]",
"=",
"keys",
"[",
"i",
"... | Swap two entries.
@param keys Keys
@param vals Values
@param j First index
@param i Second index | [
"Swap",
"two",
"entries",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/arrays/DoubleIntegerArrayQuickSort.java#L379-L386 |
63,779 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/EvaluationResult.java | EvaluationResult.newGroup | public EvaluationResult.MeasurementGroup newGroup(String string) {
EvaluationResult.MeasurementGroup g = new MeasurementGroup(string);
groups.add(g);
return g;
} | java | public EvaluationResult.MeasurementGroup newGroup(String string) {
EvaluationResult.MeasurementGroup g = new MeasurementGroup(string);
groups.add(g);
return g;
} | [
"public",
"EvaluationResult",
".",
"MeasurementGroup",
"newGroup",
"(",
"String",
"string",
")",
"{",
"EvaluationResult",
".",
"MeasurementGroup",
"g",
"=",
"new",
"MeasurementGroup",
"(",
"string",
")",
";",
"groups",
".",
"add",
"(",
"g",
")",
";",
"return",... | Add a new measurement group.
@param string Group name
@return Measurement group. | [
"Add",
"a",
"new",
"measurement",
"group",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/EvaluationResult.java#L64-L68 |
63,780 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/EvaluationResult.java | EvaluationResult.findOrCreateGroup | public EvaluationResult.MeasurementGroup findOrCreateGroup(String label) {
for(EvaluationResult.MeasurementGroup g : groups) {
if(label.equals(g.getName())) {
return g;
}
}
return newGroup(label);
} | java | public EvaluationResult.MeasurementGroup findOrCreateGroup(String label) {
for(EvaluationResult.MeasurementGroup g : groups) {
if(label.equals(g.getName())) {
return g;
}
}
return newGroup(label);
} | [
"public",
"EvaluationResult",
".",
"MeasurementGroup",
"findOrCreateGroup",
"(",
"String",
"label",
")",
"{",
"for",
"(",
"EvaluationResult",
".",
"MeasurementGroup",
"g",
":",
"groups",
")",
"{",
"if",
"(",
"label",
".",
"equals",
"(",
"g",
".",
"getName",
... | Find or add a new measurement group.
@param label Group name
@return Measurement group. | [
"Find",
"or",
"add",
"a",
"new",
"measurement",
"group",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/EvaluationResult.java#L76-L83 |
63,781 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/EvaluationResult.java | EvaluationResult.numLines | public int numLines() {
int r = header.size();
for(MeasurementGroup m : groups) {
r += 1 + m.measurements.size();
}
return r;
} | java | public int numLines() {
int r = header.size();
for(MeasurementGroup m : groups) {
r += 1 + m.measurements.size();
}
return r;
} | [
"public",
"int",
"numLines",
"(",
")",
"{",
"int",
"r",
"=",
"header",
".",
"size",
"(",
")",
";",
"for",
"(",
"MeasurementGroup",
"m",
":",
"groups",
")",
"{",
"r",
"+=",
"1",
"+",
"m",
".",
"measurements",
".",
"size",
"(",
")",
";",
"}",
"re... | Number of lines recommended for display.
@return Number of lines | [
"Number",
"of",
"lines",
"recommended",
"for",
"display",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/EvaluationResult.java#L126-L132 |
63,782 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/EvaluationResult.java | EvaluationResult.findOrCreate | public static EvaluationResult findOrCreate(ResultHierarchy hierarchy, Result parent, String name, String shortname) {
ArrayList<EvaluationResult> ers = ResultUtil.filterResults(hierarchy, parent, EvaluationResult.class);
EvaluationResult ev = null;
for(EvaluationResult e : ers) {
if(shortname.equals(... | java | public static EvaluationResult findOrCreate(ResultHierarchy hierarchy, Result parent, String name, String shortname) {
ArrayList<EvaluationResult> ers = ResultUtil.filterResults(hierarchy, parent, EvaluationResult.class);
EvaluationResult ev = null;
for(EvaluationResult e : ers) {
if(shortname.equals(... | [
"public",
"static",
"EvaluationResult",
"findOrCreate",
"(",
"ResultHierarchy",
"hierarchy",
",",
"Result",
"parent",
",",
"String",
"name",
",",
"String",
"shortname",
")",
"{",
"ArrayList",
"<",
"EvaluationResult",
">",
"ers",
"=",
"ResultUtil",
".",
"filterResu... | Find or create an evaluation result.
@param hierarchy Result hierarchy.
@param parent Parent result
@param name Long name
@param shortname Short name
@return Evaluation result | [
"Find",
"or",
"create",
"an",
"evaluation",
"result",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/EvaluationResult.java#L143-L157 |
63,783 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/xml/DOMCloner.java | DOMCloner.cloneDocument | public Document cloneDocument(DOMImplementation domImpl, Document document) {
Element root = document.getDocumentElement();
// New document
Document result = domImpl.createDocument(root.getNamespaceURI(), root.getNodeName(), null);
Element rroot = result.getDocumentElement();
// Cloning the document... | java | public Document cloneDocument(DOMImplementation domImpl, Document document) {
Element root = document.getDocumentElement();
// New document
Document result = domImpl.createDocument(root.getNamespaceURI(), root.getNodeName(), null);
Element rroot = result.getDocumentElement();
// Cloning the document... | [
"public",
"Document",
"cloneDocument",
"(",
"DOMImplementation",
"domImpl",
",",
"Document",
"document",
")",
"{",
"Element",
"root",
"=",
"document",
".",
"getDocumentElement",
"(",
")",
";",
"// New document",
"Document",
"result",
"=",
"domImpl",
".",
"createDo... | Deep-clone a document.
@param domImpl DOM implementation to use
@param document Original document
@return Cloned document | [
"Deep",
"-",
"clone",
"a",
"document",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/xml/DOMCloner.java#L44-L78 |
63,784 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/xml/DOMCloner.java | DOMCloner.cloneNode | public Node cloneNode(Document doc, Node eold) {
return doc.importNode(eold, true);
} | java | public Node cloneNode(Document doc, Node eold) {
return doc.importNode(eold, true);
} | [
"public",
"Node",
"cloneNode",
"(",
"Document",
"doc",
",",
"Node",
"eold",
")",
"{",
"return",
"doc",
".",
"importNode",
"(",
"eold",
",",
"true",
")",
";",
"}"
] | Clone an existing node.
@param doc Document
@param eold Existing node
@return Cloned node | [
"Clone",
"an",
"existing",
"node",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/xml/DOMCloner.java#L87-L89 |
63,785 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/xml/DOMCloner.java | DOMCloner.copyAttributes | public void copyAttributes(Document doc, Element eold, Element enew) {
if(eold.hasAttributes()) {
NamedNodeMap attr = eold.getAttributes();
int len = attr.getLength();
for(int i = 0; i < len; i++) {
enew.setAttributeNode((Attr) doc.importNode(attr.item(i), true));
}
}
} | java | public void copyAttributes(Document doc, Element eold, Element enew) {
if(eold.hasAttributes()) {
NamedNodeMap attr = eold.getAttributes();
int len = attr.getLength();
for(int i = 0; i < len; i++) {
enew.setAttributeNode((Attr) doc.importNode(attr.item(i), true));
}
}
} | [
"public",
"void",
"copyAttributes",
"(",
"Document",
"doc",
",",
"Element",
"eold",
",",
"Element",
"enew",
")",
"{",
"if",
"(",
"eold",
".",
"hasAttributes",
"(",
")",
")",
"{",
"NamedNodeMap",
"attr",
"=",
"eold",
".",
"getAttributes",
"(",
")",
";",
... | Copy the attributes from an existing node to a new node.
@param doc Target document
@param eold Existing node
@param enew Target node | [
"Copy",
"the",
"attributes",
"from",
"an",
"existing",
"node",
"to",
"a",
"new",
"node",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/xml/DOMCloner.java#L98-L106 |
63,786 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/result/textwriter/TextWriter.java | TextWriter.getFilename | protected String getFilename(Object result, String filenamepre) {
if(filenamepre == null || filenamepre.length() == 0) {
filenamepre = "result";
}
for(int i = 0;; i++) {
String filename = i > 0 ? filenamepre + "-" + i : filenamepre;
Object existing = filenames.get(filename);
if(exist... | java | protected String getFilename(Object result, String filenamepre) {
if(filenamepre == null || filenamepre.length() == 0) {
filenamepre = "result";
}
for(int i = 0;; i++) {
String filename = i > 0 ? filenamepre + "-" + i : filenamepre;
Object existing = filenames.get(filename);
if(exist... | [
"protected",
"String",
"getFilename",
"(",
"Object",
"result",
",",
"String",
"filenamepre",
")",
"{",
"if",
"(",
"filenamepre",
"==",
"null",
"||",
"filenamepre",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"filenamepre",
"=",
"\"result\"",
";",
"}",
... | Try to find a unique file name.
@param result Result we print
@param filenamepre File name prefix to use
@return unique filename | [
"Try",
"to",
"find",
"a",
"unique",
"file",
"name",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/result/textwriter/TextWriter.java#L144-L156 |
63,787 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/result/textwriter/TextWriter.java | TextWriter.output | @SuppressWarnings("unchecked")
public void output(Database db, Result r, StreamFactory streamOpener, Pattern filter) throws IOException {
List<Relation<?>> ra = new LinkedList<>();
List<OrderingResult> ro = new LinkedList<>();
List<Clustering<?>> rc = new LinkedList<>();
List<IterableResult<?>> ri = n... | java | @SuppressWarnings("unchecked")
public void output(Database db, Result r, StreamFactory streamOpener, Pattern filter) throws IOException {
List<Relation<?>> ra = new LinkedList<>();
List<OrderingResult> ro = new LinkedList<>();
List<Clustering<?>> rc = new LinkedList<>();
List<IterableResult<?>> ri = n... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"output",
"(",
"Database",
"db",
",",
"Result",
"r",
",",
"StreamFactory",
"streamOpener",
",",
"Pattern",
"filter",
")",
"throws",
"IOException",
"{",
"List",
"<",
"Relation",
"<",
"?",
"... | Stream output.
@param db Database object
@param r Result class
@param streamOpener output stream manager
@param filter Filter pattern
@throws IOException on IO error | [
"Stream",
"output",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/result/textwriter/TextWriter.java#L167-L230 |
63,788 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkapp/MkAppLeafEntry.java | MkAppLeafEntry.writeExternal | @Override
public void writeExternal(ObjectOutput out) throws IOException {
super.writeExternal(out);
out.writeObject(approximation);
} | java | @Override
public void writeExternal(ObjectOutput out) throws IOException {
super.writeExternal(out);
out.writeObject(approximation);
} | [
"@",
"Override",
"public",
"void",
"writeExternal",
"(",
"ObjectOutput",
"out",
")",
"throws",
"IOException",
"{",
"super",
".",
"writeExternal",
"(",
"out",
")",
";",
"out",
".",
"writeObject",
"(",
"approximation",
")",
";",
"}"
] | Calls the super method and writes the polynomiale approximation of the knn
distances of this entry to the specified stream.
@param out the stream to write the object to
@throws java.io.IOException Includes any I/O exceptions that may occur | [
"Calls",
"the",
"super",
"method",
"and",
"writes",
"the",
"polynomiale",
"approximation",
"of",
"the",
"knn",
"distances",
"of",
"this",
"entry",
"to",
"the",
"specified",
"stream",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkapp/MkAppLeafEntry.java#L107-L111 |
63,789 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkapp/MkAppLeafEntry.java | MkAppLeafEntry.readExternal | @Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
super.readExternal(in);
approximation = (PolynomialApproximation) in.readObject();
} | java | @Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
super.readExternal(in);
approximation = (PolynomialApproximation) in.readObject();
} | [
"@",
"Override",
"public",
"void",
"readExternal",
"(",
"ObjectInput",
"in",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"super",
".",
"readExternal",
"(",
"in",
")",
";",
"approximation",
"=",
"(",
"PolynomialApproximation",
")",
"in",
"."... | Calls the super method and reads the the polynomial approximation of the
knn distances of this entry from the specified input stream.
@param in the stream to read data from in order to restore the object
@throws java.io.IOException if I/O errors occur
@throws ClassNotFoundException If the class for an object being res... | [
"Calls",
"the",
"super",
"method",
"and",
"reads",
"the",
"the",
"polynomial",
"approximation",
"of",
"the",
"knn",
"distances",
"of",
"this",
"entry",
"from",
"the",
"specified",
"input",
"stream",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkapp/MkAppLeafEntry.java#L122-L126 |
63,790 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/PointerHierarchyRepresentationResult.java | PointerHierarchyRepresentationResult.computeSubtreeSizes | private WritableIntegerDataStore computeSubtreeSizes(DBIDs order) {
WritableIntegerDataStore siz = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, 1);
DBIDVar v1 = DBIDUtil.newVar();
for(DBIDIter it = order.iter(); it.valid(); it.advance()) {
if(DBIDUtil.e... | java | private WritableIntegerDataStore computeSubtreeSizes(DBIDs order) {
WritableIntegerDataStore siz = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, 1);
DBIDVar v1 = DBIDUtil.newVar();
for(DBIDIter it = order.iter(); it.valid(); it.advance()) {
if(DBIDUtil.e... | [
"private",
"WritableIntegerDataStore",
"computeSubtreeSizes",
"(",
"DBIDs",
"order",
")",
"{",
"WritableIntegerDataStore",
"siz",
"=",
"DataStoreUtil",
".",
"makeIntegerStorage",
"(",
"ids",
",",
"DataStoreFactory",
".",
"HINT_HOT",
"|",
"DataStoreFactory",
".",
"HINT_T... | Compute the size of all subtrees.
@param order Object order
@return Subtree sizes | [
"Compute",
"the",
"size",
"of",
"all",
"subtrees",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/PointerHierarchyRepresentationResult.java#L186-L196 |
63,791 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/PointerHierarchyRepresentationResult.java | PointerHierarchyRepresentationResult.computeMaxHeight | private WritableDoubleDataStore computeMaxHeight() {
WritableDoubleDataStore maxheight = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, 0.);
DBIDVar v1 = DBIDUtil.newVar();
for(DBIDIter it = ids.iter(); it.valid(); it.advance()) {
double d = parentDistance... | java | private WritableDoubleDataStore computeMaxHeight() {
WritableDoubleDataStore maxheight = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, 0.);
DBIDVar v1 = DBIDUtil.newVar();
for(DBIDIter it = ids.iter(); it.valid(); it.advance()) {
double d = parentDistance... | [
"private",
"WritableDoubleDataStore",
"computeMaxHeight",
"(",
")",
"{",
"WritableDoubleDataStore",
"maxheight",
"=",
"DataStoreUtil",
".",
"makeDoubleStorage",
"(",
"ids",
",",
"DataStoreFactory",
".",
"HINT_HOT",
"|",
"DataStoreFactory",
".",
"HINT_TEMP",
",",
"0.",
... | Compute the maximum height of nodes.
This is necessary, because some linkages may sometimes yield anomalies,
where {@code d(a+b,c) < min(d(a,c), d(b,c))}.
@return Maximum height. | [
"Compute",
"the",
"maximum",
"height",
"of",
"nodes",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/PointerHierarchyRepresentationResult.java#L206-L219 |
63,792 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/PointerHierarchyRepresentationResult.java | PointerHierarchyRepresentationResult.topologicalSort | public ArrayDBIDs topologicalSort() {
ArrayModifiableDBIDs ids = DBIDUtil.newArray(this.ids);
if(mergeOrder != null) {
ids.sort(new DataStoreUtil.AscendingByIntegerDataStore(mergeOrder));
WritableDoubleDataStore maxheight = computeMaxHeight();
ids.sort(new Sorter(maxheight));
maxheight.d... | java | public ArrayDBIDs topologicalSort() {
ArrayModifiableDBIDs ids = DBIDUtil.newArray(this.ids);
if(mergeOrder != null) {
ids.sort(new DataStoreUtil.AscendingByIntegerDataStore(mergeOrder));
WritableDoubleDataStore maxheight = computeMaxHeight();
ids.sort(new Sorter(maxheight));
maxheight.d... | [
"public",
"ArrayDBIDs",
"topologicalSort",
"(",
")",
"{",
"ArrayModifiableDBIDs",
"ids",
"=",
"DBIDUtil",
".",
"newArray",
"(",
"this",
".",
"ids",
")",
";",
"if",
"(",
"mergeOrder",
"!=",
"null",
")",
"{",
"ids",
".",
"sort",
"(",
"new",
"DataStoreUtil",
... | Topological sort the object IDs.
Even when we have this predefined merge order, it may be sub-optimal.
Such cases arise for example when using NNChain with single-link, as it
does not guarantee to discover merges in ascending order.
Therefore, we employ the following logic:
We process merges in merge order, and note ... | [
"Topological",
"sort",
"the",
"object",
"IDs",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/PointerHierarchyRepresentationResult.java#L235-L281 |
63,793 | elki-project/elki | elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/knn/SpacefillingKNNPreprocessor.java | SpacefillingKNNPreprocessor.range | public static int[] range(int start, int end) {
int[] out = new int[end - start];
for(int i = 0, j = start; j < end; i++, j++) {
out[i] = j;
}
return out;
} | java | public static int[] range(int start, int end) {
int[] out = new int[end - start];
for(int i = 0, j = start; j < end; i++, j++) {
out[i] = j;
}
return out;
} | [
"public",
"static",
"int",
"[",
"]",
"range",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"int",
"[",
"]",
"out",
"=",
"new",
"int",
"[",
"end",
"-",
"start",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"j",
"=",
"start",
";",
"j... | Initialize an integer value range.
@param start Starting value
@param end End value (exclusive)
@return Array of integers start..end, excluding end. | [
"Initialize",
"an",
"integer",
"value",
"range",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/knn/SpacefillingKNNPreprocessor.java#L298-L304 |
63,794 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkcop/MkCoPTree.java | MkCoPTree.doReverseKNNQuery | private void doReverseKNNQuery(int k, DBIDRef q, ModifiableDoubleDBIDList result, ModifiableDBIDs candidates) {
final ComparableMinHeap<MTreeSearchCandidate> pq = new ComparableMinHeap<>();
// push root
pq.add(new MTreeSearchCandidate(0., getRootID(), null, Double.NaN));
// search in tree
while(!p... | java | private void doReverseKNNQuery(int k, DBIDRef q, ModifiableDoubleDBIDList result, ModifiableDBIDs candidates) {
final ComparableMinHeap<MTreeSearchCandidate> pq = new ComparableMinHeap<>();
// push root
pq.add(new MTreeSearchCandidate(0., getRootID(), null, Double.NaN));
// search in tree
while(!p... | [
"private",
"void",
"doReverseKNNQuery",
"(",
"int",
"k",
",",
"DBIDRef",
"q",
",",
"ModifiableDoubleDBIDList",
"result",
",",
"ModifiableDBIDs",
"candidates",
")",
"{",
"final",
"ComparableMinHeap",
"<",
"MTreeSearchCandidate",
">",
"pq",
"=",
"new",
"ComparableMinH... | Performs a reverse knn query.
@param k the parameter k of the rknn query
@param q the id of the query object
@param result holds the true results (they need not to be refined)
@param candidates holds possible candidates for the result (they need a
refinement) | [
"Performs",
"a",
"reverse",
"knn",
"query",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkcop/MkCoPTree.java#L246-L292 |
63,795 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/LRUCache.java | LRUCache.expirePage | protected void expirePage(P page) {
if(LOG.isDebuggingFine()) {
LOG.debugFine("Write to backing:" + page.getPageID());
}
if (page.isDirty()) {
file.writePage(page);
}
} | java | protected void expirePage(P page) {
if(LOG.isDebuggingFine()) {
LOG.debugFine("Write to backing:" + page.getPageID());
}
if (page.isDirty()) {
file.writePage(page);
}
} | [
"protected",
"void",
"expirePage",
"(",
"P",
"page",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebuggingFine",
"(",
")",
")",
"{",
"LOG",
".",
"debugFine",
"(",
"\"Write to backing:\"",
"+",
"page",
".",
"getPageID",
"(",
")",
")",
";",
"}",
"if",
"(",
"pa... | Write page through to disk.
@param page page | [
"Write",
"page",
"through",
"to",
"disk",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/LRUCache.java#L133-L140 |
63,796 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/LRUCache.java | LRUCache.setCacheSize | public void setCacheSize(int cacheSize) {
this.cacheSize = cacheSize;
long toDelete = map.size() - this.cacheSize;
if(toDelete <= 0) {
return;
}
List<Integer> keys = new ArrayList<>(map.keySet());
Collections.reverse(keys);
for(Integer id : keys) {
P page = map.remove(id);
... | java | public void setCacheSize(int cacheSize) {
this.cacheSize = cacheSize;
long toDelete = map.size() - this.cacheSize;
if(toDelete <= 0) {
return;
}
List<Integer> keys = new ArrayList<>(map.keySet());
Collections.reverse(keys);
for(Integer id : keys) {
P page = map.remove(id);
... | [
"public",
"void",
"setCacheSize",
"(",
"int",
"cacheSize",
")",
"{",
"this",
".",
"cacheSize",
"=",
"cacheSize",
";",
"long",
"toDelete",
"=",
"map",
".",
"size",
"(",
")",
"-",
"this",
".",
"cacheSize",
";",
"if",
"(",
"toDelete",
"<=",
"0",
")",
"{... | Sets the maximum size of this cache.
@param cacheSize the cache size to be set | [
"Sets",
"the",
"maximum",
"size",
"of",
"this",
"cache",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/LRUCache.java#L234-L249 |
63,797 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FileUtil.java | FileUtil.getFilenameExtension | public static String getFilenameExtension(String name) {
if(name == null) {
return null;
}
int index = name.lastIndexOf('.');
return index < 0 ? null : name.substring(index + 1).toLowerCase();
} | java | public static String getFilenameExtension(String name) {
if(name == null) {
return null;
}
int index = name.lastIndexOf('.');
return index < 0 ? null : name.substring(index + 1).toLowerCase();
} | [
"public",
"static",
"String",
"getFilenameExtension",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"int",
"index",
"=",
"name",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"return",
"index",
... | Returns the lower case extension of the selected file.
If no file is selected, <code>null</code> is returned.
@param name File name
@return Returns the extension of the selected file in lower case or
<code>null</code> | [
"Returns",
"the",
"lower",
"case",
"extension",
"of",
"the",
"selected",
"file",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FileUtil.java#L70-L76 |
63,798 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FileUtil.java | FileUtil.tryGzipInput | public static InputStream tryGzipInput(InputStream in) throws IOException {
// try autodetecting gzip compression.
if(!in.markSupported()) {
PushbackInputStream pb = new PushbackInputStream(in, 16);
// read a magic from the file header, and push it back
byte[] magic = { 0, 0 };
int r = p... | java | public static InputStream tryGzipInput(InputStream in) throws IOException {
// try autodetecting gzip compression.
if(!in.markSupported()) {
PushbackInputStream pb = new PushbackInputStream(in, 16);
// read a magic from the file header, and push it back
byte[] magic = { 0, 0 };
int r = p... | [
"public",
"static",
"InputStream",
"tryGzipInput",
"(",
"InputStream",
"in",
")",
"throws",
"IOException",
"{",
"// try autodetecting gzip compression.",
"if",
"(",
"!",
"in",
".",
"markSupported",
"(",
")",
")",
"{",
"PushbackInputStream",
"pb",
"=",
"new",
"Push... | Try to open a stream as gzip, if it starts with the gzip magic.
@param in original input stream
@return old input stream or a {@link GZIPInputStream} if appropriate.
@throws IOException on IO error | [
"Try",
"to",
"open",
"a",
"stream",
"as",
"gzip",
"if",
"it",
"starts",
"with",
"the",
"gzip",
"magic",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FileUtil.java#L124-L139 |
63,799 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FileUtil.java | FileUtil.locateFile | public static File locateFile(String name, String basedir) {
// Try exact match first.
File f = new File(name);
if(f.exists()) {
return f;
}
// Try with base directory
if(basedir != null) {
if((f = new File(basedir, name)).exists()) {
return f;
}
}
// try stripp... | java | public static File locateFile(String name, String basedir) {
// Try exact match first.
File f = new File(name);
if(f.exists()) {
return f;
}
// Try with base directory
if(basedir != null) {
if((f = new File(basedir, name)).exists()) {
return f;
}
}
// try stripp... | [
"public",
"static",
"File",
"locateFile",
"(",
"String",
"name",
",",
"String",
"basedir",
")",
"{",
"// Try exact match first.",
"File",
"f",
"=",
"new",
"File",
"(",
"name",
")",
";",
"if",
"(",
"f",
".",
"exists",
"(",
")",
")",
"{",
"return",
"f",
... | Try to locate an file in the filesystem, given a partial name and a prefix.
@param name file name
@param basedir extra base directory to try
@return file, if the file could be found. {@code null} otherwise | [
"Try",
"to",
"locate",
"an",
"file",
"in",
"the",
"filesystem",
"given",
"a",
"partial",
"name",
"and",
"a",
"prefix",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FileUtil.java#L148-L185 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.