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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
Harium/keel | src/main/java/com/harium/keel/effect/height/Sobel.java | Sobel.apply | @Override
public ImageSource apply(ImageSource input) {
final int[][] pixelMatrix = new int[3][3];
int w = input.getWidth();
int h = input.getHeight();
int[][] output = new int[h][w];
for (int j = 1; j < h - 1; j++) {
for (int i = 1; i < w - 1; i++) {
... | java | @Override
public ImageSource apply(ImageSource input) {
final int[][] pixelMatrix = new int[3][3];
int w = input.getWidth();
int h = input.getHeight();
int[][] output = new int[h][w];
for (int j = 1; j < h - 1; j++) {
for (int i = 1; i < w - 1; i++) {
... | [
"@",
"Override",
"public",
"ImageSource",
"apply",
"(",
"ImageSource",
"input",
")",
"{",
"final",
"int",
"[",
"]",
"[",
"]",
"pixelMatrix",
"=",
"new",
"int",
"[",
"3",
"]",
"[",
"3",
"]",
";",
"int",
"w",
"=",
"input",
".",
"getWidth",
"(",
")",
... | Expects a height mat as input
@param input - A grayscale height map
@return edges | [
"Expects",
"a",
"height",
"mat",
"as",
"input"
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/height/Sobel.java#L19-L47 | train |
skuzzle/jeve | jeve/src/main/java/de/skuzzle/jeve/providers/EventStackImpl.java | EventStackImpl.popEvent | public <L extends Listener> void popEvent(Event<?, L> expected) {
synchronized (this.stack) {
final Event<?, ?> actual = this.stack.pop();
if (actual != expected) {
throw new IllegalStateException(String.format(
"Unbalanced pop: expected '%s' but e... | java | public <L extends Listener> void popEvent(Event<?, L> expected) {
synchronized (this.stack) {
final Event<?, ?> actual = this.stack.pop();
if (actual != expected) {
throw new IllegalStateException(String.format(
"Unbalanced pop: expected '%s' but e... | [
"public",
"<",
"L",
"extends",
"Listener",
">",
"void",
"popEvent",
"(",
"Event",
"<",
"?",
",",
"L",
">",
"expected",
")",
"{",
"synchronized",
"(",
"this",
".",
"stack",
")",
"{",
"final",
"Event",
"<",
"?",
",",
"?",
">",
"actual",
"=",
"this",
... | Pops the top event off the current event stack. This action has to be
performed immediately after the event has been dispatched to all
listeners.
@param <L> Type of the listener.
@param expected The Event which is expected at the top of the stack.
@see #pushEvent(Event) | [
"Pops",
"the",
"top",
"event",
"off",
"the",
"current",
"event",
"stack",
".",
"This",
"action",
"has",
"to",
"be",
"performed",
"immediately",
"after",
"the",
"event",
"has",
"been",
"dispatched",
"to",
"all",
"listeners",
"."
] | 42cc18947c9c8596c34410336e4e375e9fcd7c47 | https://github.com/skuzzle/jeve/blob/42cc18947c9c8596c34410336e4e375e9fcd7c47/jeve/src/main/java/de/skuzzle/jeve/providers/EventStackImpl.java#L114-L123 | train |
skuzzle/jeve | jeve/src/main/java/de/skuzzle/jeve/stores/AbstractSynchronizedListenerSource.java | AbstractSynchronizedListenerSource.modify | protected void modify(Transaction t) {
try {
this.lock.writeLock().lock();
t.perform();
} finally {
this.lock.writeLock().unlock();
}
} | java | protected void modify(Transaction t) {
try {
this.lock.writeLock().lock();
t.perform();
} finally {
this.lock.writeLock().unlock();
}
} | [
"protected",
"void",
"modify",
"(",
"Transaction",
"t",
")",
"{",
"try",
"{",
"this",
".",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"t",
".",
"perform",
"(",
")",
";",
"}",
"finally",
"{",
"this",
".",
"lock",
".",
"writeLo... | Executes the given transaction within the context of a write lock.
@param t The transaction to execute. | [
"Executes",
"the",
"given",
"transaction",
"within",
"the",
"context",
"of",
"a",
"write",
"lock",
"."
] | 42cc18947c9c8596c34410336e4e375e9fcd7c47 | https://github.com/skuzzle/jeve/blob/42cc18947c9c8596c34410336e4e375e9fcd7c47/jeve/src/main/java/de/skuzzle/jeve/stores/AbstractSynchronizedListenerSource.java#L48-L55 | train |
skuzzle/jeve | jeve/src/main/java/de/skuzzle/jeve/stores/AbstractSynchronizedListenerSource.java | AbstractSynchronizedListenerSource.read | protected <E> E read(Supplier<E> sup) {
try {
this.lock.readLock().lock();
return sup.get();
} finally {
this.lock.readLock().unlock();
}
} | java | protected <E> E read(Supplier<E> sup) {
try {
this.lock.readLock().lock();
return sup.get();
} finally {
this.lock.readLock().unlock();
}
} | [
"protected",
"<",
"E",
">",
"E",
"read",
"(",
"Supplier",
"<",
"E",
">",
"sup",
")",
"{",
"try",
"{",
"this",
".",
"lock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"return",
"sup",
".",
"get",
"(",
")",
";",
"}",
"finally",
"{",... | Executes the given supplier within the context of a read lock.
@param <E> The result type.
@param sup The supplier.
@return The result of {@link Supplier#get()}. | [
"Executes",
"the",
"given",
"supplier",
"within",
"the",
"context",
"of",
"a",
"read",
"lock",
"."
] | 42cc18947c9c8596c34410336e4e375e9fcd7c47 | https://github.com/skuzzle/jeve/blob/42cc18947c9c8596c34410336e4e375e9fcd7c47/jeve/src/main/java/de/skuzzle/jeve/stores/AbstractSynchronizedListenerSource.java#L64-L71 | train |
vnesek/nmote-iim4j | src/main/java/com/nmote/iim4j/stream/SubIIMInputStream.java | SubIIMInputStream.setOffsetAndLength | protected void setOffsetAndLength(long offset, int length) throws IOException {
this.offset = offset;
this.length = length;
this.position = 0;
if (subStream.position() != offset) {
subStream.seek(offset);
}
} | java | protected void setOffsetAndLength(long offset, int length) throws IOException {
this.offset = offset;
this.length = length;
this.position = 0;
if (subStream.position() != offset) {
subStream.seek(offset);
}
} | [
"protected",
"void",
"setOffsetAndLength",
"(",
"long",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"this",
".",
"offset",
"=",
"offset",
";",
"this",
".",
"length",
"=",
"length",
";",
"this",
".",
"position",
"=",
"0",
";",
"if",... | This should be called from a subclass constructor, if offset or length
are unknown at a time when SubIIMInputStream constructor is called. This
method shouldn't be called more than once.
@param offset
byte offset
@param length
byte length
@throws IOException
if underlying stream can't be read | [
"This",
"should",
"be",
"called",
"from",
"a",
"subclass",
"constructor",
"if",
"offset",
"or",
"length",
"are",
"unknown",
"at",
"a",
"time",
"when",
"SubIIMInputStream",
"constructor",
"is",
"called",
".",
"This",
"method",
"shouldn",
"t",
"be",
"called",
... | ec55b02fc644cd722e93051ac0bdb96b00cb42a8 | https://github.com/vnesek/nmote-iim4j/blob/ec55b02fc644cd722e93051ac0bdb96b00cb42a8/src/main/java/com/nmote/iim4j/stream/SubIIMInputStream.java#L64-L72 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Bessel.java | Bessel.J0 | public static double J0(double x) {
double ax;
if ((ax = Math.abs(x)) < 8.0) {
double y = x * x;
double ans1 = 57568490574.0 + y * (-13362590354.0 + y * (651619640.7
+ y * (-11214424.18 + y * (77392.33017 + y * (-184.9052456)))));
double an... | java | public static double J0(double x) {
double ax;
if ((ax = Math.abs(x)) < 8.0) {
double y = x * x;
double ans1 = 57568490574.0 + y * (-13362590354.0 + y * (651619640.7
+ y * (-11214424.18 + y * (77392.33017 + y * (-184.9052456)))));
double an... | [
"public",
"static",
"double",
"J0",
"(",
"double",
"x",
")",
"{",
"double",
"ax",
";",
"if",
"(",
"(",
"ax",
"=",
"Math",
".",
"abs",
"(",
"x",
")",
")",
"<",
"8.0",
")",
"{",
"double",
"y",
"=",
"x",
"*",
"x",
";",
"double",
"ans1",
"=",
"... | Bessel function of order 0.
@param x Value.
@return J0 value. | [
"Bessel",
"function",
"of",
"order",
"0",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Bessel.java#L66-L90 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Bessel.java | Bessel.J | public static double J(int n, double x) {
int j, m;
double ax, bj, bjm, bjp, sum, tox, ans;
boolean jsum;
double ACC = 40.0;
double BIGNO = 1.0e+10;
double BIGNI = 1.0e-10;
if (n == 0) return J0(x);
if (n == 1) return J(x);
ax = Math... | java | public static double J(int n, double x) {
int j, m;
double ax, bj, bjm, bjp, sum, tox, ans;
boolean jsum;
double ACC = 40.0;
double BIGNO = 1.0e+10;
double BIGNI = 1.0e-10;
if (n == 0) return J0(x);
if (n == 1) return J(x);
ax = Math... | [
"public",
"static",
"double",
"J",
"(",
"int",
"n",
",",
"double",
"x",
")",
"{",
"int",
"j",
",",
"m",
";",
"double",
"ax",
",",
"bj",
",",
"bjm",
",",
"bjp",
",",
"sum",
",",
"tox",
",",
"ans",
";",
"boolean",
"jsum",
";",
"double",
"ACC",
... | Bessel function of order n.
@param n Order.
@param x Value.
@return J value. | [
"Bessel",
"function",
"of",
"order",
"n",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Bessel.java#L134-L183 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Bessel.java | Bessel.Y0 | public static double Y0(double x) {
if (x < 8.0) {
double y = x * x;
double ans1 = -2957821389.0 + y * (7062834065.0 + y * (-512359803.6
+ y * (10879881.29 + y * (-86327.92757 + y * 228.4622733))));
double ans2 = 40076544269.0 + y * (745249964.8 + y... | java | public static double Y0(double x) {
if (x < 8.0) {
double y = x * x;
double ans1 = -2957821389.0 + y * (7062834065.0 + y * (-512359803.6
+ y * (10879881.29 + y * (-86327.92757 + y * 228.4622733))));
double ans2 = 40076544269.0 + y * (745249964.8 + y... | [
"public",
"static",
"double",
"Y0",
"(",
"double",
"x",
")",
"{",
"if",
"(",
"x",
"<",
"8.0",
")",
"{",
"double",
"y",
"=",
"x",
"*",
"x",
";",
"double",
"ans1",
"=",
"-",
"2957821389.0",
"+",
"y",
"*",
"(",
"7062834065.0",
"+",
"y",
"*",
"(",
... | Bessel function of the second kind, of order 0.
@param x Value.
@return Y0 value. | [
"Bessel",
"function",
"of",
"the",
"second",
"kind",
"of",
"order",
"0",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Bessel.java#L191-L214 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Bessel.java | Bessel.Y | public static double Y(double x) {
if (x < 8.0) {
double y = x * x;
double ans1 = x * (-0.4900604943e13 + y * (0.1275274390e13
+ y * (-0.5153438139e11 + y * (0.7349264551e9
+ y * (-0.4237922726e7 + y * 0.8511937935e4)))));
double ... | java | public static double Y(double x) {
if (x < 8.0) {
double y = x * x;
double ans1 = x * (-0.4900604943e13 + y * (0.1275274390e13
+ y * (-0.5153438139e11 + y * (0.7349264551e9
+ y * (-0.4237922726e7 + y * 0.8511937935e4)))));
double ... | [
"public",
"static",
"double",
"Y",
"(",
"double",
"x",
")",
"{",
"if",
"(",
"x",
"<",
"8.0",
")",
"{",
"double",
"y",
"=",
"x",
"*",
"x",
";",
"double",
"ans1",
"=",
"x",
"*",
"(",
"-",
"0.4900604943e13",
"+",
"y",
"*",
"(",
"0.1275274390e13",
... | Bessel function of the second kind, of order 1.
@param x Value.
@return Y value. | [
"Bessel",
"function",
"of",
"the",
"second",
"kind",
"of",
"order",
"1",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Bessel.java#L222-L244 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Bessel.java | Bessel.Y | public static double Y(int n, double x) {
double by, bym, byp, tox;
if (n == 0) return Y0(x);
if (n == 1) return Y(x);
tox = 2.0 / x;
by = Y(x);
bym = Y0(x);
for (int j = 1; j < n; j++) {
byp = j * tox * by - bym;
bym = by;
... | java | public static double Y(int n, double x) {
double by, bym, byp, tox;
if (n == 0) return Y0(x);
if (n == 1) return Y(x);
tox = 2.0 / x;
by = Y(x);
bym = Y0(x);
for (int j = 1; j < n; j++) {
byp = j * tox * by - bym;
bym = by;
... | [
"public",
"static",
"double",
"Y",
"(",
"int",
"n",
",",
"double",
"x",
")",
"{",
"double",
"by",
",",
"bym",
",",
"byp",
",",
"tox",
";",
"if",
"(",
"n",
"==",
"0",
")",
"return",
"Y0",
"(",
"x",
")",
";",
"if",
"(",
"n",
"==",
"1",
")",
... | Bessel function of the second kind, of order n.
@param n Order.
@param x Value.
@return Y value. | [
"Bessel",
"function",
"of",
"the",
"second",
"kind",
"of",
"order",
"n",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Bessel.java#L253-L268 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Bessel.java | Bessel.I0 | public static double I0(double x) {
double ans;
double ax = Math.abs(x);
if (ax < 3.75) {
double y = x / 3.75;
y = y * y;
ans = 1.0 + y * (3.5156229 + y * (3.0899424 + y * (1.2067492
+ y * (0.2659732 + y * (0.360768e-1 + y * 0.4581... | java | public static double I0(double x) {
double ans;
double ax = Math.abs(x);
if (ax < 3.75) {
double y = x / 3.75;
y = y * y;
ans = 1.0 + y * (3.5156229 + y * (3.0899424 + y * (1.2067492
+ y * (0.2659732 + y * (0.360768e-1 + y * 0.4581... | [
"public",
"static",
"double",
"I0",
"(",
"double",
"x",
")",
"{",
"double",
"ans",
";",
"double",
"ax",
"=",
"Math",
".",
"abs",
"(",
"x",
")",
";",
"if",
"(",
"ax",
"<",
"3.75",
")",
"{",
"double",
"y",
"=",
"x",
"/",
"3.75",
";",
"y",
"=",
... | Bessel function of the first kind, of order 0.
@param x Value.
@return I0 value. | [
"Bessel",
"function",
"of",
"the",
"first",
"kind",
"of",
"order",
"0",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Bessel.java#L276-L294 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Bessel.java | Bessel.I | public static double I(int n, double x) {
if (n < 0)
throw new IllegalArgumentException("the variable n out of range.");
else if (n == 0)
return I0(x);
else if (n == 1)
return I(x);
if (x == 0.0)
return 0.0;
double ACC ... | java | public static double I(int n, double x) {
if (n < 0)
throw new IllegalArgumentException("the variable n out of range.");
else if (n == 0)
return I0(x);
else if (n == 1)
return I(x);
if (x == 0.0)
return 0.0;
double ACC ... | [
"public",
"static",
"double",
"I",
"(",
"int",
"n",
",",
"double",
"x",
")",
"{",
"if",
"(",
"n",
"<",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"the variable n out of range.\"",
")",
";",
"else",
"if",
"(",
"n",
"==",
"0",
")",
"ret... | Bessel function of the first kind, of order n.
@param n Order.
@param x Value.
@return I value. | [
"Bessel",
"function",
"of",
"the",
"first",
"kind",
"of",
"order",
"n",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Bessel.java#L328-L364 | train |
Harium/keel | src/main/java/com/harium/keel/effect/normal/SobelNormalMap.java | SobelNormalMap.apply | @Override
public ImageSource apply(ImageSource input) {
int w = input.getWidth();
int h = input.getHeight();
MatrixSource output = new MatrixSource(input);
Vector3 n = new Vector3(0, 0, 1);
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
... | java | @Override
public ImageSource apply(ImageSource input) {
int w = input.getWidth();
int h = input.getHeight();
MatrixSource output = new MatrixSource(input);
Vector3 n = new Vector3(0, 0, 1);
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
... | [
"@",
"Override",
"public",
"ImageSource",
"apply",
"(",
"ImageSource",
"input",
")",
"{",
"int",
"w",
"=",
"input",
".",
"getWidth",
"(",
")",
";",
"int",
"h",
"=",
"input",
".",
"getHeight",
"(",
")",
";",
"MatrixSource",
"output",
"=",
"new",
"Matrix... | Sobel method to generate bump map from a height map
@param input - A height map
@return bump map | [
"Sobel",
"method",
"to",
"generate",
"bump",
"map",
"from",
"a",
"height",
"map"
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/normal/SobelNormalMap.java#L19-L57 | train |
hyleung/ratpack-zipkin | src/main/java/ratpack/zipkin/internal/RatpackCurrentTraceContext.java | RatpackCurrentTraceContext.wrap | @Deprecated
public static TraceContextHolder wrap(TraceContext traceContext) {
return (traceContext != null) ? new TraceContextHolder(traceContext) : TraceContextHolder.EMPTY;
} | java | @Deprecated
public static TraceContextHolder wrap(TraceContext traceContext) {
return (traceContext != null) ? new TraceContextHolder(traceContext) : TraceContextHolder.EMPTY;
} | [
"@",
"Deprecated",
"public",
"static",
"TraceContextHolder",
"wrap",
"(",
"TraceContext",
"traceContext",
")",
"{",
"return",
"(",
"traceContext",
"!=",
"null",
")",
"?",
"new",
"TraceContextHolder",
"(",
"traceContext",
")",
":",
"TraceContextHolder",
".",
"EMPTY... | Used by TracedParallelBatch where its used to wrap a TraceContext and puts it in the
registry for the forked execution. This is marked deprecated as we prefer not to
expose details of the RatpackCurrentTraceContext implementation.
@param traceContext a trace context.
@return a holder for the trace context, which can ... | [
"Used",
"by",
"TracedParallelBatch",
"where",
"its",
"used",
"to",
"wrap",
"a",
"TraceContext",
"and",
"puts",
"it",
"in",
"the",
"registry",
"for",
"the",
"forked",
"execution",
".",
"This",
"is",
"marked",
"deprecated",
"as",
"we",
"prefer",
"not",
"to",
... | 3c9e4b05e3f5fab034c1f7832fffce8a55c311d3 | https://github.com/hyleung/ratpack-zipkin/blob/3c9e4b05e3f5fab034c1f7832fffce8a55c311d3/src/main/java/ratpack/zipkin/internal/RatpackCurrentTraceContext.java#L64-L67 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/Tools.java | Tools.Sinc | public static double Sinc(double x) {
return Math.sin(Math.PI * x) / (Math.PI * x);
} | java | public static double Sinc(double x) {
return Math.sin(Math.PI * x) / (Math.PI * x);
} | [
"public",
"static",
"double",
"Sinc",
"(",
"double",
"x",
")",
"{",
"return",
"Math",
".",
"sin",
"(",
"Math",
".",
"PI",
"*",
"x",
")",
"/",
"(",
"Math",
".",
"PI",
"*",
"x",
")",
";",
"}"
] | Sinc function.
@param x Value.
@return Sinc of the value. | [
"Sinc",
"function",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/Tools.java#L68-L70 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/Tools.java | Tools.Mod | public static int Mod(int x, int m) {
if (m < 0) m = -m;
int r = x % m;
return r < 0 ? r + m : r;
} | java | public static int Mod(int x, int m) {
if (m < 0) m = -m;
int r = x % m;
return r < 0 ? r + m : r;
} | [
"public",
"static",
"int",
"Mod",
"(",
"int",
"x",
",",
"int",
"m",
")",
"{",
"if",
"(",
"m",
"<",
"0",
")",
"m",
"=",
"-",
"m",
";",
"int",
"r",
"=",
"x",
"%",
"m",
";",
"return",
"r",
"<",
"0",
"?",
"r",
"+",
"m",
":",
"r",
";",
"}"... | Gets the proper modulus operation.
@param x Integer.
@param m Modulo.
@return Modulus. | [
"Gets",
"the",
"proper",
"modulus",
"operation",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/Tools.java#L349-L353 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/Tools.java | Tools.NextPowerOf2 | public static int NextPowerOf2(int x) {
--x;
x |= x >> 1;
x |= x >> 2;
x |= x >> 4;
x |= x >> 8;
x |= x >> 16;
return ++x;
} | java | public static int NextPowerOf2(int x) {
--x;
x |= x >> 1;
x |= x >> 2;
x |= x >> 4;
x |= x >> 8;
x |= x >> 16;
return ++x;
} | [
"public",
"static",
"int",
"NextPowerOf2",
"(",
"int",
"x",
")",
"{",
"--",
"x",
";",
"x",
"|=",
"x",
">>",
"1",
";",
"x",
"|=",
"x",
">>",
"2",
";",
"x",
"|=",
"x",
">>",
"4",
";",
"x",
"|=",
"x",
">>",
"8",
";",
"x",
"|=",
"x",
">>",
... | Returns the next power of 2 after the input value x.
@param x Input value x.
@return Returns the next power of 2 after the input value x. | [
"Returns",
"the",
"next",
"power",
"of",
"2",
"after",
"the",
"input",
"value",
"x",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/Tools.java#L361-L369 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/Tools.java | Tools.Sum | public static float Sum(float[] data) {
float sum = 0;
for (int i = 0; i < data.length; i++) {
sum += data[i];
}
return sum;
} | java | public static float Sum(float[] data) {
float sum = 0;
for (int i = 0; i < data.length; i++) {
sum += data[i];
}
return sum;
} | [
"public",
"static",
"float",
"Sum",
"(",
"float",
"[",
"]",
"data",
")",
"{",
"float",
"sum",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"data",
".",
"length",
";",
"i",
"++",
")",
"{",
"sum",
"+=",
"data",
"[",
"i",
"]... | Sum of the elements.
@param data Data.
@return Sum(data). | [
"Sum",
"of",
"the",
"elements",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/Tools.java#L502-L508 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/Tools.java | Tools.TruncatedPower | public static double TruncatedPower(double value, double degree) {
double x = Math.pow(value, degree);
return (x > 0) ? x : 0.0;
} | java | public static double TruncatedPower(double value, double degree) {
double x = Math.pow(value, degree);
return (x > 0) ? x : 0.0;
} | [
"public",
"static",
"double",
"TruncatedPower",
"(",
"double",
"value",
",",
"double",
"degree",
")",
"{",
"double",
"x",
"=",
"Math",
".",
"pow",
"(",
"value",
",",
"degree",
")",
";",
"return",
"(",
"x",
">",
"0",
")",
"?",
"x",
":",
"0.0",
";",
... | Truncated power function.
@param value Value.
@param degree Degree.
@return Result. | [
"Truncated",
"power",
"function",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/Tools.java#L528-L531 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/Tools.java | Tools.Unique | public static int[] Unique(int[] values) {
HashSet<Integer> lst = new HashSet<Integer>();
for (int i = 0; i < values.length; i++) {
lst.add(values[i]);
}
int[] v = new int[lst.size()];
Iterator<Integer> it = lst.iterator();
for (int i = 0; i < v.lengt... | java | public static int[] Unique(int[] values) {
HashSet<Integer> lst = new HashSet<Integer>();
for (int i = 0; i < values.length; i++) {
lst.add(values[i]);
}
int[] v = new int[lst.size()];
Iterator<Integer> it = lst.iterator();
for (int i = 0; i < v.lengt... | [
"public",
"static",
"int",
"[",
"]",
"Unique",
"(",
"int",
"[",
"]",
"values",
")",
"{",
"HashSet",
"<",
"Integer",
">",
"lst",
"=",
"new",
"HashSet",
"<",
"Integer",
">",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"values"... | Get unique values form the array.
@param values Array of values.
@return Unique values. | [
"Get",
"unique",
"values",
"form",
"the",
"array",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/Tools.java#L539-L552 | train |
Harium/keel | src/main/java/com/harium/keel/effect/AlphaTrimmedMean.java | AlphaTrimmedMean.setT | public void setT(int t) {
this.t = Math.min((radius * 2 + 1) * (radius * 2 + 1) / 2, Math.max(0, t));
} | java | public void setT(int t) {
this.t = Math.min((radius * 2 + 1) * (radius * 2 + 1) / 2, Math.max(0, t));
} | [
"public",
"void",
"setT",
"(",
"int",
"t",
")",
"{",
"this",
".",
"t",
"=",
"Math",
".",
"min",
"(",
"(",
"radius",
"*",
"2",
"+",
"1",
")",
"*",
"(",
"radius",
"*",
"2",
"+",
"1",
")",
"/",
"2",
",",
"Math",
".",
"max",
"(",
"0",
",",
... | Set trimmed value.
@param t Trimmed value. | [
"Set",
"trimmed",
"value",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/AlphaTrimmedMean.java#L60-L62 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/TaylorSeries.java | TaylorSeries.Sin | public static double Sin(double x, int nTerms) {
if (nTerms < 2) return x;
if (nTerms == 2) {
return x - (x * x * x) / 6D;
} else {
double mult = x * x * x;
double fact = 6;
double sign = 1;
int factS = 5;
double ... | java | public static double Sin(double x, int nTerms) {
if (nTerms < 2) return x;
if (nTerms == 2) {
return x - (x * x * x) / 6D;
} else {
double mult = x * x * x;
double fact = 6;
double sign = 1;
int factS = 5;
double ... | [
"public",
"static",
"double",
"Sin",
"(",
"double",
"x",
",",
"int",
"nTerms",
")",
"{",
"if",
"(",
"nTerms",
"<",
"2",
")",
"return",
"x",
";",
"if",
"(",
"nTerms",
"==",
"2",
")",
"{",
"return",
"x",
"-",
"(",
"x",
"*",
"x",
"*",
"x",
")",
... | compute Sin using Taylor Series.
@param x An angle, in radians.
@param nTerms Number of terms.
@return Result. | [
"compute",
"Sin",
"using",
"Taylor",
"Series",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/TaylorSeries.java#L47-L68 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/TaylorSeries.java | TaylorSeries.Sinh | public static double Sinh(double x, int nTerms) {
if (nTerms < 2) return x;
if (nTerms == 2) {
return x + (x * x * x) / 6D;
} else {
double mult = x * x * x;
double fact = 6;
int factS = 5;
double result = x + mult / fact;
... | java | public static double Sinh(double x, int nTerms) {
if (nTerms < 2) return x;
if (nTerms == 2) {
return x + (x * x * x) / 6D;
} else {
double mult = x * x * x;
double fact = 6;
int factS = 5;
double result = x + mult / fact;
... | [
"public",
"static",
"double",
"Sinh",
"(",
"double",
"x",
",",
"int",
"nTerms",
")",
"{",
"if",
"(",
"nTerms",
"<",
"2",
")",
"return",
"x",
";",
"if",
"(",
"nTerms",
"==",
"2",
")",
"{",
"return",
"x",
"+",
"(",
"x",
"*",
"x",
"*",
"x",
")",... | compute Sinh using Taylor Series.
@param x An angle, in radians.
@param nTerms Number of terms.
@return Result. | [
"compute",
"Sinh",
"using",
"Taylor",
"Series",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/TaylorSeries.java#L107-L126 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/TaylorSeries.java | TaylorSeries.Cosh | public static double Cosh(double x, int nTerms) {
if (nTerms < 2) return x;
if (nTerms == 2) {
return 1 + (x * x) / 2D;
} else {
double mult = x * x;
double fact = 2;
int factS = 4;
double result = 1 + mult / fact;
... | java | public static double Cosh(double x, int nTerms) {
if (nTerms < 2) return x;
if (nTerms == 2) {
return 1 + (x * x) / 2D;
} else {
double mult = x * x;
double fact = 2;
int factS = 4;
double result = 1 + mult / fact;
... | [
"public",
"static",
"double",
"Cosh",
"(",
"double",
"x",
",",
"int",
"nTerms",
")",
"{",
"if",
"(",
"nTerms",
"<",
"2",
")",
"return",
"x",
";",
"if",
"(",
"nTerms",
"==",
"2",
")",
"{",
"return",
"1",
"+",
"(",
"x",
"*",
"x",
")",
"/",
"2D"... | compute Cosh using Taylor Series.
@param x An angle, in radians.
@param nTerms Number of terms.
@return Result. | [
"compute",
"Cosh",
"using",
"Taylor",
"Series",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/TaylorSeries.java#L135-L154 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/TaylorSeries.java | TaylorSeries.Exp | public static double Exp(double x, int nTerms) {
if (nTerms < 2) return 1 + x;
if (nTerms == 2) {
return 1 + x + (x * x) / 2;
} else {
double mult = x * x;
double fact = 2;
double result = 1 + x + mult / fact;
for (int i = 3; ... | java | public static double Exp(double x, int nTerms) {
if (nTerms < 2) return 1 + x;
if (nTerms == 2) {
return 1 + x + (x * x) / 2;
} else {
double mult = x * x;
double fact = 2;
double result = 1 + x + mult / fact;
for (int i = 3; ... | [
"public",
"static",
"double",
"Exp",
"(",
"double",
"x",
",",
"int",
"nTerms",
")",
"{",
"if",
"(",
"nTerms",
"<",
"2",
")",
"return",
"1",
"+",
"x",
";",
"if",
"(",
"nTerms",
"==",
"2",
")",
"{",
"return",
"1",
"+",
"x",
"+",
"(",
"x",
"*",
... | compute Exp using Taylor Series.
@param x An angle, in radians.
@param nTerms Number of terms.
@return Result. | [
"compute",
"Exp",
"using",
"Taylor",
"Series",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/TaylorSeries.java#L163-L180 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/decomposition/LUDecomposition.java | LUDecomposition.getU | public double[][] getU() {
double[][] X = new double[n][n];
double[][] U = X;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i <= j) {
U[i][j] = LU[i][j];
} else {
U[i][j] = 0.0;
... | java | public double[][] getU() {
double[][] X = new double[n][n];
double[][] U = X;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i <= j) {
U[i][j] = LU[i][j];
} else {
U[i][j] = 0.0;
... | [
"public",
"double",
"[",
"]",
"[",
"]",
"getU",
"(",
")",
"{",
"double",
"[",
"]",
"[",
"]",
"X",
"=",
"new",
"double",
"[",
"n",
"]",
"[",
"n",
"]",
";",
"double",
"[",
"]",
"[",
"]",
"U",
"=",
"X",
";",
"for",
"(",
"int",
"i",
"=",
"0... | Get the Upper triangular factor.
@return U. | [
"Get",
"the",
"Upper",
"triangular",
"factor",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/decomposition/LUDecomposition.java#L194-L207 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/decomposition/LUDecomposition.java | LUDecomposition.determinant | public double determinant() {
if (m != n) {
throw new IllegalArgumentException("Matrix must be square.");
}
double d = (double) pivsign;
for (int j = 0; j < n; j++) {
d *= LU[j][j];
}
return d;
} | java | public double determinant() {
if (m != n) {
throw new IllegalArgumentException("Matrix must be square.");
}
double d = (double) pivsign;
for (int j = 0; j < n; j++) {
d *= LU[j][j];
}
return d;
} | [
"public",
"double",
"determinant",
"(",
")",
"{",
"if",
"(",
"m",
"!=",
"n",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Matrix must be square.\"",
")",
";",
"}",
"double",
"d",
"=",
"(",
"double",
")",
"pivsign",
";",
"for",
"(",
"int"... | Calculate the determinant.
@return Determinant. | [
"Calculate",
"the",
"determinant",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/decomposition/LUDecomposition.java#L244-L253 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/ComplexNumber.java | ComplexNumber.Add | public static ComplexNumber Add(ComplexNumber z1, ComplexNumber z2) {
return new ComplexNumber(z1.real + z2.real, z1.imaginary + z2.imaginary);
} | java | public static ComplexNumber Add(ComplexNumber z1, ComplexNumber z2) {
return new ComplexNumber(z1.real + z2.real, z1.imaginary + z2.imaginary);
} | [
"public",
"static",
"ComplexNumber",
"Add",
"(",
"ComplexNumber",
"z1",
",",
"ComplexNumber",
"z2",
")",
"{",
"return",
"new",
"ComplexNumber",
"(",
"z1",
".",
"real",
"+",
"z2",
".",
"real",
",",
"z1",
".",
"imaginary",
"+",
"z2",
".",
"imaginary",
")",... | Adds two complex numbers.
@param z1 Complex Number.
@param z2 Complex Number.
@return Returns new ComplexNumber instance containing the sum of specified complex numbers. | [
"Adds",
"two",
"complex",
"numbers",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/ComplexNumber.java#L241-L243 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/ComplexNumber.java | ComplexNumber.Add | public static ComplexNumber Add(ComplexNumber z1, double scalar) {
return new ComplexNumber(z1.real + scalar, z1.imaginary);
} | java | public static ComplexNumber Add(ComplexNumber z1, double scalar) {
return new ComplexNumber(z1.real + scalar, z1.imaginary);
} | [
"public",
"static",
"ComplexNumber",
"Add",
"(",
"ComplexNumber",
"z1",
",",
"double",
"scalar",
")",
"{",
"return",
"new",
"ComplexNumber",
"(",
"z1",
".",
"real",
"+",
"scalar",
",",
"z1",
".",
"imaginary",
")",
";",
"}"
] | Adds the complex number with a scalar value.
@param z1 Complex Number.
@param scalar Scalar value.
@return Returns new ComplexNumber instance containing the add of specified complex number with scalar value. | [
"Adds",
"the",
"complex",
"number",
"with",
"a",
"scalar",
"value",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/ComplexNumber.java#L252-L254 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/ComplexNumber.java | ComplexNumber.Subtract | public static ComplexNumber Subtract(ComplexNumber z1, ComplexNumber z2) {
return new ComplexNumber(z1.real - z2.real, z1.imaginary - z2.imaginary);
} | java | public static ComplexNumber Subtract(ComplexNumber z1, ComplexNumber z2) {
return new ComplexNumber(z1.real - z2.real, z1.imaginary - z2.imaginary);
} | [
"public",
"static",
"ComplexNumber",
"Subtract",
"(",
"ComplexNumber",
"z1",
",",
"ComplexNumber",
"z2",
")",
"{",
"return",
"new",
"ComplexNumber",
"(",
"z1",
".",
"real",
"-",
"z2",
".",
"real",
",",
"z1",
".",
"imaginary",
"-",
"z2",
".",
"imaginary",
... | Subtract two complex numbers.
@param z1 Complex Number.
@param z2 Complex Number.
@return Returns new ComplexNumber instance containing the subtract of specified complex numbers. | [
"Subtract",
"two",
"complex",
"numbers",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/ComplexNumber.java#L272-L274 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/ComplexNumber.java | ComplexNumber.Subtract | public static ComplexNumber Subtract(ComplexNumber z1, double scalar) {
return new ComplexNumber(z1.real - scalar, z1.imaginary);
} | java | public static ComplexNumber Subtract(ComplexNumber z1, double scalar) {
return new ComplexNumber(z1.real - scalar, z1.imaginary);
} | [
"public",
"static",
"ComplexNumber",
"Subtract",
"(",
"ComplexNumber",
"z1",
",",
"double",
"scalar",
")",
"{",
"return",
"new",
"ComplexNumber",
"(",
"z1",
".",
"real",
"-",
"scalar",
",",
"z1",
".",
"imaginary",
")",
";",
"}"
] | Subtract a complex number.
@param z1 Complex Number.
@param scalar Scalar value.
@return Returns new ComplexNumber instance containing the subtract of specified complex number with a scalar value. | [
"Subtract",
"a",
"complex",
"number",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/ComplexNumber.java#L283-L285 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/ComplexNumber.java | ComplexNumber.Magnitude | public static double Magnitude(ComplexNumber z) {
return Math.sqrt(z.real * z.real + z.imaginary * z.imaginary);
} | java | public static double Magnitude(ComplexNumber z) {
return Math.sqrt(z.real * z.real + z.imaginary * z.imaginary);
} | [
"public",
"static",
"double",
"Magnitude",
"(",
"ComplexNumber",
"z",
")",
"{",
"return",
"Math",
".",
"sqrt",
"(",
"z",
".",
"real",
"*",
"z",
".",
"real",
"+",
"z",
".",
"imaginary",
"*",
"z",
".",
"imaginary",
")",
";",
"}"
] | Magnitude of complex number.
@param z Complex number.
@return Magnitude of complex number. | [
"Magnitude",
"of",
"complex",
"number",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/ComplexNumber.java#L302-L304 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/ComplexNumber.java | ComplexNumber.Multiply | public static ComplexNumber Multiply(ComplexNumber z1, ComplexNumber z2) {
double z1R = z1.real, z1I = z1.imaginary;
double z2R = z2.real, z2I = z2.imaginary;
return new ComplexNumber(z1R * z2R - z1I * z2I, z1R * z2I + z1I * z2R);
} | java | public static ComplexNumber Multiply(ComplexNumber z1, ComplexNumber z2) {
double z1R = z1.real, z1I = z1.imaginary;
double z2R = z2.real, z2I = z2.imaginary;
return new ComplexNumber(z1R * z2R - z1I * z2I, z1R * z2I + z1I * z2R);
} | [
"public",
"static",
"ComplexNumber",
"Multiply",
"(",
"ComplexNumber",
"z1",
",",
"ComplexNumber",
"z2",
")",
"{",
"double",
"z1R",
"=",
"z1",
".",
"real",
",",
"z1I",
"=",
"z1",
".",
"imaginary",
";",
"double",
"z2R",
"=",
"z2",
".",
"real",
",",
"z2I... | Multiply two complex numbers.
@param z1 Complex Number.
@param z2 Complex Number.
@return Returns new ComplexNumber instance containing the multiply of specified complex numbers. | [
"Multiply",
"two",
"complex",
"numbers",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/ComplexNumber.java#L313-L318 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/ComplexNumber.java | ComplexNumber.Multiply | public static ComplexNumber Multiply(ComplexNumber z1, double scalar) {
return new ComplexNumber(z1.real * scalar, z1.imaginary * scalar);
} | java | public static ComplexNumber Multiply(ComplexNumber z1, double scalar) {
return new ComplexNumber(z1.real * scalar, z1.imaginary * scalar);
} | [
"public",
"static",
"ComplexNumber",
"Multiply",
"(",
"ComplexNumber",
"z1",
",",
"double",
"scalar",
")",
"{",
"return",
"new",
"ComplexNumber",
"(",
"z1",
".",
"real",
"*",
"scalar",
",",
"z1",
".",
"imaginary",
"*",
"scalar",
")",
";",
"}"
] | Multiply scalar value to a complex number.
@param z1 Complex Number.
@param scalar Scalar value.
@return Returns new ComplexNumber instance containing the multiply of specified complex number with the scalar value. | [
"Multiply",
"scalar",
"value",
"to",
"a",
"complex",
"number",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/ComplexNumber.java#L327-L329 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/ComplexNumber.java | ComplexNumber.Divide | public static ComplexNumber Divide(ComplexNumber z1, ComplexNumber z2) {
ComplexNumber conj = ComplexNumber.Conjugate(z2);
double a = z1.real * conj.real + ((z1.imaginary * conj.imaginary) * -1);
double b = z1.real * conj.imaginary + (z1.imaginary * conj.real);
double c = z2.re... | java | public static ComplexNumber Divide(ComplexNumber z1, ComplexNumber z2) {
ComplexNumber conj = ComplexNumber.Conjugate(z2);
double a = z1.real * conj.real + ((z1.imaginary * conj.imaginary) * -1);
double b = z1.real * conj.imaginary + (z1.imaginary * conj.real);
double c = z2.re... | [
"public",
"static",
"ComplexNumber",
"Divide",
"(",
"ComplexNumber",
"z1",
",",
"ComplexNumber",
"z2",
")",
"{",
"ComplexNumber",
"conj",
"=",
"ComplexNumber",
".",
"Conjugate",
"(",
"z2",
")",
";",
"double",
"a",
"=",
"z1",
".",
"real",
"*",
"conj",
".",
... | Divide two complex numbers.
@param z1 Complex Number.
@param z2 Complex Number.
@return Returns new ComplexNumber instance containing the divide of specified complex numbers. | [
"Divide",
"two",
"complex",
"numbers",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/ComplexNumber.java#L348-L358 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/ComplexNumber.java | ComplexNumber.Pow | public static ComplexNumber Pow(ComplexNumber z1, double n) {
double norm = Math.pow(z1.getMagnitude(), n);
double angle = 360 - Math.abs(Math.toDegrees(Math.atan(z1.imaginary / z1.real)));
double common = n * angle;
double r = norm * Math.cos(Math.toRadians(common));
... | java | public static ComplexNumber Pow(ComplexNumber z1, double n) {
double norm = Math.pow(z1.getMagnitude(), n);
double angle = 360 - Math.abs(Math.toDegrees(Math.atan(z1.imaginary / z1.real)));
double common = n * angle;
double r = norm * Math.cos(Math.toRadians(common));
... | [
"public",
"static",
"ComplexNumber",
"Pow",
"(",
"ComplexNumber",
"z1",
",",
"double",
"n",
")",
"{",
"double",
"norm",
"=",
"Math",
".",
"pow",
"(",
"z1",
".",
"getMagnitude",
"(",
")",
",",
"n",
")",
";",
"double",
"angle",
"=",
"360",
"-",
"Math",... | Calculate power of a complex number.
@param z1 Complex Number.
@param n Power.
@return Returns a new complex number containing the power of a specified number. | [
"Calculate",
"power",
"of",
"a",
"complex",
"number",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/ComplexNumber.java#L414-L426 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/ComplexNumber.java | ComplexNumber.Sin | public static ComplexNumber Sin(ComplexNumber z1) {
ComplexNumber result = new ComplexNumber();
if (z1.imaginary == 0.0) {
result.real = Math.sin(z1.real);
result.imaginary = 0.0;
} else {
result.real = Math.sin(z1.real) * Math.cosh(z1.imaginary);
... | java | public static ComplexNumber Sin(ComplexNumber z1) {
ComplexNumber result = new ComplexNumber();
if (z1.imaginary == 0.0) {
result.real = Math.sin(z1.real);
result.imaginary = 0.0;
} else {
result.real = Math.sin(z1.real) * Math.cosh(z1.imaginary);
... | [
"public",
"static",
"ComplexNumber",
"Sin",
"(",
"ComplexNumber",
"z1",
")",
"{",
"ComplexNumber",
"result",
"=",
"new",
"ComplexNumber",
"(",
")",
";",
"if",
"(",
"z1",
".",
"imaginary",
"==",
"0.0",
")",
"{",
"result",
".",
"real",
"=",
"Math",
".",
... | Calculates Sine value of the complex number.
@param z1 A Complex Number instance.
@return Returns new ComplexNumber instance containing the Sine value of the specified complex number. | [
"Calculates",
"Sine",
"value",
"of",
"the",
"complex",
"number",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/ComplexNumber.java#L491-L503 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/ComplexNumber.java | ComplexNumber.Tan | public static ComplexNumber Tan(ComplexNumber z1) {
ComplexNumber result = new ComplexNumber();
if (z1.imaginary == 0.0) {
result.real = Math.tan(z1.real);
result.imaginary = 0.0;
} else {
double real2 = 2 * z1.real;
double imag2 = 2 * z1.... | java | public static ComplexNumber Tan(ComplexNumber z1) {
ComplexNumber result = new ComplexNumber();
if (z1.imaginary == 0.0) {
result.real = Math.tan(z1.real);
result.imaginary = 0.0;
} else {
double real2 = 2 * z1.real;
double imag2 = 2 * z1.... | [
"public",
"static",
"ComplexNumber",
"Tan",
"(",
"ComplexNumber",
"z1",
")",
"{",
"ComplexNumber",
"result",
"=",
"new",
"ComplexNumber",
"(",
")",
";",
"if",
"(",
"z1",
".",
"imaginary",
"==",
"0.0",
")",
"{",
"result",
".",
"real",
"=",
"Math",
".",
... | Calculates Tangent value of the complex number.
@param z1 A ComplexNumber instance.
@return Returns new ComplexNumber instance containing the Tangent value of the specified complex number. | [
"Calculates",
"Tangent",
"value",
"of",
"the",
"complex",
"number",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/ComplexNumber.java#L531-L547 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/random/UniversalGenerator.java | UniversalGenerator.srand | private void srand(int ijkl) {
u = new double[97];
int ij = ijkl / 30082;
int kl = ijkl % 30082;
// Handle the seed range errors
// First random number seed must be between 0 and 31328
// Second seed must have a value between 0 and 30081
if (ij < 0 || ij > 31328... | java | private void srand(int ijkl) {
u = new double[97];
int ij = ijkl / 30082;
int kl = ijkl % 30082;
// Handle the seed range errors
// First random number seed must be between 0 and 31328
// Second seed must have a value between 0 and 30081
if (ij < 0 || ij > 31328... | [
"private",
"void",
"srand",
"(",
"int",
"ijkl",
")",
"{",
"u",
"=",
"new",
"double",
"[",
"97",
"]",
";",
"int",
"ij",
"=",
"ijkl",
"/",
"30082",
";",
"int",
"kl",
"=",
"ijkl",
"%",
"30082",
";",
"// Handle the seed range errors",
"// First random number... | Initialize the random generator with a seed. | [
"Initialize",
"the",
"random",
"generator",
"with",
"a",
"seed",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/random/UniversalGenerator.java#L85-L128 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/core/IntPoint.java | IntPoint.DistanceTo | public float DistanceTo(IntPoint anotherPoint) {
float dx = this.x - anotherPoint.x;
float dy = this.y - anotherPoint.y;
return (float) Math.sqrt(dx * dx + dy * dy);
} | java | public float DistanceTo(IntPoint anotherPoint) {
float dx = this.x - anotherPoint.x;
float dy = this.y - anotherPoint.y;
return (float) Math.sqrt(dx * dx + dy * dy);
} | [
"public",
"float",
"DistanceTo",
"(",
"IntPoint",
"anotherPoint",
")",
"{",
"float",
"dx",
"=",
"this",
".",
"x",
"-",
"anotherPoint",
".",
"x",
";",
"float",
"dy",
"=",
"this",
".",
"y",
"-",
"anotherPoint",
".",
"y",
";",
"return",
"(",
"float",
")... | Calculate Euclidean distance between two points.
@param anotherPoint Point to calculate distance to.
@return Euclidean distance between this point and anotherPoint points. | [
"Calculate",
"Euclidean",
"distance",
"between",
"two",
"points",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/core/IntPoint.java#L260-L265 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/statistics/HistogramStatistics.java | HistogramStatistics.Entropy | public static double Entropy( int[] values ){
int n = values.length;
int total = 0;
double entropy = 0;
double p;
// calculate total amount of hits
for ( int i = 0; i < n; i++ )
{
total += values[i];
}
if ( total != 0 )
... | java | public static double Entropy( int[] values ){
int n = values.length;
int total = 0;
double entropy = 0;
double p;
// calculate total amount of hits
for ( int i = 0; i < n; i++ )
{
total += values[i];
}
if ( total != 0 )
... | [
"public",
"static",
"double",
"Entropy",
"(",
"int",
"[",
"]",
"values",
")",
"{",
"int",
"n",
"=",
"values",
".",
"length",
";",
"int",
"total",
"=",
"0",
";",
"double",
"entropy",
"=",
"0",
";",
"double",
"p",
";",
"// calculate total amount of hits",
... | Calculate entropy value.
@param values Values.
@return Returns entropy value of the specified histogram array. | [
"Calculate",
"entropy",
"value",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/statistics/HistogramStatistics.java#L46-L71 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/statistics/HistogramStatistics.java | HistogramStatistics.GetRange | public static IntRange GetRange( int[] values, double percent ){
int total = 0, n = values.length;
// for all values
for ( int i = 0; i < n; i++ )
{
// accumalate total
total += values[i];
}
int min, max, hits;
int h = (int) ( total * ( p... | java | public static IntRange GetRange( int[] values, double percent ){
int total = 0, n = values.length;
// for all values
for ( int i = 0; i < n; i++ )
{
// accumalate total
total += values[i];
}
int min, max, hits;
int h = (int) ( total * ( p... | [
"public",
"static",
"IntRange",
"GetRange",
"(",
"int",
"[",
"]",
"values",
",",
"double",
"percent",
")",
"{",
"int",
"total",
"=",
"0",
",",
"n",
"=",
"values",
".",
"length",
";",
"// for all values",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
... | Get range around median containing specified percentage of values.
@param values Values.
@param percent Values percentage around median.
@return Returns the range which containes specifies percentage of values. | [
"Get",
"range",
"around",
"median",
"containing",
"specified",
"percentage",
"of",
"values",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/statistics/HistogramStatistics.java#L79-L107 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/statistics/HistogramStatistics.java | HistogramStatistics.Median | public static int Median( int[] values ){
int total = 0, n = values.length;
// for all values
for ( int i = 0; i < n; i++ )
{
// accumalate total
total += values[i];
}
int halfTotal = total / 2;
int median = 0, v = 0;
// find med... | java | public static int Median( int[] values ){
int total = 0, n = values.length;
// for all values
for ( int i = 0; i < n; i++ )
{
// accumalate total
total += values[i];
}
int halfTotal = total / 2;
int median = 0, v = 0;
// find med... | [
"public",
"static",
"int",
"Median",
"(",
"int",
"[",
"]",
"values",
")",
"{",
"int",
"total",
"=",
"0",
",",
"n",
"=",
"values",
".",
"length",
";",
"// for all values",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"n",
";",
"i",
"++",
")"... | Calculate Median value.
@param values Values.
@return Median. | [
"Calculate",
"Median",
"value",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/statistics/HistogramStatistics.java#L172-L194 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/statistics/HistogramStatistics.java | HistogramStatistics.Mode | public static int Mode( int[] values ){
int mode = 0, curMax = 0;
for ( int i = 0, length = values.length; i < length; i++ )
{
if ( values[i] > curMax )
{
curMax = values[i];
mode = i;
}
}
return mode;
} | java | public static int Mode( int[] values ){
int mode = 0, curMax = 0;
for ( int i = 0, length = values.length; i < length; i++ )
{
if ( values[i] > curMax )
{
curMax = values[i];
mode = i;
}
}
return mode;
} | [
"public",
"static",
"int",
"Mode",
"(",
"int",
"[",
"]",
"values",
")",
"{",
"int",
"mode",
"=",
"0",
",",
"curMax",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"length",
"=",
"values",
".",
"length",
";",
"i",
"<",
"length",
";",
"... | Calculate Mode value.
@param values Values.
@return Returns mode value of the histogram array. | [
"Calculate",
"Mode",
"value",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/statistics/HistogramStatistics.java#L201-L213 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/statistics/HistogramStatistics.java | HistogramStatistics.StdDev | public static double StdDev( int[] values, double mean ){
double stddev = 0;
double diff;
int hits;
int total = 0;
// for all values
for ( int i = 0, n = values.length; i < n; i++ )
{
hits = values[i];
diff = (double) i - mean;
... | java | public static double StdDev( int[] values, double mean ){
double stddev = 0;
double diff;
int hits;
int total = 0;
// for all values
for ( int i = 0, n = values.length; i < n; i++ )
{
hits = values[i];
diff = (double) i - mean;
... | [
"public",
"static",
"double",
"StdDev",
"(",
"int",
"[",
"]",
"values",
",",
"double",
"mean",
")",
"{",
"double",
"stddev",
"=",
"0",
";",
"double",
"diff",
";",
"int",
"hits",
";",
"int",
"total",
"=",
"0",
";",
"// for all values",
"for",
"(",
"in... | Calculate standart deviation.
@param values Values.
@param mean Mean.
@return Standart deviation. | [
"Calculate",
"standart",
"deviation",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/statistics/HistogramStatistics.java#L263-L281 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/transform/DiscreteCosineTransform.java | DiscreteCosineTransform.Forward | public static void Forward(double[] data) {
double[] result = new double[data.length];
double sum;
double scale = Math.sqrt(2.0 / data.length);
for (int f = 0; f < data.length; f++) {
sum = 0;
for (int t = 0; t < data.length; t++) {
double cos = M... | java | public static void Forward(double[] data) {
double[] result = new double[data.length];
double sum;
double scale = Math.sqrt(2.0 / data.length);
for (int f = 0; f < data.length; f++) {
sum = 0;
for (int t = 0; t < data.length; t++) {
double cos = M... | [
"public",
"static",
"void",
"Forward",
"(",
"double",
"[",
"]",
"data",
")",
"{",
"double",
"[",
"]",
"result",
"=",
"new",
"double",
"[",
"data",
".",
"length",
"]",
";",
"double",
"sum",
";",
"double",
"scale",
"=",
"Math",
".",
"sqrt",
"(",
"2.0... | 1-D Forward Discrete Cosine Transform.
@param data Data. | [
"1",
"-",
"D",
"Forward",
"Discrete",
"Cosine",
"Transform",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/transform/DiscreteCosineTransform.java#L45-L61 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/transform/DiscreteCosineTransform.java | DiscreteCosineTransform.Forward | public static void Forward(double[][] data) {
int rows = data.length;
int cols = data[0].length;
double[] row = new double[cols];
double[] col = new double[rows];
for (int i = 0; i < rows; i++) {
for (int j = 0; j < row.length; j++)
row[j] = data[i][... | java | public static void Forward(double[][] data) {
int rows = data.length;
int cols = data[0].length;
double[] row = new double[cols];
double[] col = new double[rows];
for (int i = 0; i < rows; i++) {
for (int j = 0; j < row.length; j++)
row[j] = data[i][... | [
"public",
"static",
"void",
"Forward",
"(",
"double",
"[",
"]",
"[",
"]",
"data",
")",
"{",
"int",
"rows",
"=",
"data",
".",
"length",
";",
"int",
"cols",
"=",
"data",
"[",
"0",
"]",
".",
"length",
";",
"double",
"[",
"]",
"row",
"=",
"new",
"d... | 2-D Forward Discrete Cosine Transform.
@param data Data. | [
"2",
"-",
"D",
"Forward",
"Discrete",
"Cosine",
"Transform",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/transform/DiscreteCosineTransform.java#L68-L94 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/transform/DiscreteCosineTransform.java | DiscreteCosineTransform.Backward | public static void Backward(double[] data) {
double[] result = new double[data.length];
double sum;
double scale = Math.sqrt(2.0 / data.length);
for (int t = 0; t < data.length; t++) {
sum = 0;
for (int j = 0; j < data.length; j++) {
double cos = ... | java | public static void Backward(double[] data) {
double[] result = new double[data.length];
double sum;
double scale = Math.sqrt(2.0 / data.length);
for (int t = 0; t < data.length; t++) {
sum = 0;
for (int j = 0; j < data.length; j++) {
double cos = ... | [
"public",
"static",
"void",
"Backward",
"(",
"double",
"[",
"]",
"data",
")",
"{",
"double",
"[",
"]",
"result",
"=",
"new",
"double",
"[",
"data",
".",
"length",
"]",
";",
"double",
"sum",
";",
"double",
"scale",
"=",
"Math",
".",
"sqrt",
"(",
"2.... | 1-D Backward Discrete Cosine Transform.
@param data Data. | [
"1",
"-",
"D",
"Backward",
"Discrete",
"Cosine",
"Transform",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/transform/DiscreteCosineTransform.java#L101-L117 | train |
Harium/keel | src/main/java/com/harium/keel/effect/LevelsLinear.java | LevelsLinear.setInRGB | public void setInRGB(IntRange inRGB) {
this.inRed = inRGB;
this.inGreen = inRGB;
this.inBlue = inRGB;
CalculateMap(inRGB, outRed, mapRed);
CalculateMap(inRGB, outGreen, mapGreen);
CalculateMap(inRGB, outBlue, mapBlue);
} | java | public void setInRGB(IntRange inRGB) {
this.inRed = inRGB;
this.inGreen = inRGB;
this.inBlue = inRGB;
CalculateMap(inRGB, outRed, mapRed);
CalculateMap(inRGB, outGreen, mapGreen);
CalculateMap(inRGB, outBlue, mapBlue);
} | [
"public",
"void",
"setInRGB",
"(",
"IntRange",
"inRGB",
")",
"{",
"this",
".",
"inRed",
"=",
"inRGB",
";",
"this",
".",
"inGreen",
"=",
"inRGB",
";",
"this",
".",
"inBlue",
"=",
"inRGB",
";",
"CalculateMap",
"(",
"inRGB",
",",
"outRed",
",",
"mapRed",
... | Set RGB input range.
@param inRGB Range. | [
"Set",
"RGB",
"input",
"range",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/LevelsLinear.java#L222-L230 | train |
Harium/keel | src/main/java/com/harium/keel/effect/LevelsLinear.java | LevelsLinear.setOutRGB | public void setOutRGB(IntRange outRGB) {
this.outRed = outRGB;
this.outGreen = outRGB;
this.outBlue = outRGB;
CalculateMap(inRed, outRGB, mapRed);
CalculateMap(inGreen, outRGB, mapGreen);
CalculateMap(inBlue, outRGB, mapBlue);
} | java | public void setOutRGB(IntRange outRGB) {
this.outRed = outRGB;
this.outGreen = outRGB;
this.outBlue = outRGB;
CalculateMap(inRed, outRGB, mapRed);
CalculateMap(inGreen, outRGB, mapGreen);
CalculateMap(inBlue, outRGB, mapBlue);
} | [
"public",
"void",
"setOutRGB",
"(",
"IntRange",
"outRGB",
")",
"{",
"this",
".",
"outRed",
"=",
"outRGB",
";",
"this",
".",
"outGreen",
"=",
"outRGB",
";",
"this",
".",
"outBlue",
"=",
"outRGB",
";",
"CalculateMap",
"(",
"inRed",
",",
"outRGB",
",",
"m... | Set RGB output range.
@param outRGB Range. | [
"Set",
"RGB",
"output",
"range",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/LevelsLinear.java#L237-L245 | train |
Harium/keel | src/main/java/com/harium/keel/effect/LevelsLinear.java | LevelsLinear.CalculateMap | private void CalculateMap(IntRange inRange, IntRange outRange, int[] map) {
double k = 0, b = 0;
if (inRange.getMax() != inRange.getMin()) {
k = (double) (outRange.getMax() - outRange.getMin()) / (double) (inRange.getMax() - inRange.getMin());
b = (double) (outRange.getMin(... | java | private void CalculateMap(IntRange inRange, IntRange outRange, int[] map) {
double k = 0, b = 0;
if (inRange.getMax() != inRange.getMin()) {
k = (double) (outRange.getMax() - outRange.getMin()) / (double) (inRange.getMax() - inRange.getMin());
b = (double) (outRange.getMin(... | [
"private",
"void",
"CalculateMap",
"(",
"IntRange",
"inRange",
",",
"IntRange",
"outRange",
",",
"int",
"[",
"]",
"map",
")",
"{",
"double",
"k",
"=",
"0",
",",
"b",
"=",
"0",
";",
"if",
"(",
"inRange",
".",
"getMax",
"(",
")",
"!=",
"inRange",
"."... | Calculate conversion map.
@param inRange Input range.
@param outRange Output range.
@param map Conversion map. | [
"Calculate",
"conversion",
"map",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/LevelsLinear.java#L285-L305 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/tools/ImageStatistics.java | ImageStatistics.Maximum | public static int Maximum(ImageSource fastBitmap, int startX, int startY, int width, int height) {
int max = 0;
if (fastBitmap.isGrayscale()) {
for (int i = startX; i < height; i++) {
for (int j = startY; j < width; j++) {
int gray = fastBitmap.getR... | java | public static int Maximum(ImageSource fastBitmap, int startX, int startY, int width, int height) {
int max = 0;
if (fastBitmap.isGrayscale()) {
for (int i = startX; i < height; i++) {
for (int j = startY; j < width; j++) {
int gray = fastBitmap.getR... | [
"public",
"static",
"int",
"Maximum",
"(",
"ImageSource",
"fastBitmap",
",",
"int",
"startX",
",",
"int",
"startY",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"int",
"max",
"=",
"0",
";",
"if",
"(",
"fastBitmap",
".",
"isGrayscale",
"(",
")",... | Get maximum gray value in the image.
@param fastBitmap Image to be processed.
@param startX Initial X axis coordinate.
@param startY Initial Y axis coordinate.
@param width Width.
@param height Height.
@return Maximum gray. | [
"Get",
"maximum",
"gray",
"value",
"in",
"the",
"image",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/tools/ImageStatistics.java#L263-L287 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/tools/ImageStatistics.java | ImageStatistics.Minimum | public static int Minimum(ImageSource fastBitmap, int startX, int startY, int width, int height) {
int min = 255;
if (fastBitmap.isGrayscale()) {
for (int i = startX; i < height; i++) {
for (int j = startY; j < width; j++) {
int gray = fastBitmap.getR... | java | public static int Minimum(ImageSource fastBitmap, int startX, int startY, int width, int height) {
int min = 255;
if (fastBitmap.isGrayscale()) {
for (int i = startX; i < height; i++) {
for (int j = startY; j < width; j++) {
int gray = fastBitmap.getR... | [
"public",
"static",
"int",
"Minimum",
"(",
"ImageSource",
"fastBitmap",
",",
"int",
"startX",
",",
"int",
"startY",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"int",
"min",
"=",
"255",
";",
"if",
"(",
"fastBitmap",
".",
"isGrayscale",
"(",
")... | Get minimum gray value in the image.
@param fastBitmap Image to be processed.
@param startX Initial X axis coordinate.
@param startY Initial Y axis coordinate.
@param width Width.
@param height Height.
@return Minimum gray. | [
"Get",
"minimum",
"gray",
"value",
"in",
"the",
"image",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/tools/ImageStatistics.java#L309-L331 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.Bhattacharyya | public static double Bhattacharyya(double[] histogram1, double[] histogram2) {
int bins = histogram1.length; // histogram bins
double b = 0; // Bhattacharyya's coefficient
for (int i = 0; i < bins; i++)
b += Math.sqrt(histogram1[i]) * Math.sqrt(histogram2[i]);
// Bhattachar... | java | public static double Bhattacharyya(double[] histogram1, double[] histogram2) {
int bins = histogram1.length; // histogram bins
double b = 0; // Bhattacharyya's coefficient
for (int i = 0; i < bins; i++)
b += Math.sqrt(histogram1[i]) * Math.sqrt(histogram2[i]);
// Bhattachar... | [
"public",
"static",
"double",
"Bhattacharyya",
"(",
"double",
"[",
"]",
"histogram1",
",",
"double",
"[",
"]",
"histogram2",
")",
"{",
"int",
"bins",
"=",
"histogram1",
".",
"length",
";",
"// histogram bins",
"double",
"b",
"=",
"0",
";",
"// Bhattacharyya'... | Bhattacharyya distance between two normalized histograms.
@param histogram1 Normalized histogram.
@param histogram2 Normalized histogram.
@return The Bhattacharyya distance between the two histograms. | [
"Bhattacharyya",
"distance",
"between",
"two",
"normalized",
"histograms",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L68-L77 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.ChiSquare | public static double ChiSquare(double[] histogram1, double[] histogram2) {
double r = 0;
for (int i = 0; i < histogram1.length; i++) {
double t = histogram1[i] + histogram2[i];
if (t != 0)
r += Math.pow(histogram1[i] - histogram2[i], 2) / t;
}
ret... | java | public static double ChiSquare(double[] histogram1, double[] histogram2) {
double r = 0;
for (int i = 0; i < histogram1.length; i++) {
double t = histogram1[i] + histogram2[i];
if (t != 0)
r += Math.pow(histogram1[i] - histogram2[i], 2) / t;
}
ret... | [
"public",
"static",
"double",
"ChiSquare",
"(",
"double",
"[",
"]",
"histogram1",
",",
"double",
"[",
"]",
"histogram2",
")",
"{",
"double",
"r",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"histogram1",
".",
"length",
";",
"i",... | Gets the Chi Square distance between two normalized histograms.
@param histogram1 Histogram.
@param histogram2 Histogram.
@return The Chi Square distance between x and y. | [
"Gets",
"the",
"Chi",
"Square",
"distance",
"between",
"two",
"normalized",
"histograms",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L265-L274 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.Correlation | public static double Correlation(double[] p, double[] q) {
double x = 0;
double y = 0;
for (int i = 0; i < p.length; i++) {
x += -p[i];
y += -q[i];
}
x /= p.length;
y /= q.length;
double num = 0;
double den1 = 0;
double ... | java | public static double Correlation(double[] p, double[] q) {
double x = 0;
double y = 0;
for (int i = 0; i < p.length; i++) {
x += -p[i];
y += -q[i];
}
x /= p.length;
y /= q.length;
double num = 0;
double den1 = 0;
double ... | [
"public",
"static",
"double",
"Correlation",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"double",
"x",
"=",
"0",
";",
"double",
"y",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"p",
".",
"length"... | Gets the Correlation distance between two points.
@param p A point in space.
@param q A point in space.
@return The Correlation distance between x and y. | [
"Gets",
"the",
"Correlation",
"distance",
"between",
"two",
"points",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L283-L308 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.Hamming | public static int Hamming(String first, String second) {
if (first.length() != second.length())
throw new IllegalArgumentException("The size of string must be the same.");
int diff = 0;
for (int i = 0; i < first.length(); i++)
if (first.charAt(i) != second.charAt(i))
... | java | public static int Hamming(String first, String second) {
if (first.length() != second.length())
throw new IllegalArgumentException("The size of string must be the same.");
int diff = 0;
for (int i = 0; i < first.length(); i++)
if (first.charAt(i) != second.charAt(i))
... | [
"public",
"static",
"int",
"Hamming",
"(",
"String",
"first",
",",
"String",
"second",
")",
"{",
"if",
"(",
"first",
".",
"length",
"(",
")",
"!=",
"second",
".",
"length",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The size of stri... | Gets the Hamming distance between two strings.
@param first First string.
@param second Second string.
@return The Hamming distance between p and q. | [
"Gets",
"the",
"Hamming",
"distance",
"between",
"two",
"strings",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L412-L422 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.JaccardDistance | public static double JaccardDistance(double[] p, double[] q) {
double distance = 0;
int intersection = 0, union = 0;
for (int x = 0; x < p.length; x++) {
if ((p[x] != 0) || (q[x] != 0)) {
if (p[x] == q[x]) {
intersection++;
}
... | java | public static double JaccardDistance(double[] p, double[] q) {
double distance = 0;
int intersection = 0, union = 0;
for (int x = 0; x < p.length; x++) {
if ((p[x] != 0) || (q[x] != 0)) {
if (p[x] == q[x]) {
intersection++;
}
... | [
"public",
"static",
"double",
"JaccardDistance",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"double",
"distance",
"=",
"0",
";",
"int",
"intersection",
"=",
"0",
",",
"union",
"=",
"0",
";",
"for",
"(",
"int",
"x",
"=",
... | Gets the Jaccard distance between two points.
@param p A point in space.
@param q A point in space.
@return The Jaccard distance between x and y. | [
"Gets",
"the",
"Jaccard",
"distance",
"between",
"two",
"points",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L431-L451 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.JensenShannonDivergence | public static double JensenShannonDivergence(double[] p, double[] q) {
double[] m = new double[p.length];
for (int i = 0; i < m.length; i++) {
m[i] = (p[i] + q[i]) / 2;
}
return (KullbackLeiblerDivergence(p, m) + KullbackLeiblerDivergence(q, m)) / 2;
} | java | public static double JensenShannonDivergence(double[] p, double[] q) {
double[] m = new double[p.length];
for (int i = 0; i < m.length; i++) {
m[i] = (p[i] + q[i]) / 2;
}
return (KullbackLeiblerDivergence(p, m) + KullbackLeiblerDivergence(q, m)) / 2;
} | [
"public",
"static",
"double",
"JensenShannonDivergence",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"double",
"[",
"]",
"m",
"=",
"new",
"double",
"[",
"p",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";"... | Gets the Jensen Shannon divergence.
@param p U vector.
@param q V vector.
@return The Jensen Shannon divergence between u and v. | [
"Gets",
"the",
"Jensen",
"Shannon",
"divergence",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L509-L516 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.KumarJohnsonDivergence | public static double KumarJohnsonDivergence(double[] p, double[] q) {
double r = 0;
for (int i = 0; i < p.length; i++) {
if (p[i] != 0 && q[i] != 0) {
r += Math.pow(p[i] * p[i] - q[i] * q[i], 2) / 2 * Math.pow(p[i] * q[i], 1.5);
}
}
return r;
} | java | public static double KumarJohnsonDivergence(double[] p, double[] q) {
double r = 0;
for (int i = 0; i < p.length; i++) {
if (p[i] != 0 && q[i] != 0) {
r += Math.pow(p[i] * p[i] - q[i] * q[i], 2) / 2 * Math.pow(p[i] * q[i], 1.5);
}
}
return r;
} | [
"public",
"static",
"double",
"KumarJohnsonDivergence",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"double",
"r",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"p",
".",
"length",
";",
"i",
"++",
")"... | Gets the Kumar-Johnson divergence.
@param p P vector.
@param q Q vector.
@return The Kumar-Johnson divergence between p and q. | [
"Gets",
"the",
"Kumar",
"-",
"Johnson",
"divergence",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L543-L551 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.KullbackLeiblerDivergence | public static double KullbackLeiblerDivergence(double[] p, double[] q) {
boolean intersection = false;
double k = 0;
for (int i = 0; i < p.length; i++) {
if (p[i] != 0 && q[i] != 0) {
intersection = true;
k += p[i] * Math.log(p[i] / q[i]);
... | java | public static double KullbackLeiblerDivergence(double[] p, double[] q) {
boolean intersection = false;
double k = 0;
for (int i = 0; i < p.length; i++) {
if (p[i] != 0 && q[i] != 0) {
intersection = true;
k += p[i] * Math.log(p[i] / q[i]);
... | [
"public",
"static",
"double",
"KullbackLeiblerDivergence",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"boolean",
"intersection",
"=",
"false",
";",
"double",
"k",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
... | Gets the Kullback Leibler divergence.
@param p P vector.
@param q Q vector.
@return The Kullback Leibler divergence between u and v. | [
"Gets",
"the",
"Kullback",
"Leibler",
"divergence",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L560-L575 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.SquaredEuclidean | public static double SquaredEuclidean(double[] x, double[] y) {
double d = 0.0, u;
for (int i = 0; i < x.length; i++) {
u = x[i] - y[i];
d += u * u;
}
return d;
} | java | public static double SquaredEuclidean(double[] x, double[] y) {
double d = 0.0, u;
for (int i = 0; i < x.length; i++) {
u = x[i] - y[i];
d += u * u;
}
return d;
} | [
"public",
"static",
"double",
"SquaredEuclidean",
"(",
"double",
"[",
"]",
"x",
",",
"double",
"[",
"]",
"y",
")",
"{",
"double",
"d",
"=",
"0.0",
",",
"u",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"x",
".",
"length",
";",
"i",
"... | Gets the Square Euclidean distance between two points.
@param x A point in space.
@param y A point in space.
@return The Square Euclidean distance between x and y. | [
"Gets",
"the",
"Square",
"Euclidean",
"distance",
"between",
"two",
"points",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L801-L810 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.SymmetricChiSquareDivergence | public static double SymmetricChiSquareDivergence(double[] p, double[] q) {
double r = 0;
for (int i = 0; i < p.length; i++) {
double den = p[i] * q[i];
if (den != 0) {
double p1 = p[i] - q[i];
double p2 = p[i] + q[i];
r += (p1 * p1... | java | public static double SymmetricChiSquareDivergence(double[] p, double[] q) {
double r = 0;
for (int i = 0; i < p.length; i++) {
double den = p[i] * q[i];
if (den != 0) {
double p1 = p[i] - q[i];
double p2 = p[i] + q[i];
r += (p1 * p1... | [
"public",
"static",
"double",
"SymmetricChiSquareDivergence",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"double",
"r",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"p",
".",
"length",
";",
"i",
"++",... | Gets the Symmetric Chi-square divergence.
@param p P vector.
@param q Q vector.
@return The Symmetric chi-square divergence between p and q. | [
"Gets",
"the",
"Symmetric",
"Chi",
"-",
"square",
"divergence",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L851-L863 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.SymmetricKullbackLeibler | public static double SymmetricKullbackLeibler(double[] p, double[] q) {
double dist = 0;
for (int i = 0; i < p.length; i++) {
dist += (p[i] - q[i]) * (Math.log(p[i]) - Math.log(q[i]));
}
return dist;
} | java | public static double SymmetricKullbackLeibler(double[] p, double[] q) {
double dist = 0;
for (int i = 0; i < p.length; i++) {
dist += (p[i] - q[i]) * (Math.log(p[i]) - Math.log(q[i]));
}
return dist;
} | [
"public",
"static",
"double",
"SymmetricKullbackLeibler",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"double",
"dist",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"p",
".",
"length",
";",
"i",
"++",
... | Gets the Symmetric Kullback-Leibler distance.
This metric is valid only for real and positive P and Q.
@param p P vector.
@param q Q vector.
@return The Symmetric Kullback Leibler distance between p and q. | [
"Gets",
"the",
"Symmetric",
"Kullback",
"-",
"Leibler",
"distance",
".",
"This",
"metric",
"is",
"valid",
"only",
"for",
"real",
"and",
"positive",
"P",
"and",
"Q",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L873-L880 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.Taneja | public static double Taneja(double[] p, double[] q) {
double r = 0;
for (int i = 0; i < p.length; i++) {
if (p[i] != 0 && q[i] != 0) {
double pq = p[i] + q[i];
r += (pq / 2) * Math.log(pq / (2 * Math.sqrt(p[i] * q[i])));
}
}
return ... | java | public static double Taneja(double[] p, double[] q) {
double r = 0;
for (int i = 0; i < p.length; i++) {
if (p[i] != 0 && q[i] != 0) {
double pq = p[i] + q[i];
r += (pq / 2) * Math.log(pq / (2 * Math.sqrt(p[i] * q[i])));
}
}
return ... | [
"public",
"static",
"double",
"Taneja",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"double",
"r",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"p",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",... | Gets the Taneja divergence.
@param p P vector.
@param q Q vector.
@return The Taneja divergence between p and q. | [
"Gets",
"the",
"Taneja",
"divergence",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L889-L898 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.TopsoeDivergence | public static double TopsoeDivergence(double[] p, double[] q) {
double r = 0;
for (int i = 0; i < p.length; i++) {
if (p[i] != 0 && q[i] != 0) {
double den = p[i] + q[i];
r += p[i] * Math.log(2 * p[i] / den) + q[i] * Math.log(2 * q[i] / den);
}
... | java | public static double TopsoeDivergence(double[] p, double[] q) {
double r = 0;
for (int i = 0; i < p.length; i++) {
if (p[i] != 0 && q[i] != 0) {
double den = p[i] + q[i];
r += p[i] * Math.log(2 * p[i] / den) + q[i] * Math.log(2 * q[i] / den);
}
... | [
"public",
"static",
"double",
"TopsoeDivergence",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"double",
"r",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"p",
".",
"length",
";",
"i",
"++",
")",
"{... | Gets the Topsoe divergence.
@param p P vector.
@param q Q vector.
@return The Topsoe divergence between p and q. | [
"Gets",
"the",
"Topsoe",
"divergence",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L907-L916 | train |
Harium/keel | src/main/java/jdt/triangulation/Triangle.java | Triangle.contains | public boolean contains(Vector3 p) {
boolean ans = false;
if(this.halfplane || p== null) return false;
if (isCorner(p)) {
return true;
}
PointLinePosition a12 = PointLineTest.pointLineTest(a,b,p);
PointLinePosition a23 = PointLineTest.pointLineTest(b,c,p);
PointLinePosition a31 = PointLineTest.pointL... | java | public boolean contains(Vector3 p) {
boolean ans = false;
if(this.halfplane || p== null) return false;
if (isCorner(p)) {
return true;
}
PointLinePosition a12 = PointLineTest.pointLineTest(a,b,p);
PointLinePosition a23 = PointLineTest.pointLineTest(b,c,p);
PointLinePosition a31 = PointLineTest.pointL... | [
"public",
"boolean",
"contains",
"(",
"Vector3",
"p",
")",
"{",
"boolean",
"ans",
"=",
"false",
";",
"if",
"(",
"this",
".",
"halfplane",
"||",
"p",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"isCorner",
"(",
"p",
")",
")",
"{",
"return"... | determinates if this triangle contains the point p.
@param p the query point
@return true iff p is not null and is inside this triangle (Note: on boundary is considered inside!!). | [
"determinates",
"if",
"this",
"triangle",
"contains",
"the",
"point",
"p",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/jdt/triangulation/Triangle.java#L226-L245 | train |
Harium/keel | src/main/java/jdt/triangulation/Triangle.java | Triangle.calcDet | public static float calcDet(Vector3 a ,Vector3 b, Vector3 c) {
return (a.x*(b.y-c.y)) - (a.y*(b.x-c.x)) + (b.x*c.y-b.y*c.x);
} | java | public static float calcDet(Vector3 a ,Vector3 b, Vector3 c) {
return (a.x*(b.y-c.y)) - (a.y*(b.x-c.x)) + (b.x*c.y-b.y*c.x);
} | [
"public",
"static",
"float",
"calcDet",
"(",
"Vector3",
"a",
",",
"Vector3",
"b",
",",
"Vector3",
"c",
")",
"{",
"return",
"(",
"a",
".",
"x",
"*",
"(",
"b",
".",
"y",
"-",
"c",
".",
"y",
")",
")",
"-",
"(",
"a",
".",
"y",
"*",
"(",
"b",
... | checks if the triangle is not re-entrant | [
"checks",
"if",
"the",
"triangle",
"is",
"not",
"re",
"-",
"entrant"
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/jdt/triangulation/Triangle.java#L423-L425 | train |
Harium/keel | src/main/java/jdt/triangulation/Triangle.java | Triangle.sharedSegments | public int sharedSegments(Triangle t2) {
int counter = 0;
if(a.equals(t2.a)) {
counter++;
}
if(a.equals(t2.b)) {
counter++;
}
if(a.equals(t2.c)) {
counter++;
}
if(b.equals(t2.a)) {
counter++;
}
if(b.equals(t2.b)) {
counter++;
}
if(b.equals(t2.c)) {
counter++;
}
if(c.equals... | java | public int sharedSegments(Triangle t2) {
int counter = 0;
if(a.equals(t2.a)) {
counter++;
}
if(a.equals(t2.b)) {
counter++;
}
if(a.equals(t2.c)) {
counter++;
}
if(b.equals(t2.a)) {
counter++;
}
if(b.equals(t2.b)) {
counter++;
}
if(b.equals(t2.c)) {
counter++;
}
if(c.equals... | [
"public",
"int",
"sharedSegments",
"(",
"Triangle",
"t2",
")",
"{",
"int",
"counter",
"=",
"0",
";",
"if",
"(",
"a",
".",
"equals",
"(",
"t2",
".",
"a",
")",
")",
"{",
"counter",
"++",
";",
"}",
"if",
"(",
"a",
".",
"equals",
"(",
"t2",
".",
... | checks if the 2 triangles shares a segment
@author Doron Ganel & Eyal Roth(2009)
@param t2 - a second triangle
@return boolean | [
"checks",
"if",
"the",
"2",
"triangles",
"shares",
"a",
"segment"
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/jdt/triangulation/Triangle.java#L447-L479 | train |
Harium/keel | src/main/java/com/harium/keel/effect/BinaryErosion.java | BinaryErosion.apply | @Override
public ImageSource apply(ImageSource source) {
if (radius != 0) {
if (source.isGrayscale()) {
return applyGrayscale(source, radius);
} else {
return applyRGB(source, radius);
}
} else {
if (source.isGr... | java | @Override
public ImageSource apply(ImageSource source) {
if (radius != 0) {
if (source.isGrayscale()) {
return applyGrayscale(source, radius);
} else {
return applyRGB(source, radius);
}
} else {
if (source.isGr... | [
"@",
"Override",
"public",
"ImageSource",
"apply",
"(",
"ImageSource",
"source",
")",
"{",
"if",
"(",
"radius",
"!=",
"0",
")",
"{",
"if",
"(",
"source",
".",
"isGrayscale",
"(",
")",
")",
"{",
"return",
"applyGrayscale",
"(",
"source",
",",
"radius",
... | Apply filter to an image.
@param source FastBitmap | [
"Apply",
"filter",
"to",
"an",
"image",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/BinaryErosion.java#L74-L89 | train |
artikcloud/artikcloud-java | src/main/java/cloud/artik/client/ApiClient.java | ApiClient.handleResponse | public <T> T handleResponse(Response response, Type returnType) throws ApiException {
if (response.isSuccessful()) {
if (returnType == null || response.code() == 204) {
// returning null if the returnType is not defined,
// or the status code is 204 (No Content)
... | java | public <T> T handleResponse(Response response, Type returnType) throws ApiException {
if (response.isSuccessful()) {
if (returnType == null || response.code() == 204) {
// returning null if the returnType is not defined,
// or the status code is 204 (No Content)
... | [
"public",
"<",
"T",
">",
"T",
"handleResponse",
"(",
"Response",
"response",
",",
"Type",
"returnType",
")",
"throws",
"ApiException",
"{",
"if",
"(",
"response",
".",
"isSuccessful",
"(",
")",
")",
"{",
"if",
"(",
"returnType",
"==",
"null",
"||",
"resp... | Handle the given response, return the deserialized object when the response is successful.
@param <T> Type
@param response Response
@param returnType Return type
@throws ApiException If the response has a unsuccessful status code or
fail to deserialize the response body
@return Type | [
"Handle",
"the",
"given",
"response",
"return",
"the",
"deserialized",
"object",
"when",
"the",
"response",
"is",
"successful",
"."
] | 412f447573e7796ab4f685c0bdd5eb76185a365c | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/client/ApiClient.java#L1029-L1049 | train |
vnesek/nmote-iim4j | src/main/java/com/nmote/iim4j/IIMFile.java | IIMFile.add | public void add(int ds, Object value) throws SerializationException, InvalidDataSetException {
if (value == null) {
return;
}
DataSetInfo dsi = dsiFactory.create(ds);
byte[] data = dsi.getSerializer().serialize(value, activeSerializationContext);
DataSet dataSet = new DefaultDataSet(dsi, data);
... | java | public void add(int ds, Object value) throws SerializationException, InvalidDataSetException {
if (value == null) {
return;
}
DataSetInfo dsi = dsiFactory.create(ds);
byte[] data = dsi.getSerializer().serialize(value, activeSerializationContext);
DataSet dataSet = new DefaultDataSet(dsi, data);
... | [
"public",
"void",
"add",
"(",
"int",
"ds",
",",
"Object",
"value",
")",
"throws",
"SerializationException",
",",
"InvalidDataSetException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
";",
"}",
"DataSetInfo",
"dsi",
"=",
"dsiFactory",
".",
"... | Adds a data set to IIM file.
@param ds
data set id (see constants in IIM class)
@param value
data set value. Null values are silently ignored.
@throws SerializationException
if value can't be serialized by data set's serializer
@throws InvalidDataSetException
if data set isn't defined | [
"Adds",
"a",
"data",
"set",
"to",
"IIM",
"file",
"."
] | ec55b02fc644cd722e93051ac0bdb96b00cb42a8 | https://github.com/vnesek/nmote-iim4j/blob/ec55b02fc644cd722e93051ac0bdb96b00cb42a8/src/main/java/com/nmote/iim4j/IIMFile.java#L79-L88 | train |
vnesek/nmote-iim4j | src/main/java/com/nmote/iim4j/IIMFile.java | IIMFile.addDateTimeHelper | public void addDateTimeHelper(int ds, Date date) throws SerializationException, InvalidDataSetException {
if (date == null) {
return;
}
DataSetInfo dsi = dsiFactory.create(ds);
SimpleDateFormat df = new SimpleDateFormat(dsi.getSerializer().toString());
String value = df.format(date);
byte[] da... | java | public void addDateTimeHelper(int ds, Date date) throws SerializationException, InvalidDataSetException {
if (date == null) {
return;
}
DataSetInfo dsi = dsiFactory.create(ds);
SimpleDateFormat df = new SimpleDateFormat(dsi.getSerializer().toString());
String value = df.format(date);
byte[] da... | [
"public",
"void",
"addDateTimeHelper",
"(",
"int",
"ds",
",",
"Date",
"date",
")",
"throws",
"SerializationException",
",",
"InvalidDataSetException",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"{",
"return",
";",
"}",
"DataSetInfo",
"dsi",
"=",
"dsiFactory",
... | Adds a data set with date-time value to IIM file.
@param ds
data set id (see constants in IIM class)
@param date
date to set. Null values are silently ignored.
@throws SerializationException
if value can't be serialized by data set's serializer
@throws InvalidDataSetException
if data set isn't defined | [
"Adds",
"a",
"data",
"set",
"with",
"date",
"-",
"time",
"value",
"to",
"IIM",
"file",
"."
] | ec55b02fc644cd722e93051ac0bdb96b00cb42a8 | https://github.com/vnesek/nmote-iim4j/blob/ec55b02fc644cd722e93051ac0bdb96b00cb42a8/src/main/java/com/nmote/iim4j/IIMFile.java#L102-L114 | train |
vnesek/nmote-iim4j | src/main/java/com/nmote/iim4j/IIMFile.java | IIMFile.get | public Object get(int dataSet) throws SerializationException {
Object result = null;
for (Iterator<DataSet> i = dataSets.iterator(); i.hasNext();) {
DataSet ds = i.next();
DataSetInfo info = ds.getInfo();
if (info.getDataSetNumber() == dataSet) {
result = getData(ds);
break;
}
}
re... | java | public Object get(int dataSet) throws SerializationException {
Object result = null;
for (Iterator<DataSet> i = dataSets.iterator(); i.hasNext();) {
DataSet ds = i.next();
DataSetInfo info = ds.getInfo();
if (info.getDataSetNumber() == dataSet) {
result = getData(ds);
break;
}
}
re... | [
"public",
"Object",
"get",
"(",
"int",
"dataSet",
")",
"throws",
"SerializationException",
"{",
"Object",
"result",
"=",
"null",
";",
"for",
"(",
"Iterator",
"<",
"DataSet",
">",
"i",
"=",
"dataSets",
".",
"iterator",
"(",
")",
";",
"i",
".",
"hasNext",
... | Gets a first data set value.
@param dataSet
IIM record and dataset code (See constants in {@link IIM})
@return data set value
@throws SerializationException
if value can't be deserialized from binary representation | [
"Gets",
"a",
"first",
"data",
"set",
"value",
"."
] | ec55b02fc644cd722e93051ac0bdb96b00cb42a8 | https://github.com/vnesek/nmote-iim4j/blob/ec55b02fc644cd722e93051ac0bdb96b00cb42a8/src/main/java/com/nmote/iim4j/IIMFile.java#L148-L159 | train |
vnesek/nmote-iim4j | src/main/java/com/nmote/iim4j/IIMFile.java | IIMFile.getAll | public List<Object> getAll(int dataSet) throws SerializationException {
List<Object> result = new ArrayList<Object>();
for (Iterator<DataSet> i = dataSets.iterator(); i.hasNext();) {
DataSet ds = i.next();
DataSetInfo info = ds.getInfo();
if (info.getDataSetNumber() == dataSet) {
result.add(getDa... | java | public List<Object> getAll(int dataSet) throws SerializationException {
List<Object> result = new ArrayList<Object>();
for (Iterator<DataSet> i = dataSets.iterator(); i.hasNext();) {
DataSet ds = i.next();
DataSetInfo info = ds.getInfo();
if (info.getDataSetNumber() == dataSet) {
result.add(getDa... | [
"public",
"List",
"<",
"Object",
">",
"getAll",
"(",
"int",
"dataSet",
")",
"throws",
"SerializationException",
"{",
"List",
"<",
"Object",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Object",
">",
"(",
")",
";",
"for",
"(",
"Iterator",
"<",
"DataSet",... | Gets all data set values.
@param dataSet
IIM record and dataset code (See constants in {@link IIM})
@return data set value
@throws SerializationException
if value can't be deserialized from binary representation | [
"Gets",
"all",
"data",
"set",
"values",
"."
] | ec55b02fc644cd722e93051ac0bdb96b00cb42a8 | https://github.com/vnesek/nmote-iim4j/blob/ec55b02fc644cd722e93051ac0bdb96b00cb42a8/src/main/java/com/nmote/iim4j/IIMFile.java#L170-L180 | train |
vnesek/nmote-iim4j | src/main/java/com/nmote/iim4j/IIMFile.java | IIMFile.readFrom | public void readFrom(IIMReader reader, int recover) throws IOException, InvalidDataSetException {
final boolean doLog = log != null;
for (;;) {
try {
DataSet ds = reader.read();
if (ds == null) {
break;
}
if (doLog) {
log.debug("Read data set " + ds);
}
DataSetInf... | java | public void readFrom(IIMReader reader, int recover) throws IOException, InvalidDataSetException {
final boolean doLog = log != null;
for (;;) {
try {
DataSet ds = reader.read();
if (ds == null) {
break;
}
if (doLog) {
log.debug("Read data set " + ds);
}
DataSetInf... | [
"public",
"void",
"readFrom",
"(",
"IIMReader",
"reader",
",",
"int",
"recover",
")",
"throws",
"IOException",
",",
"InvalidDataSetException",
"{",
"final",
"boolean",
"doLog",
"=",
"log",
"!=",
"null",
";",
"for",
"(",
";",
";",
")",
"{",
"try",
"{",
"D... | Reads data sets from a passed reader.
@param reader
data sets source
@param recover
max number of errors reading process will try to recover from.
Set to 0 to fail immediately
@throws IOException
if reader can't read underlying stream
@throws InvalidDataSetException
if invalid/undefined data set is encountered | [
"Reads",
"data",
"sets",
"from",
"a",
"passed",
"reader",
"."
] | ec55b02fc644cd722e93051ac0bdb96b00cb42a8 | https://github.com/vnesek/nmote-iim4j/blob/ec55b02fc644cd722e93051ac0bdb96b00cb42a8/src/main/java/com/nmote/iim4j/IIMFile.java#L288-L357 | train |
vnesek/nmote-iim4j | src/main/java/com/nmote/iim4j/IIMFile.java | IIMFile.writeTo | public void writeTo(IIMWriter writer) throws IOException {
final boolean doLog = log != null;
for (Iterator<DataSet> i = dataSets.iterator(); i.hasNext();) {
DataSet ds = i.next();
writer.write(ds);
if (doLog) {
log.debug("Wrote data set " + ds);
}
}
} | java | public void writeTo(IIMWriter writer) throws IOException {
final boolean doLog = log != null;
for (Iterator<DataSet> i = dataSets.iterator(); i.hasNext();) {
DataSet ds = i.next();
writer.write(ds);
if (doLog) {
log.debug("Wrote data set " + ds);
}
}
} | [
"public",
"void",
"writeTo",
"(",
"IIMWriter",
"writer",
")",
"throws",
"IOException",
"{",
"final",
"boolean",
"doLog",
"=",
"log",
"!=",
"null",
";",
"for",
"(",
"Iterator",
"<",
"DataSet",
">",
"i",
"=",
"dataSets",
".",
"iterator",
"(",
")",
";",
"... | Writes this IIMFile to writer.
@param writer
writer to write to
@throws IOException
if file can't be written to | [
"Writes",
"this",
"IIMFile",
"to",
"writer",
"."
] | ec55b02fc644cd722e93051ac0bdb96b00cb42a8 | https://github.com/vnesek/nmote-iim4j/blob/ec55b02fc644cd722e93051ac0bdb96b00cb42a8/src/main/java/com/nmote/iim4j/IIMFile.java#L469-L478 | train |
vnesek/nmote-iim4j | src/main/java/com/nmote/iim4j/IIMFile.java | IIMFile.validate | public Set<ConstraintViolation> validate(DataSetInfo info) {
Set<ConstraintViolation> errors = new LinkedHashSet<ConstraintViolation>();
try {
if (info.isMandatory() && get(info.getDataSetNumber()) == null) {
errors.add(new ConstraintViolation(info, ConstraintViolation.MANDATORY_MISSING));
}
if (... | java | public Set<ConstraintViolation> validate(DataSetInfo info) {
Set<ConstraintViolation> errors = new LinkedHashSet<ConstraintViolation>();
try {
if (info.isMandatory() && get(info.getDataSetNumber()) == null) {
errors.add(new ConstraintViolation(info, ConstraintViolation.MANDATORY_MISSING));
}
if (... | [
"public",
"Set",
"<",
"ConstraintViolation",
">",
"validate",
"(",
"DataSetInfo",
"info",
")",
"{",
"Set",
"<",
"ConstraintViolation",
">",
"errors",
"=",
"new",
"LinkedHashSet",
"<",
"ConstraintViolation",
">",
"(",
")",
";",
"try",
"{",
"if",
"(",
"info",
... | Checks if data set is mandatory but missing or non repeatable but having
multiple values in this IIM instance.
@param info
IIM data set to check
@return list of constraint violations, empty set if data set is valid | [
"Checks",
"if",
"data",
"set",
"is",
"mandatory",
"but",
"missing",
"or",
"non",
"repeatable",
"but",
"having",
"multiple",
"values",
"in",
"this",
"IIM",
"instance",
"."
] | ec55b02fc644cd722e93051ac0bdb96b00cb42a8 | https://github.com/vnesek/nmote-iim4j/blob/ec55b02fc644cd722e93051ac0bdb96b00cb42a8/src/main/java/com/nmote/iim4j/IIMFile.java#L500-L513 | train |
vnesek/nmote-iim4j | src/main/java/com/nmote/iim4j/IIMFile.java | IIMFile.validate | public Set<ConstraintViolation> validate(int record) {
Set<ConstraintViolation> errors = new LinkedHashSet<ConstraintViolation>();
for (int ds = 0; ds < 250; ++ds) {
try {
DataSetInfo dataSetInfo = dsiFactory.create(IIM.DS(record, ds));
errors.addAll(validate(dataSetInfo));
} catch (InvalidDataS... | java | public Set<ConstraintViolation> validate(int record) {
Set<ConstraintViolation> errors = new LinkedHashSet<ConstraintViolation>();
for (int ds = 0; ds < 250; ++ds) {
try {
DataSetInfo dataSetInfo = dsiFactory.create(IIM.DS(record, ds));
errors.addAll(validate(dataSetInfo));
} catch (InvalidDataS... | [
"public",
"Set",
"<",
"ConstraintViolation",
">",
"validate",
"(",
"int",
"record",
")",
"{",
"Set",
"<",
"ConstraintViolation",
">",
"errors",
"=",
"new",
"LinkedHashSet",
"<",
"ConstraintViolation",
">",
"(",
")",
";",
"for",
"(",
"int",
"ds",
"=",
"0",
... | Checks all data sets in a given record for constraint violations.
@param record
IIM record (1,2,3, ...) to check
@return list of constraint violations, empty set if IIM file is valid | [
"Checks",
"all",
"data",
"sets",
"in",
"a",
"given",
"record",
"for",
"constraint",
"violations",
"."
] | ec55b02fc644cd722e93051ac0bdb96b00cb42a8 | https://github.com/vnesek/nmote-iim4j/blob/ec55b02fc644cd722e93051ac0bdb96b00cb42a8/src/main/java/com/nmote/iim4j/IIMFile.java#L523-L534 | train |
vnesek/nmote-iim4j | src/main/java/com/nmote/iim4j/IIMFile.java | IIMFile.validate | public Set<ConstraintViolation> validate() {
Set<ConstraintViolation> errors = new LinkedHashSet<ConstraintViolation>();
for (int record = 1; record <= 3; ++record) {
errors.addAll(validate(record));
}
return errors;
} | java | public Set<ConstraintViolation> validate() {
Set<ConstraintViolation> errors = new LinkedHashSet<ConstraintViolation>();
for (int record = 1; record <= 3; ++record) {
errors.addAll(validate(record));
}
return errors;
} | [
"public",
"Set",
"<",
"ConstraintViolation",
">",
"validate",
"(",
")",
"{",
"Set",
"<",
"ConstraintViolation",
">",
"errors",
"=",
"new",
"LinkedHashSet",
"<",
"ConstraintViolation",
">",
"(",
")",
";",
"for",
"(",
"int",
"record",
"=",
"1",
";",
"record"... | Checks all data sets in IIM records 1, 2 and 3 for constraint violations.
@return list of constraint violations, empty set if IIM file is valid | [
"Checks",
"all",
"data",
"sets",
"in",
"IIM",
"records",
"1",
"2",
"and",
"3",
"for",
"constraint",
"violations",
"."
] | ec55b02fc644cd722e93051ac0bdb96b00cb42a8 | https://github.com/vnesek/nmote-iim4j/blob/ec55b02fc644cd722e93051ac0bdb96b00cb42a8/src/main/java/com/nmote/iim4j/IIMFile.java#L541-L547 | train |
Harium/keel | src/main/java/jdt/triangulation/PointComparator.java | PointComparator.compare | public int compare(Vector3 o1, Vector3 o2) {
int ans = 0;
if (o1 != null && o2 != null) {
Vector3 d1 = o1;
Vector3 d2 = o2;
if (d1.x > d2.x)
return 1;
if (d1.x < d2.x)
return -1;
// x1 == x2
if (d1.y > d2.y)
return 1;
if (d1.y < d2.y)
return -1;
} else {
if (o1 == null &&... | java | public int compare(Vector3 o1, Vector3 o2) {
int ans = 0;
if (o1 != null && o2 != null) {
Vector3 d1 = o1;
Vector3 d2 = o2;
if (d1.x > d2.x)
return 1;
if (d1.x < d2.x)
return -1;
// x1 == x2
if (d1.y > d2.y)
return 1;
if (d1.y < d2.y)
return -1;
} else {
if (o1 == null &&... | [
"public",
"int",
"compare",
"(",
"Vector3",
"o1",
",",
"Vector3",
"o2",
")",
"{",
"int",
"ans",
"=",
"0",
";",
"if",
"(",
"o1",
"!=",
"null",
"&&",
"o2",
"!=",
"null",
")",
"{",
"Vector3",
"d1",
"=",
"o1",
";",
"Vector3",
"d2",
"=",
"o2",
";",
... | compare between two points. | [
"compare",
"between",
"two",
"points",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/jdt/triangulation/PointComparator.java#L15-L41 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/random/Random.java | Random.nextDouble | public double nextDouble(double lo, double hi) {
if (lo < 0) {
if (nextInt(2) == 0)
return -nextDouble(0, -lo);
else
return nextDouble(0, hi);
} else {
return (lo + (hi - lo) * nextDouble());
}
} | java | public double nextDouble(double lo, double hi) {
if (lo < 0) {
if (nextInt(2) == 0)
return -nextDouble(0, -lo);
else
return nextDouble(0, hi);
} else {
return (lo + (hi - lo) * nextDouble());
}
} | [
"public",
"double",
"nextDouble",
"(",
"double",
"lo",
",",
"double",
"hi",
")",
"{",
"if",
"(",
"lo",
"<",
"0",
")",
"{",
"if",
"(",
"nextInt",
"(",
"2",
")",
"==",
"0",
")",
"return",
"-",
"nextDouble",
"(",
"0",
",",
"-",
"lo",
")",
";",
"... | Generate a uniform random number in the range [lo, hi)
@param lo lower limit of range
@param hi upper limit of range
@return a uniform random real in the range [lo, hi) | [
"Generate",
"a",
"uniform",
"random",
"number",
"in",
"the",
"range",
"[",
"lo",
"hi",
")"
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/random/Random.java#L92-L101 | train |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/TagsApi.java | TagsApi.getTagCategoriesWithHttpInfo | public ApiResponse<TagsEnvelope> getTagCategoriesWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = getTagCategoriesValidateBeforeCall(null, null);
Type localVarReturnType = new TypeToken<TagsEnvelope>(){}.getType();
return apiClient.execute(call, localVarReturnType);
} | java | public ApiResponse<TagsEnvelope> getTagCategoriesWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = getTagCategoriesValidateBeforeCall(null, null);
Type localVarReturnType = new TypeToken<TagsEnvelope>(){}.getType();
return apiClient.execute(call, localVarReturnType);
} | [
"public",
"ApiResponse",
"<",
"TagsEnvelope",
">",
"getTagCategoriesWithHttpInfo",
"(",
")",
"throws",
"ApiException",
"{",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"call",
"=",
"getTagCategoriesValidateBeforeCall",
"(",
"null",
",",
"null",
")",
";",
... | Get all categories
Get all tags marked as categories
@return ApiResponse<TagsEnvelope>
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Get",
"all",
"categories",
"Get",
"all",
"tags",
"marked",
"as",
"categories"
] | 412f447573e7796ab4f685c0bdd5eb76185a365c | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/TagsApi.java#L128-L132 | train |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/RulesApi.java | RulesApi.getRule | public RuleEnvelope getRule(String ruleId) throws ApiException {
ApiResponse<RuleEnvelope> resp = getRuleWithHttpInfo(ruleId);
return resp.getData();
} | java | public RuleEnvelope getRule(String ruleId) throws ApiException {
ApiResponse<RuleEnvelope> resp = getRuleWithHttpInfo(ruleId);
return resp.getData();
} | [
"public",
"RuleEnvelope",
"getRule",
"(",
"String",
"ruleId",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"RuleEnvelope",
">",
"resp",
"=",
"getRuleWithHttpInfo",
"(",
"ruleId",
")",
";",
"return",
"resp",
".",
"getData",
"(",
")",
";",
"}"
] | Get Rule
Get a rule using the Rule ID
@param ruleId Rule ID. (required)
@return RuleEnvelope
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Get",
"Rule",
"Get",
"a",
"rule",
"using",
"the",
"Rule",
"ID"
] | 412f447573e7796ab4f685c0bdd5eb76185a365c | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/RulesApi.java#L373-L376 | train |
Harium/keel | src/main/java/com/harium/keel/filter/search/flood/FloodFillSearch.java | FloodFillSearch.addNeighbor | protected void addNeighbor(Queue<ColorPoint> queue, int px, int py, int color, Feature component) {
if (!inBoundary(px, py, component)) {
return;
}
if (!mask.isTouched(px, py)) {
queue.add(new ColorPoint(px, py, color));
}
} | java | protected void addNeighbor(Queue<ColorPoint> queue, int px, int py, int color, Feature component) {
if (!inBoundary(px, py, component)) {
return;
}
if (!mask.isTouched(px, py)) {
queue.add(new ColorPoint(px, py, color));
}
} | [
"protected",
"void",
"addNeighbor",
"(",
"Queue",
"<",
"ColorPoint",
">",
"queue",
",",
"int",
"px",
",",
"int",
"py",
",",
"int",
"color",
",",
"Feature",
"component",
")",
"{",
"if",
"(",
"!",
"inBoundary",
"(",
"px",
",",
"py",
",",
"component",
"... | May have to be changed to let multiple touch | [
"May",
"have",
"to",
"be",
"changed",
"to",
"let",
"multiple",
"touch"
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/filter/search/flood/FloodFillSearch.java#L137-L145 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Gaussian.java | Gaussian.Function1D | public double Function1D(double x) {
return Math.exp(x * x / (-2 * sqrSigma)) / (Math.sqrt(2 * Math.PI) * sigma);
} | java | public double Function1D(double x) {
return Math.exp(x * x / (-2 * sqrSigma)) / (Math.sqrt(2 * Math.PI) * sigma);
} | [
"public",
"double",
"Function1D",
"(",
"double",
"x",
")",
"{",
"return",
"Math",
".",
"exp",
"(",
"x",
"*",
"x",
"/",
"(",
"-",
"2",
"*",
"sqrSigma",
")",
")",
"/",
"(",
"Math",
".",
"sqrt",
"(",
"2",
"*",
"Math",
".",
"PI",
")",
"*",
"sigma... | 1-D Gaussian function.
@param x value.
@return Function's value at point x. | [
"1",
"-",
"D",
"Gaussian",
"function",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Gaussian.java#L80-L82 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Gaussian.java | Gaussian.Function2D | public double Function2D(double x, double y) {
return Math.exp(-(x * x + y * y) / (2 * sqrSigma)) / (2 * Math.PI * sqrSigma);
} | java | public double Function2D(double x, double y) {
return Math.exp(-(x * x + y * y) / (2 * sqrSigma)) / (2 * Math.PI * sqrSigma);
} | [
"public",
"double",
"Function2D",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"return",
"Math",
".",
"exp",
"(",
"-",
"(",
"x",
"*",
"x",
"+",
"y",
"*",
"y",
")",
"/",
"(",
"2",
"*",
"sqrSigma",
")",
")",
"/",
"(",
"2",
"*",
"Math",
"... | 2-D Gaussian function.
@param x value.
@param y value.
@return Function's value at point (x,y). | [
"2",
"-",
"D",
"Gaussian",
"function",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Gaussian.java#L91-L93 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Gaussian.java | Gaussian.Kernel1D | public double[] Kernel1D(int size) {
if (((size % 2) == 0) || (size < 3) || (size > 101)) {
try {
throw new Exception("Wrong size");
} catch (Exception e) {
e.printStackTrace();
}
}
int r = size / 2;
// kernel
do... | java | public double[] Kernel1D(int size) {
if (((size % 2) == 0) || (size < 3) || (size > 101)) {
try {
throw new Exception("Wrong size");
} catch (Exception e) {
e.printStackTrace();
}
}
int r = size / 2;
// kernel
do... | [
"public",
"double",
"[",
"]",
"Kernel1D",
"(",
"int",
"size",
")",
"{",
"if",
"(",
"(",
"(",
"size",
"%",
"2",
")",
"==",
"0",
")",
"||",
"(",
"size",
"<",
"3",
")",
"||",
"(",
"size",
">",
"101",
")",
")",
"{",
"try",
"{",
"throw",
"new",
... | 1-D Gaussian kernel.
@param size Kernel size (should be odd), [3, 101].
@return Returns 1-D Gaussian kernel of the specified size. | [
"1",
"-",
"D",
"Gaussian",
"kernel",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Gaussian.java#L101-L119 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Gaussian.java | Gaussian.Kernel2D | public double[][] Kernel2D(int size) {
if (((size % 2) == 0) || (size < 3) || (size > 101)) {
try {
throw new Exception("Wrong size");
} catch (Exception e) {
e.printStackTrace();
}
}
int r = size / 2;
double[][] kernel... | java | public double[][] Kernel2D(int size) {
if (((size % 2) == 0) || (size < 3) || (size > 101)) {
try {
throw new Exception("Wrong size");
} catch (Exception e) {
e.printStackTrace();
}
}
int r = size / 2;
double[][] kernel... | [
"public",
"double",
"[",
"]",
"[",
"]",
"Kernel2D",
"(",
"int",
"size",
")",
"{",
"if",
"(",
"(",
"(",
"size",
"%",
"2",
")",
"==",
"0",
")",
"||",
"(",
"size",
"<",
"3",
")",
"||",
"(",
"size",
">",
"101",
")",
")",
"{",
"try",
"{",
"thr... | 2-D Gaussian kernel.
@param size Kernel size (should be odd), [3, 101].
@return Returns 2-D Gaussian kernel of specified size. | [
"2",
"-",
"D",
"Gaussian",
"kernel",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Gaussian.java#L127-L155 | train |
Harium/keel | src/main/java/com/harium/keel/effect/ExtractBoundary.java | ExtractBoundary.process | public ArrayList<IntPoint> process(ImageSource fastBitmap) {
//FastBitmap l = new FastBitmap(fastBitmap);
if (points == null) {
apply(fastBitmap);
}
int width = fastBitmap.getWidth();
int height = fastBitmap.getHeight();
points = new ArrayList<IntPoin... | java | public ArrayList<IntPoint> process(ImageSource fastBitmap) {
//FastBitmap l = new FastBitmap(fastBitmap);
if (points == null) {
apply(fastBitmap);
}
int width = fastBitmap.getWidth();
int height = fastBitmap.getHeight();
points = new ArrayList<IntPoin... | [
"public",
"ArrayList",
"<",
"IntPoint",
">",
"process",
"(",
"ImageSource",
"fastBitmap",
")",
"{",
"//FastBitmap l = new FastBitmap(fastBitmap);\r",
"if",
"(",
"points",
"==",
"null",
")",
"{",
"apply",
"(",
"fastBitmap",
")",
";",
"}",
"int",
"width",
"=",
"... | Get points after extract boundary.
@param fastBitmap Image to be processed.
@return List of points. | [
"Get",
"points",
"after",
"extract",
"boundary",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/ExtractBoundary.java#L94-L120 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/transform/DiscreteHartleyTransform.java | DiscreteHartleyTransform.Forward | public static void Forward(double[] data) {
double[] result = new double[data.length];
for (int k = 0; k < result.length; k++) {
double sum = 0;
for (int n = 0; n < data.length; n++) {
double theta = ((2.0 * Math.PI) / data.length) * k * n;
sum +=... | java | public static void Forward(double[] data) {
double[] result = new double[data.length];
for (int k = 0; k < result.length; k++) {
double sum = 0;
for (int n = 0; n < data.length; n++) {
double theta = ((2.0 * Math.PI) / data.length) * k * n;
sum +=... | [
"public",
"static",
"void",
"Forward",
"(",
"double",
"[",
"]",
"data",
")",
"{",
"double",
"[",
"]",
"result",
"=",
"new",
"double",
"[",
"data",
".",
"length",
"]",
";",
"for",
"(",
"int",
"k",
"=",
"0",
";",
"k",
"<",
"result",
".",
"length",
... | 1-D Forward Discrete Hartley Transform.
@param data Data. | [
"1",
"-",
"D",
"Forward",
"Discrete",
"Hartley",
"Transform",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/transform/DiscreteHartleyTransform.java#L46-L62 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/math/transform/DiscreteHartleyTransform.java | DiscreteHartleyTransform.Forward | public static void Forward(double[][] data) {
double[][] result = new double[data.length][data[0].length];
for (int m = 0; m < data.length; m++) {
for (int n = 0; n < data[0].length; n++) {
double sum = 0;
for (int i = 0; i < result.length; i++) {
... | java | public static void Forward(double[][] data) {
double[][] result = new double[data.length][data[0].length];
for (int m = 0; m < data.length; m++) {
for (int n = 0; n < data[0].length; n++) {
double sum = 0;
for (int i = 0; i < result.length; i++) {
... | [
"public",
"static",
"void",
"Forward",
"(",
"double",
"[",
"]",
"[",
"]",
"data",
")",
"{",
"double",
"[",
"]",
"[",
"]",
"result",
"=",
"new",
"double",
"[",
"data",
".",
"length",
"]",
"[",
"data",
"[",
"0",
"]",
".",
"length",
"]",
";",
"for... | 2-D Forward Discrete Hartley Transform.
@param data Data. | [
"2",
"-",
"D",
"Forward",
"Discrete",
"Hartley",
"Transform",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/transform/DiscreteHartleyTransform.java#L78-L98 | train |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/UsersApi.java | UsersApi.createUserProperties | public PropertiesEnvelope createUserProperties(String userId, AppProperties properties, String aid) throws ApiException {
ApiResponse<PropertiesEnvelope> resp = createUserPropertiesWithHttpInfo(userId, properties, aid);
return resp.getData();
} | java | public PropertiesEnvelope createUserProperties(String userId, AppProperties properties, String aid) throws ApiException {
ApiResponse<PropertiesEnvelope> resp = createUserPropertiesWithHttpInfo(userId, properties, aid);
return resp.getData();
} | [
"public",
"PropertiesEnvelope",
"createUserProperties",
"(",
"String",
"userId",
",",
"AppProperties",
"properties",
",",
"String",
"aid",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"PropertiesEnvelope",
">",
"resp",
"=",
"createUserPropertiesWithHttpInfo",
... | Create User Application Properties
Create application properties for a user
@param userId User Id (required)
@param properties Properties to be updated (required)
@param aid Application ID (optional)
@return PropertiesEnvelope
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the res... | [
"Create",
"User",
"Application",
"Properties",
"Create",
"application",
"properties",
"for",
"a",
"user"
] | 412f447573e7796ab4f685c0bdd5eb76185a365c | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/UsersApi.java#L139-L142 | train |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/UsersApi.java | UsersApi.getUserProperties | public PropertiesEnvelope getUserProperties(String userId, String aid) throws ApiException {
ApiResponse<PropertiesEnvelope> resp = getUserPropertiesWithHttpInfo(userId, aid);
return resp.getData();
} | java | public PropertiesEnvelope getUserProperties(String userId, String aid) throws ApiException {
ApiResponse<PropertiesEnvelope> resp = getUserPropertiesWithHttpInfo(userId, aid);
return resp.getData();
} | [
"public",
"PropertiesEnvelope",
"getUserProperties",
"(",
"String",
"userId",
",",
"String",
"aid",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"PropertiesEnvelope",
">",
"resp",
"=",
"getUserPropertiesWithHttpInfo",
"(",
"userId",
",",
"aid",
")",
";",
... | Get User application properties
Get application properties of a user
@param userId User Id (required)
@param aid Application ID (optional)
@return PropertiesEnvelope
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Get",
"User",
"application",
"properties",
"Get",
"application",
"properties",
"of",
"a",
"user"
] | 412f447573e7796ab4f685c0bdd5eb76185a365c | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/UsersApi.java#L782-L785 | train |
skuzzle/jeve | jeve/src/main/java/de/skuzzle/jeve/stores/AbstractListenerStore.java | AbstractListenerStore.copyList | protected <T extends Listener> Collection<T> copyList(Class<T> listenerClass,
Stream<Object> listeners, int sizeHint) {
if (sizeHint == 0) {
return Collections.emptyList();
}
return listeners
.map(listenerClass::cast)
.collect(Collectors.to... | java | protected <T extends Listener> Collection<T> copyList(Class<T> listenerClass,
Stream<Object> listeners, int sizeHint) {
if (sizeHint == 0) {
return Collections.emptyList();
}
return listeners
.map(listenerClass::cast)
.collect(Collectors.to... | [
"protected",
"<",
"T",
"extends",
"Listener",
">",
"Collection",
"<",
"T",
">",
"copyList",
"(",
"Class",
"<",
"T",
">",
"listenerClass",
",",
"Stream",
"<",
"Object",
">",
"listeners",
",",
"int",
"sizeHint",
")",
"{",
"if",
"(",
"sizeHint",
"==",
"0"... | Creates a collection from the given stream, casting each object to the
provided listener class. The returned collection must not necessarily be
mutable.
@param <T> Type of the listeners in the given list.
@param listenerClass The class of the objects in the provided list.
@param listeners The stream to obtain the list... | [
"Creates",
"a",
"collection",
"from",
"the",
"given",
"stream",
"casting",
"each",
"object",
"to",
"the",
"provided",
"listener",
"class",
".",
"The",
"returned",
"collection",
"must",
"not",
"necessarily",
"be",
"mutable",
"."
] | 42cc18947c9c8596c34410336e4e375e9fcd7c47 | https://github.com/skuzzle/jeve/blob/42cc18947c9c8596c34410336e4e375e9fcd7c47/jeve/src/main/java/de/skuzzle/jeve/stores/AbstractListenerStore.java#L66-L74 | train |
Harium/keel | src/main/java/com/harium/keel/cluster/DBScan.java | DBScan.cluster | public List<Cluster> cluster(final Collection<Point2D> points) {
final List<Cluster> clusters = new ArrayList<Cluster>();
final Map<Point2D, PointStatus> visited = new HashMap<Point2D, DBScan.PointStatus>();
KDTree<Point2D> tree = new KDTree<Point2D>(2);
// Populate the kdTree
... | java | public List<Cluster> cluster(final Collection<Point2D> points) {
final List<Cluster> clusters = new ArrayList<Cluster>();
final Map<Point2D, PointStatus> visited = new HashMap<Point2D, DBScan.PointStatus>();
KDTree<Point2D> tree = new KDTree<Point2D>(2);
// Populate the kdTree
... | [
"public",
"List",
"<",
"Cluster",
">",
"cluster",
"(",
"final",
"Collection",
"<",
"Point2D",
">",
"points",
")",
"{",
"final",
"List",
"<",
"Cluster",
">",
"clusters",
"=",
"new",
"ArrayList",
"<",
"Cluster",
">",
"(",
")",
";",
"final",
"Map",
"<",
... | Performs DBSCAN cluster analysis.
@param points the points to cluster
@return the list of clusters
@throws NullArgumentException if the data points are null | [
"Performs",
"DBSCAN",
"cluster",
"analysis",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/cluster/DBScan.java#L71-L102 | train |
Harium/keel | src/main/java/com/harium/keel/cluster/DBScan.java | DBScan.expandCluster | private Cluster expandCluster(final Cluster cluster,
final Point2D point,
final List<Point2D> neighbors,
final KDTree<Point2D> points,
final Map<Point2D, PointStatus> visit... | java | private Cluster expandCluster(final Cluster cluster,
final Point2D point,
final List<Point2D> neighbors,
final KDTree<Point2D> points,
final Map<Point2D, PointStatus> visit... | [
"private",
"Cluster",
"expandCluster",
"(",
"final",
"Cluster",
"cluster",
",",
"final",
"Point2D",
"point",
",",
"final",
"List",
"<",
"Point2D",
">",
"neighbors",
",",
"final",
"KDTree",
"<",
"Point2D",
">",
"points",
",",
"final",
"Map",
"<",
"Point2D",
... | Expands the cluster to include density-reachable items.
@param cluster Cluster to expand
@param point Point to add to cluster
@param neighbors List of neighbors
@param points the data set
@param visited the set of already visited points
@return the expanded cluster | [
"Expands",
"the",
"cluster",
"to",
"include",
"density",
"-",
"reachable",
"items",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/cluster/DBScan.java#L114-L143 | train |
Harium/keel | src/main/java/com/harium/keel/cluster/DBScan.java | DBScan.merge | private List<Point2D> merge(final List<Point2D> one, final List<Point2D> two) {
final Set<Point2D> oneSet = new HashSet<Point2D>(one);
for (Point2D item : two) {
if (!oneSet.contains(item)) {
one.add(item);
}
}
return one;
} | java | private List<Point2D> merge(final List<Point2D> one, final List<Point2D> two) {
final Set<Point2D> oneSet = new HashSet<Point2D>(one);
for (Point2D item : two) {
if (!oneSet.contains(item)) {
one.add(item);
}
}
return one;
} | [
"private",
"List",
"<",
"Point2D",
">",
"merge",
"(",
"final",
"List",
"<",
"Point2D",
">",
"one",
",",
"final",
"List",
"<",
"Point2D",
">",
"two",
")",
"{",
"final",
"Set",
"<",
"Point2D",
">",
"oneSet",
"=",
"new",
"HashSet",
"<",
"Point2D",
">",
... | Merges two lists together.
@param one first list
@param two second list
@return merged lists | [
"Merges",
"two",
"lists",
"together",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/cluster/DBScan.java#L168-L176 | train |
Harium/keel | src/main/java/com/harium/keel/effect/neuroph/LetterSeparation.java | LetterSeparation.apply | public ImageSource apply(ImageSource input) {
ImageSource originalImage = input;
int width = originalImage.getWidth();
int height = originalImage.getHeight();
boolean[][] matrix = new boolean[width][height]; // black n white boolean matrix; true = blck, false = white
// Copy
... | java | public ImageSource apply(ImageSource input) {
ImageSource originalImage = input;
int width = originalImage.getWidth();
int height = originalImage.getHeight();
boolean[][] matrix = new boolean[width][height]; // black n white boolean matrix; true = blck, false = white
// Copy
... | [
"public",
"ImageSource",
"apply",
"(",
"ImageSource",
"input",
")",
"{",
"ImageSource",
"originalImage",
"=",
"input",
";",
"int",
"width",
"=",
"originalImage",
".",
"getWidth",
"(",
")",
";",
"int",
"height",
"=",
"originalImage",
".",
"getHeight",
"(",
")... | radi otsu da dobije spojena crna slova i ra
@param input
@return the processed image | [
"radi",
"otsu",
"da",
"dobije",
"spojena",
"crna",
"slova",
"i",
"ra"
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/neuroph/LetterSeparation.java#L25-L81 | train |
Harium/keel | src/main/java/com/harium/keel/catalano/core/ArraysUtil.java | ArraysUtil.Argsort | public static int[] Argsort(final float[] array, final boolean ascending) {
Integer[] indexes = new Integer[array.length];
for (int i = 0; i < indexes.length; i++) {
indexes[i] = i;
}
Arrays.sort(indexes, new Comparator<Integer>() {
@Override
public in... | java | public static int[] Argsort(final float[] array, final boolean ascending) {
Integer[] indexes = new Integer[array.length];
for (int i = 0; i < indexes.length; i++) {
indexes[i] = i;
}
Arrays.sort(indexes, new Comparator<Integer>() {
@Override
public in... | [
"public",
"static",
"int",
"[",
"]",
"Argsort",
"(",
"final",
"float",
"[",
"]",
"array",
",",
"final",
"boolean",
"ascending",
")",
"{",
"Integer",
"[",
"]",
"indexes",
"=",
"new",
"Integer",
"[",
"array",
".",
"length",
"]",
";",
"for",
"(",
"int",... | Returns the indices that would sort an array.
@param array Array.
@param ascending Ascending order.
@return Array of indices. | [
"Returns",
"the",
"indices",
"that",
"would",
"sort",
"an",
"array",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/core/ArraysUtil.java#L105-L117 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.