id
int64
1
889
project_id
stringclasses
17 values
bug_id
stringclasses
163 values
class
dict
method
dict
tests
listlengths
1
84
701
Lang
46
{ "fields": [ { "modifier": "", "original_string": "private static final char CSV_DELIMITER = ',';", "type": "char", "var_name": "CSV_DELIMITER" }, { "modifier": "", "original_string": "private static final char CSV_QUOTE = '\"';", "type": "char", "var_name"...
{ "body": "private static String escapeJavaStyleString(String str, boolean escapeSingleQuotes, boolean escapeForwardSlash) {\n if (str == null) {\n return null;\n }\n try {\n StringWriter writer = new StringWriter(str.length() * 2);\n escapeJavaStyleString(writer,...
[ { "covered_lines": 4, "line_coverage": 0.5, "name": "org.apache.commons.lang.StringEscapeUtilsTest::testEscapeJavaWithSlash", "total_lines": 8 } ]
702
Lang
46
{ "fields": [ { "modifier": "", "original_string": "private static final char CSV_DELIMITER = ',';", "type": "char", "var_name": "CSV_DELIMITER" }, { "modifier": "", "original_string": "private static final char CSV_QUOTE = '\"';", "type": "char", "var_name"...
{ "body": "private static void escapeJavaStyleString(Writer out, String str, boolean escapeSingleQuote,\n boolean escapeForwardSlash) throws IOException {\n if (out == null) {\n throw new IllegalArgumentException(\"The Writer must not be null\");\n }\n if (str == null) {\n ...
[ { "covered_lines": 4, "line_coverage": 0.5, "name": "org.apache.commons.lang.StringEscapeUtilsTest::testEscapeJavaWithSlash", "total_lines": 8 } ]
703
Lang
47
{ "fields": [ { "modifier": "", "original_string": "static final int CAPACITY = 32;", "type": "int", "var_name": "CAPACITY" }, { "modifier": "", "original_string": "private static final long serialVersionUID = 7628716375283629643L;", "type": "long", "var_nam...
{ "body": "public StrBuilder appendFixedWidthPadLeft(Object obj, int width, char padChar) {\n if (width > 0) {\n ensureCapacity(size + width);\n String str = (obj == null ? getNullText() : obj.toString());\n if (str == null) {\n str = \"\";\n }\n ...
[ { "covered_lines": 4, "line_coverage": 0.3333, "name": "org.apache.commons.lang.text.StrBuilderTest::testLang412Left", "total_lines": 12 }, { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.lang.text.StrBuilderTest::testLang412Right", "total_lines": 12 } ]
704
Lang
47
{ "fields": [ { "modifier": "", "original_string": "static final int CAPACITY = 32;", "type": "int", "var_name": "CAPACITY" }, { "modifier": "", "original_string": "private static final long serialVersionUID = 7628716375283629643L;", "type": "long", "var_nam...
{ "body": "public StrBuilder appendFixedWidthPadRight(Object obj, int width, char padChar) {\n if (width > 0) {\n ensureCapacity(size + width);\n String str = (obj == null ? getNullText() : obj.toString());\n if (str == null) {\n str = \"\";\n }\n ...
[ { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.lang.text.StrBuilderTest::testLang412Left", "total_lines": 12 }, { "covered_lines": 4, "line_coverage": 0.3333, "name": "org.apache.commons.lang.text.StrBuilderTest::testLang412Right", "total_lines": 12 } ]
705
Lang
49
{ "fields": [ { "modifier": "", "original_string": "private static final long serialVersionUID = 65382027393090L;", "type": "long", "var_name": "serialVersionUID" }, { "modifier": "", "original_string": "public static final Fraction ZERO = new Fraction(0, 1);", "t...
{ "body": "public Fraction reduce() {\n if (numerator == 0) {\n return equals(ZERO) ? this : ZERO;\n }\n int gcd = greatestCommonDivisor(Math.abs(numerator), denominator);\n if (gcd == 1) {\n return this;\n }\n return Fraction.getFraction(numerator / gcd...
[ { "covered_lines": 4, "line_coverage": 1, "name": "org.apache.commons.lang.math.FractionTest::testReduce", "total_lines": 4 } ]
706
Lang
50
{ "fields": [ { "modifier": "", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "modifier": "", "original_string": "public static final int FULL = DateFormat.FULL;", "type": "int", "v...
{ "body": "public static synchronized FastDateFormat getDateInstance(int style, TimeZone timeZone, Locale locale) {\n Object key = new Integer(style);\n if (timeZone != null) {\n key = new Pair(key, timeZone);\n }\n\n if (locale == null) {\n locale = Locale.getDefault...
[ { "covered_lines": 14, "line_coverage": 0.8235, "name": "org.apache.commons.lang.time.FastDateFormatTest::test_changeDefault_Locale_DateInstance", "total_lines": 17 }, { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.lang.time.FastDateFormatTest::test_changeDefau...
707
Lang
50
{ "fields": [ { "modifier": "", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "modifier": "", "original_string": "public static final int FULL = DateFormat.FULL;", "type": "int", "v...
{ "body": "public static synchronized FastDateFormat getDateTimeInstance(int dateStyle, int timeStyle, TimeZone timeZone,\n Locale locale) {\n\n Object key = new Pair(new Integer(dateStyle), new Integer(timeStyle));\n if (timeZone != null) {\n key = new Pair(key, timeZone);\n ...
[ { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.lang.time.FastDateFormatTest::test_changeDefault_Locale_DateInstance", "total_lines": 17 }, { "covered_lines": 14, "line_coverage": 0.8235, "name": "org.apache.commons.lang.time.FastDateFormatTest::test_changeDefau...
708
Lang
52
{ "fields": [], "file": "src/java/org/apache/commons/lang/StringEscapeUtils.java", "identifier": "StringEscapeUtils", "interfaces": "", "superclass": "" }
{ "body": "private static void escapeJavaStyleString(Writer out, String str, boolean escapeSingleQuote) throws IOException {\n if (out == null) {\n throw new IllegalArgumentException(\"The Writer must not be null\");\n }\n if (str == null) {\n return;\n }\n int...
[ { "covered_lines": 5, "line_coverage": 0.625, "name": "org.apache.commons.lang.StringEscapeUtilsTest::testEscapeJavaScript", "total_lines": 8 } ]
709
Lang
53
{ "fields": [ { "modifier": "", "original_string": "public static final TimeZone UTC_TIME_ZONE = TimeZone.getTimeZone(\"GMT\");", "type": "TimeZone", "var_name": "UTC_TIME_ZONE" }, { "modifier": "", "original_string": "public static final long MILLIS_PER_SECOND = 1000;"...
{ "body": "private static void modify(Calendar val, int field, boolean round) {\n if (val.get(Calendar.YEAR) > 280000000) {\n throw new ArithmeticException(\"Calendar value too large for accurate calculations\");\n }\n \n if (field == Calendar.MILLISECOND) {\n return;...
[ { "covered_lines": 33, "line_coverage": 0.569, "name": "org.apache.commons.lang.time.DateUtilsTest::testRoundLang346", "total_lines": 58 } ]
710
Lang
54
{ "fields": [ { "modifier": "", "original_string": "private static final List cAvailableLocaleList;", "type": "List", "var_name": "cAvailableLocaleList" }, { "modifier": "", "original_string": "private static Set cAvailableLocaleSet;", "type": "Set", "var_na...
{ "body": "public static Locale toLocale(String str) {\n if (str == null) {\n return null;\n }\n int len = str.length();\n if (len != 2 && len != 5 && len < 7) {\n throw new IllegalArgumentException(\"Invalid locale format: \" + str);\n }\n char ch0 = st...
[ { "covered_lines": 12, "line_coverage": 0.5455, "name": "org.apache.commons.lang.LocaleUtilsTest::testLang328", "total_lines": 22 } ]
711
Lang
55
{ "fields": [ { "modifier": "", "original_string": "private static final int STATE_UNSTARTED = 0;", "type": "int", "var_name": "STATE_UNSTARTED" }, { "modifier": "", "original_string": "private static final int STATE_RUNNING = 1;", "type": "int", "var_name...
{ "body": "public void stop() {\n if(this.runningState != STATE_RUNNING && this.runningState != STATE_SUSPENDED) {\n throw new IllegalStateException(\"Stopwatch is not running. \");\n }\n if(this.runningState == STATE_RUNNING) {\n stopTime = System.currentTimeMillis();\n ...
[ { "covered_lines": 4, "line_coverage": 0.8, "name": "org.apache.commons.lang.time.StopWatchTest::testLang315", "total_lines": 5 } ]
712
Lang
57
{ "fields": [ { "modifier": "", "original_string": "private static final List cAvailableLocaleList;", "type": "List", "var_name": "cAvailableLocaleList" }, { "modifier": "", "original_string": "private static Set cAvailableLocaleSet;", "type": "Set", "var_na...
{ "body": "public static boolean isAvailableLocale(Locale locale) {\n return availableLocaleList().contains(locale);\n }", "class_method_signature": "LocaleUtils.isAvailableLocale(Locale locale)", "constructor": false, "full_signature": "public static boolean isAvailableLocale(Locale locale)", "iden...
[ { "covered_lines": 1, "line_coverage": 1, "name": "org.apache.commons.lang.LocaleUtilsTest::testAvailableLocaleSet", "total_lines": 1 }, { "covered_lines": 1, "line_coverage": 1, "name": "org.apache.commons.lang.LocaleUtilsTest::testIsAvailableLocale", "total_lines": 1 }, { ...
713
Lang
58
{ "fields": [ { "modifier": "", "original_string": "public static final Long LONG_ZERO = new Long(0L);", "type": "Long", "var_name": "LONG_ZERO" }, { "modifier": "", "original_string": "public static final Long LONG_ONE = new Long(1L);", "type": "Long", "var...
{ "body": "public static Number createNumber(String str) throws NumberFormatException {\n if (str == null) {\n return null;\n }\n if (StringUtils.isBlank(str)) {\n throw new NumberFormatException(\"A blank string is not a valid number\");\n } \n if (str.starts...
[ { "covered_lines": 22, "line_coverage": 0.3143, "name": "org.apache.commons.lang.math.NumberUtilsTest::testLang300", "total_lines": 70 } ]
714
Lang
59
{ "fields": [ { "modifier": "", "original_string": "static final int CAPACITY = 32;", "type": "int", "var_name": "CAPACITY" }, { "modifier": "", "original_string": "private static final long serialVersionUID = 7628716375283629643L;", "type": "long", "var_nam...
{ "body": "public StrBuilder appendFixedWidthPadRight(Object obj, int width, char padChar) {\n if (width > 0) {\n ensureCapacity(size + width);\n String str = (obj == null ? getNullText() : obj.toString());\n int strLen = str.length();\n if (strLen >= width) {\n ...
[ { "covered_lines": 6, "line_coverage": 0.5, "name": "org.apache.commons.lang.text.StrBuilderAppendInsertTest::testLang299", "total_lines": 12 } ]
715
Lang
62
{ "fields": [ { "modifier": "", "original_string": "private static final String[][] BASIC_ARRAY = {\n {\"quot\", \"34\"}, // \" - double-quote\n {\"amp\", \"38\"}, // & - ampersand\n {\"lt\", \"60\"}, // < - less-than\n {\"gt\", \"62\"}, // > - greater-than\n };", ...
{ "body": "public String unescape(String str) {\n int firstAmp = str.indexOf('&');\n if (firstAmp < 0) {\n return str;\n }\n\n StringBuffer buf = new StringBuffer(str.length());\n buf.append(str.substring(0, firstAmp));\n for (int i = firstAmp; i < str.length(); ++...
[ { "covered_lines": 25, "line_coverage": 0.625, "name": "org.apache.commons.lang.EntitiesTest::testNumberOverflow", "total_lines": 40 } ]
716
Lang
62
{ "fields": [ { "modifier": "", "original_string": "private static final String[][] BASIC_ARRAY = {\n {\"quot\", \"34\"}, // \" - double-quote\n {\"amp\", \"38\"}, // & - ampersand\n {\"lt\", \"60\"}, // < - less-than\n {\"gt\", \"62\"}, // > - greater-than\n };", ...
{ "body": "public void unescape(Writer writer, String string) throws IOException {\n int firstAmp = string.indexOf('&');\n if (firstAmp < 0) {\n writer.write(string);\n return;\n }\n\n writer.write(string, 0, firstAmp);\n int len = string.length();\n for...
[ { "covered_lines": 25, "line_coverage": 0.625, "name": "org.apache.commons.lang.EntitiesTest::testNumberOverflow", "total_lines": 40 } ]
717
Lang
63
{ "fields": [ { "modifier": "", "original_string": "public static final String ISO_EXTENDED_FORMAT_PATTERN = \"'P'yyyy'Y'M'M'd'DT'H'H'm'M's.S'S'\";", "type": "String", "var_name": "ISO_EXTENDED_FORMAT_PATTERN" }, { "modifier": "", "original_string": "static final Object...
{ "body": "static String format(Token[] tokens, int years, int months, int days, int hours, int minutes, int seconds,\n int milliseconds, boolean padWithZeros) {\n StringBuffer buffer = new StringBuffer();\n boolean lastOutputSeconds = false;\n int sz = tokens.length;\n for (int...
[ { "covered_lines": 13, "line_coverage": 0.2826, "name": "org.apache.commons.lang.time.DurationFormatUtilsTest::testJiraLang281", "total_lines": 46 } ]
718
Lang
63
{ "fields": [ { "modifier": "", "original_string": "public static final String ISO_EXTENDED_FORMAT_PATTERN = \"'P'yyyy'Y'M'M'd'DT'H'H'm'M's.S'S'\";", "type": "String", "var_name": "ISO_EXTENDED_FORMAT_PATTERN" }, { "modifier": "", "original_string": "static final Object...
{ "body": "public static String formatPeriod(long startMillis, long endMillis, String format, boolean padWithZeros, \n TimeZone timezone) {\n\n long millis = endMillis - startMillis;\n if (millis < 28 * DateUtils.MILLIS_PER_DAY) {\n return formatDuration(millis, format, padWithZero...
[ { "covered_lines": 49, "line_coverage": 0.7903, "name": "org.apache.commons.lang.time.DurationFormatUtilsTest::testJiraLang281", "total_lines": 62 } ]
719
Lang
64
{ "fields": [ { "modifier": "", "original_string": "private static final long serialVersionUID = -7129650521543789085L;", "type": "long", "var_name": "serialVersionUID" }, { "modifier": "", "original_string": "private final int iValue;", "type": "int", "var_...
{ "body": "public int compareTo(Object other) {\n if (other == this) {\n return 0;\n }\n if (other.getClass() != this.getClass()) {\n if (other.getClass().getName().equals(this.getClass().getName())) {\n return iValue - getValueInOtherClassLoader(other);\n ...
[ { "covered_lines": 1, "line_coverage": 1, "name": "org.apache.commons.lang.enums.ValuedEnumTest::testCompareTo_otherEnumType", "total_lines": 1 } ]
720
Lang
65
{ "fields": [ { "modifier": "", "original_string": "public static final TimeZone UTC_TIME_ZONE = TimeZone.getTimeZone(\"GMT\");", "type": "TimeZone", "var_name": "UTC_TIME_ZONE" }, { "modifier": "", "original_string": "public static final long MILLIS_PER_SECOND = 1000;"...
{ "body": "private static void modify(Calendar val, int field, boolean round) {\n if (val.get(Calendar.YEAR) > 280000000) {\n throw new ArithmeticException(\"Calendar value too large for accurate calculations\");\n }\n \n if (field == Calendar.MILLISECOND) {\n return;...
[ { "covered_lines": 16, "line_coverage": 0.4444, "name": "org.apache.commons.lang.time.DateUtilsTest::testTruncateLang59", "total_lines": 36 } ]
721
Math
2
{ "fields": [ { "modifier": "", "original_string": "private static final long serialVersionUID = -436928820673516179L;", "type": "long", "var_name": "serialVersionUID" }, { "modifier": "", "original_string": "private final int numberOfSuccesses;", "type": "int", ...
{ "body": "public double getNumericalMean() {\n return getSampleSize() * (getNumberOfSuccesses() / (double) getPopulationSize());\n }", "class_method_signature": "HypergeometricDistribution.getNumericalMean()", "constructor": false, "full_signature": "public double getNumericalMean()", "identifier":...
[ { "covered_lines": 1, "line_coverage": 1, "name": "org.apache.commons.math3.distribution.HypergeometricDistributionTest::testMath1021", "total_lines": 1 } ]
722
Math
3
{ "fields": [ { "modifier": "", "original_string": "private static final int SPLIT_FACTOR = 0x8000001;", "type": "int", "var_name": "SPLIT_FACTOR" } ], "file": "src/main/java/org/apache/commons/math3/util/MathArrays.java", "identifier": "MathArrays", "interfaces": "", "superc...
{ "body": "public static double linearCombination(final double[] a, final double[] b)\n throws DimensionMismatchException {\n final int len = a.length;\n if (len != b.length) {\n throw new DimensionMismatchException(len, b.length);\n }\n\n if (len == 1) {\n // ...
[ { "covered_lines": 18, "line_coverage": 0.5143, "name": "org.apache.commons.math3.util.MathArraysTest::testLinearCombinationWithSingleElementArray", "total_lines": 35 } ]
723
Math
4
{ "fields": [ { "modifier": "", "original_string": "private final Line line;", "type": "Line", "var_name": "line" }, { "modifier": "", "original_string": "private final IntervalsSet remainingRegion;", "type": "IntervalsSet", "var_name": "remainingRegion" ...
{ "body": "public Vector3D intersection(final SubLine subLine, final boolean includeEndPoints) {\n\n // compute the intersection on infinite line\n Vector3D v1D = line.intersection(subLine.line);\n if (v1D == null) {\n return null;\n }\n\n // check location of point with ...
[ { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math3.geometry.euclidean.threed.SubLineTest::testIntersectionNotIntersecting", "total_lines": 8 }, { "covered_lines": 4, "line_coverage": 0.5, "name": "org.apache.commons.math3.geometry.euclidean.twod.SubLineTest::...
724
Math
4
{ "fields": [], "file": "src/main/java/org/apache/commons/math3/geometry/euclidean/twod/SubLine.java", "identifier": "SubLine", "interfaces": "", "superclass": "AbstractSubHyperplane<Euclidean2D, Euclidean1D>" }
{ "body": "public Vector2D intersection(final SubLine subLine, final boolean includeEndPoints) {\n\n // retrieve the underlying lines\n Line line1 = (Line) getHyperplane();\n Line line2 = (Line) subLine.getHyperplane();\n\n // compute the intersection on infinite line\n Vector2D v2D...
[ { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math3.geometry.euclidean.threed.SubLineTest::testIntersectionNotIntersecting", "total_lines": 8 }, { "covered_lines": 4, "line_coverage": 0.5, "name": "org.apache.commons.math3.geometry.euclidean.twod.SubLineTest::...
725
Math
5
{ "fields": [ { "modifier": "", "original_string": "public static final Complex I = new Complex(0.0, 1.0);", "type": "Complex", "var_name": "I" }, { "modifier": "", "original_string": "public static final Complex NaN = new Complex(Double.NaN, Double.NaN);", "type"...
{ "body": "public Complex reciprocal() {\n if (isNaN) {\n return NaN;\n }\n\n if (real == 0.0 && imaginary == 0.0) {\n return INF;\n }\n\n if (isInfinite) {\n return ZERO;\n }\n\n if (FastMath.abs(real) < FastMath.abs(imaginary)) {\n ...
[ { "covered_lines": 3, "line_coverage": 0.2308, "name": "org.apache.commons.math3.complex.ComplexTest::testReciprocalZero", "total_lines": 13 } ]
726
Math
6
{ "fields": [ { "modifier": "", "original_string": "private int lambda;", "type": "int", "var_name": "lambda" }, { "modifier": "", "original_string": "private final boolean isActiveCMA;", "type": "boolean", "var_name": "isActiveCMA" }, { "modif...
{ "body": "@Override\n protected PointValuePair doOptimize() {\n // -------------------- Initialization --------------------------------\n isMinimize = getGoalType().equals(GoalType.MINIMIZE);\n final FitnessFunction fitfun = new FitnessFunction();\n final double[] guess = getStartPoin...
[ { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math3.optim.nonlinear.scalar.gradient.NonLinearConjugateGradientOptimizerTest::testTrivial", "total_lines": 98 }, { "covered_lines": 69, "line_coverage": 0.7041, "name": "org.apache.commons.math3.optim.nonlinear.sc...
727
Math
6
{ "fields": [ { "modifier": "", "original_string": "private final boolean useLU;", "type": "boolean", "var_name": "useLU" } ], "file": "src/main/java/org/apache/commons/math3/optim/nonlinear/vector/jacobian/GaussNewtonOptimizer.java", "identifier": "GaussNewtonOptimizer", "inte...
{ "body": "@Override\n public PointVectorValuePair doOptimize() {\n checkParameters();\n\n final ConvergenceChecker<PointVectorValuePair> checker\n = getConvergenceChecker();\n\n // Computation will be useless without a checker (see \"for-loop\").\n if (checker == null) {\n ...
[ { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math3.optim.nonlinear.scalar.gradient.NonLinearConjugateGradientOptimizerTest::testTrivial", "total_lines": 53 }, { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math3.optim.nonlinear.scalar.n...
728
Math
6
{ "fields": [ { "modifier": "", "original_string": "private int solvedCols;", "type": "int", "var_name": "solvedCols" }, { "modifier": "", "original_string": "private double[] diagR;", "type": "double[]", "var_name": "diagR" }, { "modifier": ""...
{ "body": "@Override\n protected PointVectorValuePair doOptimize() {\n checkParameters();\n\n final int nR = getTarget().length; // Number of observed data.\n final double[] currentPoint = getStartPoint();\n final int nC = currentPoint.length; // Number of parameters.\n\n // arra...
[ { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math3.optim.nonlinear.scalar.gradient.NonLinearConjugateGradientOptimizerTest::testTrivial", "total_lines": 155 }, { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math3.optim.nonlinear.scalar....
729
Math
6
{ "fields": [ { "modifier": "", "original_string": "private final Formula updateFormula;", "type": "Formula", "var_name": "updateFormula" }, { "modifier": "", "original_string": "private final Preconditioner preconditioner;", "type": "Preconditioner", "var_n...
{ "body": "@Override\n protected PointValuePair doOptimize() {\n final ConvergenceChecker<PointValuePair> checker = getConvergenceChecker();\n final double[] point = getStartPoint();\n final GoalType goal = getGoalType();\n final int n = point.length;\n double[] r = computeObject...
[ { "covered_lines": 48, "line_coverage": 0.9057, "name": "org.apache.commons.math3.optim.nonlinear.scalar.gradient.NonLinearConjugateGradientOptimizerTest::testTrivial", "total_lines": 53 }, { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math3.optim.nonlinear.sc...
730
Math
6
{ "fields": [ { "modifier": "", "original_string": "private static final double MIN_RELATIVE_TOLERANCE = 2 * FastMath.ulp(1d);", "type": "double", "var_name": "MIN_RELATIVE_TOLERANCE" }, { "modifier": "", "original_string": "private final double relativeThreshold;", ...
{ "body": "@Override\n protected PointValuePair doOptimize() {\n checkParameters();\n\n final GoalType goal = getGoalType();\n final double[] guess = getStartPoint();\n final int n = guess.length;\n\n final double[][] direc = new double[n][n];\n for (int i = 0; i < n; i++)...
[ { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math3.optim.nonlinear.scalar.gradient.NonLinearConjugateGradientOptimizerTest::testTrivial", "total_lines": 64 }, { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math3.optim.nonlinear.scalar.n...
731
Math
6
{ "fields": [ { "modifier": "", "original_string": "private AbstractSimplex simplex;", "type": "AbstractSimplex", "var_name": "simplex" } ], "file": "src/main/java/org/apache/commons/math3/optim/nonlinear/scalar/noderiv/SimplexOptimizer.java", "identifier": "SimplexOptimizer", ...
{ "body": "@Override\n protected PointValuePair doOptimize() {\n checkParameters();\n\n // Indirect call to \"computeObjectiveValue\" in order to update the\n // evaluations counter.\n final MultivariateFunction evalFunc\n = new MultivariateFunction() {\n publi...
[ { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math3.optim.nonlinear.scalar.gradient.NonLinearConjugateGradientOptimizerTest::testTrivial", "total_lines": 20 }, { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math3.optim.nonlinear.scalar.n...
732
Math
7
{ "fields": [ { "modifier": "", "original_string": "protected Collection<StepHandler> stepHandlers;", "type": "Collection<StepHandler>", "var_name": "stepHandlers" }, { "modifier": "", "original_string": "protected double stepStart;", "type": "double", "var_...
{ "body": "protected double acceptStep(final AbstractStepInterpolator interpolator,\n final double[] y, final double[] yDot, final double tEnd)\n throws MaxCountExceededException, DimensionMismatchException, NoBracketingException {\n\n double previousT = interpolator.g...
[ { "covered_lines": 46, "line_coverage": 0.7797, "name": "org.apache.commons.math3.ode.nonstiff.DormandPrince853IntegratorTest::testEventsScheduling", "total_lines": 59 } ]
733
Math
8
{ "fields": [ { "modifier": "", "original_string": "protected final RandomGenerator random;", "type": "RandomGenerator", "var_name": "random" }, { "modifier": "", "original_string": "private final List<T> singletons;", "type": "List<T>", "var_name": "singlet...
{ "body": "public Object[] sample(int sampleSize) throws NotStrictlyPositiveException {\n if (sampleSize <= 0) {\n throw new NotStrictlyPositiveException(LocalizedFormats.NUMBER_OF_SAMPLES,\n sampleSize);\n }\n\n final Object[] out = new Object[sampleSize];\n\n ...
[ { "covered_lines": 4, "line_coverage": 0.5714, "name": "org.apache.commons.math3.distribution.DiscreteRealDistributionTest::testIssue942", "total_lines": 7 } ]
734
Math
9
{ "fields": [ { "modifier": "", "original_string": "private Vector3D direction;", "type": "Vector3D", "var_name": "direction" }, { "modifier": "", "original_string": "private Vector3D zero;", "type": "Vector3D", "var_name": "zero" } ], "file": "src/m...
{ "body": "public Line revert() {\n final Line reverted = new Line(this);\n reverted.direction = reverted.direction.negate();\n return reverted;\n }", "class_method_signature": "Line.revert()", "constructor": false, "full_signature": "public Line revert()", "identifier": "revert", "i...
[ { "covered_lines": 2, "line_coverage": 1, "name": "org.apache.commons.math3.geometry.euclidean.threed.LineTest::testRevert", "total_lines": 2 } ]
735
Math
10
{ "fields": [ { "modifier": "", "original_string": "private static AtomicReference<DSCompiler[][]> compilers =\n new AtomicReference<DSCompiler[][]>(null);", "type": "AtomicReference<DSCompiler[][]>", "var_name": "compilers" }, { "modifier": "", "original_str...
{ "body": "public void atan2(final double[] y, final int yOffset,\n final double[] x, final int xOffset,\n final double[] result, final int resultOffset) {\n\n // compute r = sqrt(x^2+y^2)\n double[] tmp1 = new double[getSize()];\n multiply(x, xOffset, x,...
[ { "covered_lines": 13, "line_coverage": 0.65, "name": "org.apache.commons.math3.analysis.differentiation.DerivativeStructureTest::testAtan2SpecialCases", "total_lines": 20 } ]
736
Math
11
{ "fields": [ { "modifier": "", "original_string": "private final double[] means;", "type": "double[]", "var_name": "means" }, { "modifier": "", "original_string": "private final RealMatrix covarianceMatrix;", "type": "RealMatrix", "var_name": "covarianceMat...
{ "body": "public double density(final double[] vals) throws DimensionMismatchException {\n final int dim = getDimension();\n if (vals.length != dim) {\n throw new DimensionMismatchException(vals.length, dim);\n }\n\n return FastMath.pow(2 * FastMath.PI, -0.5 * dim) *\n ...
[ { "covered_lines": 5, "line_coverage": 0.8333, "name": "org.apache.commons.math3.distribution.MultivariateNormalDistributionTest::testUnivariateDistribution", "total_lines": 6 } ]
737
Math
13
{ "fields": [ { "modifier": "@Deprecated", "original_string": "@Deprecated\n private static final double DEFAULT_SINGULARITY_THRESHOLD = 1e-14;", "type": "double", "var_name": "DEFAULT_SINGULARITY_THRESHOLD" }, { "modifier": "@Deprecated", "original_string": "@Deprec...
{ "body": "private RealMatrix squareRoot(RealMatrix m) {\n if (m instanceof DiagonalMatrix) {\n final int dim = m.getRowDimension();\n final RealMatrix sqrtM = new DiagonalMatrix(dim);\n for (int i = 0; i < dim; i++) {\n sqrtM.setEntry(i, i, FastMath.sqrt(m.getEnt...
[ { "covered_lines": 1, "line_coverage": 0.5, "name": "org.apache.commons.math3.optimization.fitting.PolynomialFitterTest::testLargeSample", "total_lines": 2 } ]
738
Math
16
{ "fields": [ { "modifier": "", "original_string": "private static final double LOG_MAX_VALUE = StrictMath.log(Double.MAX_VALUE);", "type": "double", "var_name": "LOG_MAX_VALUE" }, { "modifier": "", "original_string": "public static final double PI = 105414357.0 / 33554...
{ "body": "public static double cosh(double x) {\n if (x != x) {\n return x;\n }\n\n // cosh[z] = (exp(z) + exp(-z))/2\n\n // for numbers with magnitude 20 or so,\n // exp(-z) can be ignored in comparison with exp(z)\n\n if (x > 20) {\n if (x >= LOG_MAX_VALUE) {\n ...
[ { "covered_lines": 3, "line_coverage": 0.1, "name": "org.apache.commons.math3.util.FastMathTest::testMath905LargePositive", "total_lines": 30 }, { "covered_lines": 4, "line_coverage": 0.1333, "name": "org.apache.commons.math3.util.FastMathTest::testMath905LargeNegative", "total_l...
739
Math
17
{ "fields": [ { "modifier": "", "original_string": "public static final int RADIX = 10000;", "type": "int", "var_name": "RADIX" }, { "modifier": "", "original_string": "public static final int MIN_EXP = -32767;", "type": "int", "var_name": "MIN_EXP" }, ...
{ "body": "public Dfp multiply(final int x) {\n if (x >= 0 && x < RADIX) {\n return multiplyFast(x);\n } else {\n return multiply(newInstance(x));\n }\n }", "class_method_signature": "Dfp.multiply(final int x)", "constructor": false, "full_signature": "public Dfp mu...
[ { "covered_lines": 50, "line_coverage": 0.9091, "name": "org.apache.commons.math3.dfp.DfpTest::testMultiply", "total_lines": 55 } ]
740
Math
19
{ "fields": [ { "modifier": "", "original_string": "public static final int DEFAULT_CHECKFEASABLECOUNT = 0;", "type": "int", "var_name": "DEFAULT_CHECKFEASABLECOUNT" }, { "modifier": "", "original_string": "public static final double DEFAULT_STOPFITNESS = 0;", "ty...
{ "body": "private void checkParameters() {\n final double[] init = getStartPoint();\n final double[] lB = getLowerBound();\n final double[] uB = getUpperBound();\n\n // Checks whether there is at least one finite bound value.\n boolean hasFiniteBounds = false;\n for (int i =...
[ { "covered_lines": 19, "line_coverage": 0.5938, "name": "org.apache.commons.math3.optimization.direct.CMAESOptimizerTest::testBoundaryRangeTooLarge", "total_lines": 32 } ]
741
Math
22
{ "fields": [ { "modifier": "", "original_string": "public static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY = 1e-9;", "type": "double", "var_name": "DEFAULT_INVERSE_ABSOLUTE_ACCURACY" }, { "modifier": "", "original_string": "private static final long serialVersionU...
{ "body": "public boolean isSupportLowerBoundInclusive() {\n return false;\n }", "class_method_signature": "FDistribution.isSupportLowerBoundInclusive()", "constructor": false, "full_signature": "public boolean isSupportLowerBoundInclusive()", "identifier": "isSupportLowerBoundInclusive", "invocat...
[ { "covered_lines": 1, "line_coverage": 1, "name": "org.apache.commons.math3.distribution.FDistributionTest::testIsSupportLowerBoundInclusive", "total_lines": 1 }, { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math3.distribution.UniformRealDistributionTest::tes...
742
Math
22
{ "fields": [ { "modifier": "", "original_string": "public static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY = 1e-9;", "type": "double", "var_name": "DEFAULT_INVERSE_ABSOLUTE_ACCURACY" }, { "modifier": "", "original_string": "private static final long serialVersionU...
{ "body": "public boolean isSupportUpperBoundInclusive() {\n return true;\n }", "class_method_signature": "UniformRealDistribution.isSupportUpperBoundInclusive()", "constructor": false, "full_signature": "public boolean isSupportUpperBoundInclusive()", "identifier": "isSupportUpperBoundInclusive", ...
[ { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math3.distribution.FDistributionTest::testIsSupportLowerBoundInclusive", "total_lines": 1 }, { "covered_lines": 1, "line_coverage": 1, "name": "org.apache.commons.math3.distribution.UniformRealDistributionTest::tes...
743
Math
23
{ "fields": [ { "modifier": "", "original_string": "private static final double GOLDEN_SECTION = 0.5 * (3 - FastMath.sqrt(5));", "type": "double", "var_name": "GOLDEN_SECTION" }, { "modifier": "", "original_string": "private static final double MIN_RELATIVE_TOLERANCE = ...
{ "body": "@Override\n protected UnivariatePointValuePair doOptimize() {\n final boolean isMinim = getGoalType() == GoalType.MINIMIZE;\n final double lo = getMin();\n final double mid = getStartValue();\n final double hi = getMax();\n\n // Optional additional convergence criteria...
[ { "covered_lines": 79, "line_coverage": 0.7745, "name": "org.apache.commons.math3.optimization.univariate.BrentOptimizerTest::testKeepInitIfBest", "total_lines": 102 } ]
744
Math
24
{ "fields": [ { "modifier": "", "original_string": "private static final double GOLDEN_SECTION = 0.5 * (3 - FastMath.sqrt(5));", "type": "double", "var_name": "GOLDEN_SECTION" }, { "modifier": "", "original_string": "private static final double MIN_RELATIVE_TOLERANCE = ...
{ "body": "@Override\n protected UnivariatePointValuePair doOptimize() {\n final boolean isMinim = getGoalType() == GoalType.MINIMIZE;\n final double lo = getMin();\n final double mid = getStartValue();\n final double hi = getMax();\n\n // Optional additional convergence criteria...
[ { "covered_lines": 90, "line_coverage": 0.8911, "name": "org.apache.commons.math3.optimization.univariate.BrentOptimizerTest::testMath855", "total_lines": 101 } ]
745
Math
27
{ "fields": [ { "modifier": "", "original_string": "public static final Fraction TWO = new Fraction(2, 1);", "type": "Fraction", "var_name": "TWO" }, { "modifier": "", "original_string": "public static final Fraction ONE = new Fraction(1, 1);", "type": "Fraction",...
{ "body": "public double percentageValue() {\n return 100 * doubleValue();\n }", "class_method_signature": "Fraction.percentageValue()", "constructor": false, "full_signature": "public double percentageValue()", "identifier": "percentageValue", "invocations": [ "doubleValue" ], "modifiers"...
[ { "covered_lines": 1, "line_coverage": 1, "name": "org.apache.commons.math3.fraction.FractionTest::testMath835", "total_lines": 1 } ]
746
Math
28
{ "fields": [ { "modifier": "", "original_string": "private static final double DEFAULT_EPSILON = 1.0e-6;", "type": "double", "var_name": "DEFAULT_EPSILON" }, { "modifier": "", "original_string": "private static final int DEFAULT_ULPS = 10;", "type": "int", ...
{ "body": "private Integer getPivotRow(SimplexTableau tableau, final int col) {\n // create a list of all the rows that tie for the lowest score in the minimum ratio test\n List<Integer> minRatioPositions = new ArrayList<Integer>();\n double minRatio = Double.MAX_VALUE;\n for (int i = tabl...
[ { "covered_lines": 35, "line_coverage": 0.9722, "name": "org.apache.commons.math3.optimization.linear.SimplexSolverTest::testMath828Cycle", "total_lines": 36 } ]
747
Math
29
{ "fields": [ { "modifier": "", "original_string": "public static final double DEFAULT_ZERO_TOLERANCE = 1.0e-12;", "type": "double", "var_name": "DEFAULT_ZERO_TOLERANCE" }, { "modifier": "", "original_string": "private static final long serialVersionUID = 87722226955807...
{ "body": "@Override\n public OpenMapRealVector ebeDivide(RealVector v) {\n checkVectorDimensions(v.getDimension());\n OpenMapRealVector res = new OpenMapRealVector(this);\n /*\n * MATH-803: it is not sufficient to loop through non zero entries of\n * this only. Indeed, if this...
[ { "covered_lines": 7, "line_coverage": 1, "name": "org.apache.commons.math3.linear.SparseRealVectorTest::testEbeDivideMixedTypes", "total_lines": 7 }, { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math3.linear.SparseRealVectorTest::testEbeMultiplyMixedTypes", ...
748
Math
29
{ "fields": [ { "modifier": "", "original_string": "public static final double DEFAULT_ZERO_TOLERANCE = 1.0e-12;", "type": "double", "var_name": "DEFAULT_ZERO_TOLERANCE" }, { "modifier": "", "original_string": "private static final long serialVersionUID = 87722226955807...
{ "body": "@Override\n public OpenMapRealVector ebeMultiply(RealVector v) {\n checkVectorDimensions(v.getDimension());\n OpenMapRealVector res = new OpenMapRealVector(this);\n Iterator iter = entries.iterator();\n while (iter.hasNext()) {\n iter.advance();\n res.se...
[ { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math3.linear.SparseRealVectorTest::testEbeDivideMixedTypes", "total_lines": 7 }, { "covered_lines": 7, "line_coverage": 1, "name": "org.apache.commons.math3.linear.SparseRealVectorTest::testEbeMultiplyMixedTypes", ...
749
Math
30
{ "fields": [ { "modifier": "", "original_string": "private NaturalRanking naturalRanking;", "type": "NaturalRanking", "var_name": "naturalRanking" } ], "file": "src/main/java/org/apache/commons/math3/stat/inference/MannWhitneyUTest.java", "identifier": "MannWhitneyUTest", "int...
{ "body": "private double calculateAsymptoticPValue(final double Umin,\n final int n1,\n final int n2)\n throws ConvergenceException, MaxCountExceededException {\n\n final double n1n2prod = n1 * n2;\n\n // htt...
[ { "covered_lines": 6, "line_coverage": 1, "name": "org.apache.commons.math3.stat.inference.MannWhitneyUTestTest::testBigDataSet", "total_lines": 6 } ]
750
Math
32
{ "fields": [ { "modifier": "", "original_string": "private Vector2D[][] vertices;", "type": "Vector2D[][]", "var_name": "vertices" } ], "file": "src/main/java/org/apache/commons/math3/geometry/euclidean/twod/PolygonsSet.java", "identifier": "PolygonsSet", "interfaces": "", "...
{ "body": "@Override\n protected void computeGeometricalProperties() {\n\n final Vector2D[][] v = getVertices();\n\n if (v.length == 0) {\n final BSPTree<Euclidean2D> tree = getTree(false);\n if (tree.getCut() == null && (Boolean) tree.getAttribute()) {\n // the i...
[ { "covered_lines": 23, "line_coverage": 0.7188, "name": "org.apache.commons.math3.geometry.euclidean.threed.PolyhedronsSetTest::testIssue780", "total_lines": 32 } ]
751
Math
33
{ "fields": [ { "modifier": "", "original_string": "private static final String NEGATIVE_VAR_COLUMN_LABEL = \"x-\";", "type": "String", "var_name": "NEGATIVE_VAR_COLUMN_LABEL" }, { "modifier": "", "original_string": "private static final int DEFAULT_ULPS = 10;", "...
{ "body": "protected void dropPhase1Objective() {\n if (getNumObjectiveFunctions() == 1) {\n return;\n }\n\n List<Integer> columnsToDrop = new ArrayList<Integer>();\n columnsToDrop.add(0);\n\n // positive cost non-artificial variables\n for (int i = getNumObjective...
[ { "covered_lines": 22, "line_coverage": 0.9565, "name": "org.apache.commons.math3.optimization.linear.SimplexSolverTest::testMath781", "total_lines": 23 } ]
752
Math
34
{ "fields": [ { "modifier": "", "original_string": "private List<Chromosome> chromosomes;", "type": "List<Chromosome>", "var_name": "chromosomes" }, { "modifier": "", "original_string": "private int populationLimit;", "type": "int", "var_name": "populationLi...
{ "body": "public Iterator<Chromosome> iterator() {\n return getChromosomes().iterator();\n }", "class_method_signature": "ListPopulation.iterator()", "constructor": false, "full_signature": "public Iterator<Chromosome> iterator()", "identifier": "iterator", "invocations": [ "iterator", "g...
[ { "covered_lines": 1, "line_coverage": 1, "name": "org.apache.commons.math3.genetics.ListPopulationTest::testIterator", "total_lines": 1 } ]
753
Math
36
{ "fields": [ { "modifier": "", "original_string": "public static final BigFraction TWO = new BigFraction(2);", "type": "BigFraction", "var_name": "TWO" }, { "modifier": "", "original_string": "public static final BigFraction ONE = new BigFraction(1);", "type": "B...
{ "body": "@Override\n public double doubleValue() {\n double result = numerator.doubleValue() / denominator.doubleValue();\n if (Double.isNaN(result)) {\n // Numerator and/or denominator must be out of range:\n // Calculate how far to shift them to put them in range.\n ...
[ { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math.fraction.BigFractionTest::testFloatValueForLargeNumeratorAndDenominator", "total_lines": 2 }, { "covered_lines": 2, "line_coverage": 1, "name": "org.apache.commons.math.fraction.BigFractionTest::testDoubleValu...
754
Math
36
{ "fields": [ { "modifier": "", "original_string": "public static final BigFraction TWO = new BigFraction(2);", "type": "BigFraction", "var_name": "TWO" }, { "modifier": "", "original_string": "public static final BigFraction ONE = new BigFraction(1);", "type": "B...
{ "body": "@Override\n public float floatValue() {\n float result = numerator.floatValue() / denominator.floatValue();\n if (Double.isNaN(result)) {\n // Numerator and/or denominator must be out of range:\n // Calculate how far to shift them to put them in range.\n in...
[ { "covered_lines": 2, "line_coverage": 1, "name": "org.apache.commons.math.fraction.BigFractionTest::testFloatValueForLargeNumeratorAndDenominator", "total_lines": 2 }, { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math.fraction.BigFractionTest::testDoubleValu...
755
Math
37
{ "fields": [ { "modifier": "", "original_string": "public static final Complex I = new Complex(0.0, 1.0);", "type": "Complex", "var_name": "I" }, { "modifier": "", "original_string": "public static final Complex NaN = new Complex(Double.NaN, Double.NaN);", "type"...
{ "body": "public Complex tan() {\n if (isNaN || Double.isInfinite(real)) {\n return NaN;\n }\n if (imaginary > 20.0) {\n return createComplex(0.0, 1.0);\n }\n if (imaginary < -20.0) {\n return createComplex(0.0, -1.0);\n }\n\n double r...
[ { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math.complex.ComplexTest::testTanhInf", "total_lines": 7 }, { "covered_lines": 6, "line_coverage": 0.8571, "name": "org.apache.commons.math.complex.ComplexTest::testTan", "total_lines": 7 }, { "covered_...
756
Math
37
{ "fields": [ { "modifier": "", "original_string": "public static final Complex I = new Complex(0.0, 1.0);", "type": "Complex", "var_name": "I" }, { "modifier": "", "original_string": "public static final Complex NaN = new Complex(Double.NaN, Double.NaN);", "type"...
{ "body": "public Complex tanh() {\n if (isNaN || Double.isInfinite(imaginary)) {\n return NaN;\n }\n if (real > 20.0) {\n return createComplex(1.0, 0.0);\n }\n if (real < -20.0) {\n return createComplex(-1.0, 0.0);\n }\n double real2 =...
[ { "covered_lines": 6, "line_coverage": 0.8571, "name": "org.apache.commons.math.complex.ComplexTest::testTanhInf", "total_lines": 7 }, { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math.complex.ComplexTest::testTan", "total_lines": 7 }, { "covered_...
757
Math
38
{ "fields": [ { "modifier": "", "original_string": "public static final int MINIMUM_PROBLEM_DIMENSION = 2;", "type": "int", "var_name": "MINIMUM_PROBLEM_DIMENSION" }, { "modifier": "", "original_string": "public static final double DEFAULT_INITIAL_RADIUS = 10.0;", ...
{ "body": "private void prelim(double[] lowerBound,\n double[] upperBound) {\n printMethod(); // XXX\n\n final int n = currentBest.getDimension();\n final int npt = numberOfInterpolationPoints;\n final int ndim = bMatrix.getRowDimension();\n\n final double rho...
[ { "covered_lines": 95, "line_coverage": 0.8261, "name": "org.apache.commons.math.optimization.direct.BOBYQAOptimizerTest::testConstrainedRosenWithMoreInterpolationPoints", "total_lines": 115 } ]
758
Math
39
{ "fields": [ { "modifier": "", "original_string": "private final boolean fsal;", "type": "boolean", "var_name": "fsal" }, { "modifier": "", "original_string": "private final double[] c;", "type": "double[]", "var_name": "c" }, { "modifier": ""...
{ "body": "@Override\n public void integrate(final ExpandableStatefulODE equations, final double t)\n throws MathIllegalStateException, MathIllegalArgumentException {\n\n sanityChecks(equations, t);\n setEquations(equations);\n final boolean forward = t > equations.getTime();\n\n // create some inte...
[ { "covered_lines": 38, "line_coverage": 0.5, "name": "org.apache.commons.math.ode.nonstiff.DormandPrince853IntegratorTest::testTooLargeFirstStep", "total_lines": 76 } ]
759
Math
40
{ "fields": [ { "modifier": "", "original_string": "private static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;", "type": "double", "var_name": "DEFAULT_ABSOLUTE_ACCURACY" }, { "modifier": "", "original_string": "private static final int DEFAULT_MAXIMAL_ORDER = 5;", ...
{ "body": "@Override\n protected double doSolve() {\n\n // prepare arrays with the first points\n final double[] x = new double[maximalOrder + 1];\n final double[] y = new double[maximalOrder + 1];\n x[0] = getMin();\n x[1] = getStartValue();\n x[2] = getMax();\n ve...
[ { "covered_lines": 59, "line_coverage": 0.6413, "name": "org.apache.commons.math.analysis.solvers.BracketingNthOrderBrentSolverTest::testIssue716", "total_lines": 92 } ]
760
Math
41
{ "fields": [ { "modifier": "", "original_string": "private static final long serialVersionUID = -9111962718267217978L;", "type": "long", "var_name": "serialVersionUID" }, { "modifier": "", "original_string": "protected SecondMoment moment = null;", "type": "Secon...
{ "body": "public double evaluate(final double[] values, final double[] weights,\n final double mean, final int begin, final int length) {\n\n double var = Double.NaN;\n\n if (test(values, weights, begin, length)) {\n if (length == 1) {\n var = 0.0;\n ...
[ { "covered_lines": 9, "line_coverage": 0.9, "name": "org.apache.commons.math.stat.descriptive.moment.VarianceTest::testEvaluateArraySegmentWeighted", "total_lines": 10 } ]
761
Math
42
{ "fields": [ { "modifier": "", "original_string": "private static final String NEGATIVE_VAR_COLUMN_LABEL = \"x-\";", "type": "String", "var_name": "NEGATIVE_VAR_COLUMN_LABEL" }, { "modifier": "", "original_string": "private static final int DEFAULT_ULPS = 10;", "...
{ "body": "protected RealPointValuePair getSolution() {\n int negativeVarColumn = columnLabels.indexOf(NEGATIVE_VAR_COLUMN_LABEL);\n Integer negativeVarBasicRow = negativeVarColumn > 0 ? getBasicRow(negativeVarColumn) : null;\n double mostNegative = negativeVarBasicRow == null ? 0 : getEntry(negativeVa...
[ { "covered_lines": 15, "line_coverage": 0.8333, "name": "org.apache.commons.math.optimization.linear.SimplexSolverTest::testMath713NegativeVariable", "total_lines": 18 } ]
762
Math
43
{ "fields": [ { "modifier": "", "original_string": "private static final long serialVersionUID = -2021321786743555871L;", "type": "long", "var_name": "serialVersionUID" }, { "modifier": "", "original_string": "protected long n = 0;", "type": "long", "var_nam...
{ "body": "public void addValue(double value) {\n sumImpl.increment(value);\n sumsqImpl.increment(value);\n minImpl.increment(value);\n maxImpl.increment(value);\n sumLogImpl.increment(value);\n secondMoment.increment(value);\n // If mean, variance or geomean have been...
[ { "covered_lines": 11, "line_coverage": 0.7857, "name": "org.apache.commons.math.stat.descriptive.SummaryStatisticsTest::testOverrideMeanWithMathClass", "total_lines": 14 }, { "covered_lines": 11, "line_coverage": 0.7857, "name": "org.apache.commons.math.stat.descriptive.SummaryStati...
763
Math
44
{ "fields": [ { "modifier": "", "original_string": "protected Collection<StepHandler> stepHandlers;", "type": "Collection<StepHandler>", "var_name": "stepHandlers" }, { "modifier": "", "original_string": "protected double stepStart;", "type": "double", "var_...
{ "body": "protected double acceptStep(final AbstractStepInterpolator interpolator,\n final double[] y, final double[] yDot, final double tEnd)\n throws MathIllegalStateException {\n\n double previousT = interpolator.getGlobalPreviousTime();\n final double c...
[ { "covered_lines": 41, "line_coverage": 0.7736, "name": "org.apache.commons.math.ode.events.EventStateTest::testIssue695", "total_lines": 53 } ]
764
Math
46
{ "fields": [ { "modifier": "", "original_string": "public static final Complex I = new Complex(0.0, 1.0);", "type": "Complex", "var_name": "I" }, { "modifier": "", "original_string": "public static final Complex NaN = new Complex(Double.NaN, Double.NaN);", "type"...
{ "body": "public Complex divide(Complex divisor)\n throws NullArgumentException {\n MathUtils.checkNotNull(divisor);\n if (isNaN || divisor.isNaN) {\n return NaN;\n }\n\n if (divisor.isZero) {\n // return isZero ? NaN : INF; // See MATH-657\n return...
[ { "covered_lines": 11, "line_coverage": 0.6875, "name": "org.apache.commons.math.complex.ComplexTest::testAtanI", "total_lines": 16 }, { "covered_lines": 4, "line_coverage": 0.25, "name": "org.apache.commons.math.complex.ComplexTest::testDivideZero", "total_lines": 16 } ]
765
Math
46
{ "fields": [ { "modifier": "", "original_string": "public static final Complex I = new Complex(0.0, 1.0);", "type": "Complex", "var_name": "I" }, { "modifier": "", "original_string": "public static final Complex NaN = new Complex(Double.NaN, Double.NaN);", "type"...
{ "body": "public Complex divide(double divisor) {\n if (isNaN || Double.isNaN(divisor)) {\n return NaN;\n }\n if (divisor == 0d) {\n // return isZero ? NaN : INF; // See MATH-657\n return NaN;\n }\n if (Double.isInfinite(divisor)) {\n ret...
[ { "covered_lines": 11, "line_coverage": 0.6875, "name": "org.apache.commons.math.complex.ComplexTest::testAtanI", "total_lines": 16 }, { "covered_lines": 4, "line_coverage": 0.25, "name": "org.apache.commons.math.complex.ComplexTest::testDivideZero", "total_lines": 16 } ]
766
Math
47
{ "fields": [ { "modifier": "", "original_string": "public static final Complex I = new Complex(0.0, 1.0);", "type": "Complex", "var_name": "I" }, { "modifier": "", "original_string": "public static final Complex NaN = new Complex(Double.NaN, Double.NaN);", "type"...
{ "body": "public Complex divide(Complex divisor)\n throws NullArgumentException {\n MathUtils.checkNotNull(divisor);\n if (isNaN || divisor.isNaN) {\n return NaN;\n }\n\n if (divisor.isZero) {\n return isZero ? NaN : INF;\n }\n\n if (divisor.isIn...
[ { "covered_lines": 14, "line_coverage": 0.875, "name": "org.apache.commons.math.complex.ComplexTest::testAtanI", "total_lines": 16 }, { "covered_lines": 4, "line_coverage": 0.25, "name": "org.apache.commons.math.complex.ComplexTest::testDivideZero", "total_lines": 16 } ]
767
Math
47
{ "fields": [ { "modifier": "", "original_string": "public static final Complex I = new Complex(0.0, 1.0);", "type": "Complex", "var_name": "I" }, { "modifier": "", "original_string": "public static final Complex NaN = new Complex(Double.NaN, Double.NaN);", "type"...
{ "body": "public Complex divide(double divisor) {\n if (isNaN || Double.isNaN(divisor)) {\n return NaN;\n }\n if (divisor == 0d) {\n return isZero ? NaN : INF;\n }\n if (Double.isInfinite(divisor)) {\n return !isInfinite() ? ZERO : NaN;\n }\n...
[ { "covered_lines": 14, "line_coverage": 0.875, "name": "org.apache.commons.math.complex.ComplexTest::testAtanI", "total_lines": 16 }, { "covered_lines": 4, "line_coverage": 0.25, "name": "org.apache.commons.math.complex.ComplexTest::testDivideZero", "total_lines": 16 } ]
768
Math
48
{ "fields": [ { "modifier": "", "original_string": "protected static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;", "type": "double", "var_name": "DEFAULT_ABSOLUTE_ACCURACY" }, { "modifier": "", "original_string": "private AllowedSolution allowed;", "type": "All...
{ "body": "protected final double doSolve() {\n // Get initial solution\n double x0 = getMin();\n double x1 = getMax();\n double f0 = computeObjectiveValue(x0);\n double f1 = computeObjectiveValue(x1);\n\n // If one of the bounds is the exact root, return it. Since these are\...
[ { "covered_lines": 25, "line_coverage": 0.4902, "name": "org.apache.commons.math.analysis.solvers.RegulaFalsiSolverTest::testIssue631", "total_lines": 51 } ]
769
Math
50
{ "fields": [ { "modifier": "", "original_string": "protected static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;", "type": "double", "var_name": "DEFAULT_ABSOLUTE_ACCURACY" }, { "modifier": "", "original_string": "private AllowedSolution allowed;", "type": "All...
{ "body": "protected final double doSolve() {\n // Get initial solution\n double x0 = getMin();\n double x1 = getMax();\n double f0 = computeObjectiveValue(x0);\n double f1 = computeObjectiveValue(x1);\n\n // If one of the bounds is the exact root, return it. Since these are\...
[ { "covered_lines": 29, "line_coverage": 0.5472, "name": "org.apache.commons.math.analysis.solvers.RegulaFalsiSolverTest::testIssue631", "total_lines": 53 } ]
770
Math
51
{ "fields": [ { "modifier": "", "original_string": "protected static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6;", "type": "double", "var_name": "DEFAULT_ABSOLUTE_ACCURACY" }, { "modifier": "", "original_string": "private AllowedSolution allowed;", "type": "All...
{ "body": "protected final double doSolve() {\n // Get initial solution\n double x0 = getMin();\n double x1 = getMax();\n double f0 = computeObjectiveValue(x0);\n double f1 = computeObjectiveValue(x1);\n\n // If one of the bounds is the exact root, return it. Since these are\...
[ { "covered_lines": 24, "line_coverage": 0.4898, "name": "org.apache.commons.math.analysis.solvers.RegulaFalsiSolverTest::testIssue631", "total_lines": 49 } ]
771
Math
53
{ "fields": [ { "modifier": "", "original_string": "public static final Complex I = new Complex(0.0, 1.0);", "type": "Complex", "var_name": "I" }, { "modifier": "", "original_string": "public static final Complex NaN = new Complex(Double.NaN, Double.NaN);", "type"...
{ "body": "public Complex add(Complex rhs)\n throws NullArgumentException {\n MathUtils.checkNotNull(rhs);\n if (isNaN || rhs.isNaN) {\n return NaN;\n }\n return createComplex(real + rhs.getReal(),\n imaginary + rhs.getImaginary());\n }", "class_method_sig...
[ { "covered_lines": 3, "line_coverage": 1, "name": "org.apache.commons.math.complex.ComplexTest::testAddNaN", "total_lines": 3 } ]
772
Math
54
{ "fields": [ { "modifier": "", "original_string": "public static final int RADIX = 10000;", "type": "int", "var_name": "RADIX" }, { "modifier": "", "original_string": "public static final int MIN_EXP = -32767;", "type": "int", "var_name": "MIN_EXP" }, ...
{ "body": "public double toDouble() {\n\n if (isInfinite()) {\n if (lessThan(getZero())) {\n return Double.NEGATIVE_INFINITY;\n } else {\n return Double.POSITIVE_INFINITY;\n }\n }\n\n if (isNaN()) {\n return Double.NaN;\n ...
[ { "covered_lines": 27, "line_coverage": 0.6279, "name": "org.apache.commons.math.dfp.DfpTest::testIssue567", "total_lines": 43 } ]
773
Math
55
{ "fields": [ { "modifier": "", "original_string": "public static final Vector3D ZERO = new Vector3D(0, 0, 0);", "type": "Vector3D", "var_name": "ZERO" }, { "modifier": "", "original_string": "public static final Vector3D PLUS_I = new Vector3D(1, 0, 0);", "type"...
{ "body": "public static Vector3D crossProduct(final Vector3D v1, final Vector3D v2) {\n\n final double n1 = v1.getNormSq();\n final double n2 = v2.getNormSq();\n if ((n1 * n2) < MathUtils.SAFE_MIN) {\n return ZERO;\n }\n\n // rescale both vectors without losing precision,\n // ...
[ { "covered_lines": 1, "line_coverage": 1, "name": "org.apache.commons.math.geometry.Vector3DTest::testCrossProductCancellation", "total_lines": 1 } ]
774
Math
56
{ "fields": [ { "modifier": "", "original_string": "private final int dimension;", "type": "int", "var_name": "dimension" }, { "modifier": "", "original_string": "private final int[] uniCounterOffset;", "type": "int[]", "var_name": "uniCounterOffset" }, ...
{ "body": "public int[] getCounts(int index) {\n if (index < 0 ||\n index >= totalSize) {\n throw new OutOfRangeException(index, 0, totalSize);\n }\n\n final int[] indices = new int[dimension];\n\n int count = 0;\n for (int i = 0; i < last; i++) {\n ...
[ { "covered_lines": 19, "line_coverage": 0.95, "name": "org.apache.commons.math.util.MultidimensionalCounterTest::testIterationConsistency", "total_lines": 20 } ]
775
Math
57
{ "fields": [ { "modifier": "", "original_string": "private final Random random;", "type": "Random", "var_name": "random" }, { "modifier": "", "original_string": "private final EmptyClusterStrategy emptyStrategy;", "type": "EmptyClusterStrategy", "var_name":...
{ "body": "private static <T extends Clusterable<T>> List<Cluster<T>>\n chooseInitialCenters(final Collection<T> points, final int k, final Random random) {\n\n final List<T> pointSet = new ArrayList<T>(points);\n final List<Cluster<T>> resultSet = new ArrayList<Cluster<T>>();\n\n // Choos...
[ { "covered_lines": 21, "line_coverage": 1, "name": "org.apache.commons.math.stat.clustering.KMeansPlusPlusClustererTest::testSmallDistances", "total_lines": 21 } ]
776
Math
60
{ "fields": [ { "modifier": "", "original_string": "public static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY = 1e-9;", "type": "double", "var_name": "DEFAULT_INVERSE_ABSOLUTE_ACCURACY" }, { "modifier": "", "original_string": "private static final long serialVersionU...
{ "body": "public double cumulativeProbability(double x) throws MathException {\n final double dev = x - mean;\n if (FastMath.abs(dev) > 40 * standardDeviation) { \n return dev < 0 ? 0.0d : 1.0d;\n }\n return 0.5 * (1.0 + Erf.erf((dev) /\n (standardDeviation *...
[ { "covered_lines": 3, "line_coverage": 0.3333, "name": "org.apache.commons.math.distribution.NormalDistributionTest::testExtremeValues", "total_lines": 9 } ]
777
Math
62
{ "fields": [ { "modifier": "", "original_string": "private final BaseUnivariateRealOptimizer<FUNC> optimizer;", "type": "BaseUnivariateRealOptimizer<FUNC>", "var_name": "optimizer" }, { "modifier": "", "original_string": "private int maxEvaluations;", "type": "in...
{ "body": "public UnivariateRealPointValuePair optimize(final FUNC f,\n final GoalType goal,\n final double min, final double max)\n throws FunctionEvaluationException {\n return optimize(f, goal, min, max, m...
[ { "covered_lines": 13, "line_coverage": 0.6842, "name": "org.apache.commons.math.optimization.univariate.MultiStartUnivariateRealOptimizerTest::testQuinticMin", "total_lines": 19 } ]
778
Math
62
{ "fields": [ { "modifier": "", "original_string": "private final BaseUnivariateRealOptimizer<FUNC> optimizer;", "type": "BaseUnivariateRealOptimizer<FUNC>", "var_name": "optimizer" }, { "modifier": "", "original_string": "private int maxEvaluations;", "type": "in...
{ "body": "public UnivariateRealPointValuePair optimize(final FUNC f, final GoalType goal,\n final double min, final double max,\n final double startValue)\n throws FunctionEvaluationException {\n optima = ne...
[ { "covered_lines": 13, "line_coverage": 0.6842, "name": "org.apache.commons.math.optimization.univariate.MultiStartUnivariateRealOptimizerTest::testQuinticMin", "total_lines": 19 } ]
779
Math
63
{ "fields": [ { "modifier": "", "original_string": "public static final double EPSILON = 0x1.0p-53;", "type": "double", "var_name": "EPSILON" }, { "modifier": "", "original_string": "public static final double SAFE_MIN = 0x1.0p-1022;", "type": "double", "var...
{ "body": "public static boolean equals(double x, double y) {\n return equals(x, y, 1);\n }", "class_method_signature": "MathUtils.equals(double x, double y)", "constructor": false, "full_signature": "public static boolean equals(double x, double y)", "identifier": "equals", "invocations": [ "...
[ { "covered_lines": 7, "line_coverage": 0.875, "name": "org.apache.commons.math.util.MathUtilsTest::testArrayEquals", "total_lines": 8 } ]
780
Math
64
{ "fields": [ { "modifier": "", "original_string": "private int solvedCols;", "type": "int", "var_name": "solvedCols" }, { "modifier": "", "original_string": "private double[] diagR;", "type": "double[]", "var_name": "diagR" }, { "modifier": ""...
{ "body": "@Override\n protected VectorialPointValuePair doOptimize()\n throws FunctionEvaluationException, OptimizationException, IllegalArgumentException {\n\n // arrays shared with the other private methods\n solvedCols = Math.min(rows, cols);\n diagR = new double[cols];\n ...
[ { "covered_lines": 120, "line_coverage": 0.9231, "name": "org.apache.commons.math.optimization.general.MinpackTest::testMinpackJennrichSampson", "total_lines": 130 }, { "covered_lines": 120, "line_coverage": 0.9231, "name": "org.apache.commons.math.optimization.general.MinpackTest::t...
781
Math
65
{ "fields": [ { "modifier": "", "original_string": "public static final int DEFAULT_MAX_ITERATIONS = 100;", "type": "int", "var_name": "DEFAULT_MAX_ITERATIONS" }, { "modifier": "", "original_string": "protected VectorialConvergenceChecker checker;", "type": "Vecto...
{ "body": "public double getChiSquare() {\n double chiSquare = 0;\n for (int i = 0; i < rows; ++i) {\n final double residual = residuals[i];\n chiSquare += residual * residual * residualsWeights[i];\n }\n return chiSquare;\n }", "class_method_signature": "Abstrac...
[ { "covered_lines": 5, "line_coverage": 1, "name": "org.apache.commons.math.optimization.general.LevenbergMarquardtOptimizerTest::testCircleFitting", "total_lines": 5 } ]
782
Math
65
{ "fields": [ { "modifier": "", "original_string": "public static final int DEFAULT_MAX_ITERATIONS = 100;", "type": "int", "var_name": "DEFAULT_MAX_ITERATIONS" }, { "modifier": "", "original_string": "protected VectorialConvergenceChecker checker;", "type": "Vecto...
{ "body": "public double getRMS() {\n return Math.sqrt(getChiSquare() / rows);\n }", "class_method_signature": "AbstractLeastSquaresOptimizer.getRMS()", "constructor": false, "full_signature": "public double getRMS()", "identifier": "getRMS", "invocations": [ "sqrt", "getChiSquare" ], ...
[ { "covered_lines": 5, "line_coverage": 1, "name": "org.apache.commons.math.optimization.general.LevenbergMarquardtOptimizerTest::testCircleFitting", "total_lines": 5 } ]
783
Math
66
{ "fields": [ { "modifier": "", "original_string": "private static final double GOLDEN_SECTION = 0.5 * (3 - Math.sqrt(5));", "type": "double", "var_name": "GOLDEN_SECTION" } ], "file": "src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java", "identifie...
{ "body": "private double localMin(boolean isMinim,\n double lo, double mid, double hi,\n double eps, double t)\n throws MaxIterationsExceededException, FunctionEvaluationException {\n if (eps <= 0) {\n throw new NotStrictlyPositiveExcepti...
[ { "covered_lines": 82, "line_coverage": 0.9111, "name": "org.apache.commons.math.optimization.MultiStartUnivariateRealOptimizerTest::testQuinticMin", "total_lines": 90 }, { "covered_lines": 81, "line_coverage": 0.9, "name": "org.apache.commons.math.optimization.MultiStartUnivariateRe...
784
Math
67
{ "fields": [ { "modifier": "", "original_string": "private static final long serialVersionUID = 5983375963110961019L;", "type": "long", "var_name": "serialVersionUID" }, { "modifier": "", "original_string": "private final UnivariateRealOptimizer optimizer;", "typ...
{ "body": "public double getResult() {\n return optima[0];\n }", "class_method_signature": "MultiStartUnivariateRealOptimizer.getResult()", "constructor": false, "full_signature": "public double getResult()", "identifier": "getResult", "invocations": [], "modifiers": "", "parameters": "()", ...
[ { "covered_lines": 1, "line_coverage": 1, "name": "org.apache.commons.math.optimization.MultiStartUnivariateRealOptimizerTest::testQuinticMin", "total_lines": 1 } ]
785
Math
68
{ "fields": [ { "modifier": "", "original_string": "private int solvedCols;", "type": "int", "var_name": "solvedCols" }, { "modifier": "", "original_string": "private double[] diagR;", "type": "double[]", "var_name": "diagR" }, { "modifier": ""...
{ "body": "@Override\n protected VectorialPointValuePair doOptimize()\n throws FunctionEvaluationException, OptimizationException, IllegalArgumentException {\n\n // arrays shared with the other private methods\n solvedCols = Math.min(rows, cols);\n diagR = new double[cols];\n ...
[ { "covered_lines": 116, "line_coverage": 0.9355, "name": "org.apache.commons.math.optimization.general.MinpackTest::testMinpackJennrichSampson", "total_lines": 124 }, { "covered_lines": 116, "line_coverage": 0.9355, "name": "org.apache.commons.math.optimization.general.MinpackTest::t...
786
Math
69
{ "fields": [ { "modifier": "", "original_string": "private final RealMatrix correlationMatrix;", "type": "RealMatrix", "var_name": "correlationMatrix" }, { "modifier": "", "original_string": "private final int nObs;", "type": "int", "var_name": "nObs" }...
{ "body": "public RealMatrix getCorrelationPValues() throws MathException {\n TDistribution tDistribution = new TDistributionImpl(nObs - 2);\n int nVars = correlationMatrix.getColumnDimension();\n double[][] out = new double[nVars][nVars];\n for (int i = 0; i < nVars; i++) {\n f...
[ { "covered_lines": 11, "line_coverage": 1, "name": "org.apache.commons.math.stat.correlation.PearsonsCorrelationTest::testPValueNearZero", "total_lines": 11 }, { "covered_lines": 11, "line_coverage": 1, "name": "org.apache.commons.math.stat.correlation.SpearmansRankCorrelationTest::t...
787
Math
70
{ "fields": [], "file": "src/main/java/org/apache/commons/math/analysis/solvers/BisectionSolver.java", "identifier": "BisectionSolver", "interfaces": "", "superclass": "UnivariateRealSolverImpl" }
{ "body": "public double solve(final UnivariateRealFunction f, double min, double max, double initial)\n throws MaxIterationsExceededException, FunctionEvaluationException {\n return solve(f, min, max);\n }", "class_method_signature": "BisectionSolver.solve(final UnivariateRealFunction f, double mi...
[ { "covered_lines": 1, "line_coverage": 1, "name": "org.apache.commons.math.analysis.solvers.BisectionSolverTest::testMath369", "total_lines": 1 } ]
788
Math
71
{ "fields": [ { "modifier": "", "original_string": "private final boolean fsal;", "type": "boolean", "var_name": "fsal" }, { "modifier": "", "original_string": "private final double[] c;", "type": "double[]", "var_name": "c" }, { "modifier": ""...
{ "body": "@Override\n public double integrate(final FirstOrderDifferentialEquations equations,\n final double t0, final double[] y0,\n final double t, final double[] y)\n throws DerivativeException, IntegratorException {\n\n sanityChecks(equations, t0, y0, t, y)...
[ { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math.ode.nonstiff.ClassicalRungeKuttaIntegratorTest::testMissedEndEvent", "total_lines": 93 }, { "covered_lines": 77, "line_coverage": 0.828, "name": "org.apache.commons.math.ode.nonstiff.DormandPrince853Integrator...
789
Math
71
{ "fields": [ { "modifier": "", "original_string": "private final double[] c;", "type": "double[]", "var_name": "c" }, { "modifier": "", "original_string": "private final double[][] a;", "type": "double[][]", "var_name": "a" }, { "modifier": ""...
{ "body": "public double integrate(final FirstOrderDifferentialEquations equations,\n final double t0, final double[] y0,\n final double t, final double[] y)\n throws DerivativeException, IntegratorException {\n\n sanityChecks(equations, t0, y0, t, y);\n setEqu...
[ { "covered_lines": 57, "line_coverage": 0.8636, "name": "org.apache.commons.math.ode.nonstiff.ClassicalRungeKuttaIntegratorTest::testMissedEndEvent", "total_lines": 66 }, { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math.ode.nonstiff.DormandPrince853Integrato...
790
Math
72
{ "fields": [ { "modifier": "", "original_string": "private static final String NON_BRACKETING_MESSAGE =\n \"function values at endpoints do not have different signs. \" +\n \"Endpoints: [{0}, {1}], Values: [{2}, {3}]\";", "type": "String", "var_name": "NON_BRACKETING_MESSAG...
{ "body": "public double solve(final UnivariateRealFunction f,\n final double min, final double max, final double initial)\n throws MaxIterationsExceededException, FunctionEvaluationException {\n\n clearResult();\n verifySequence(min, initial, max);\n\n // return the...
[ { "covered_lines": 14, "line_coverage": 0.2414, "name": "org.apache.commons.math.analysis.solvers.BrentSolverTest::testRootEndpoints", "total_lines": 58 } ]
791
Math
73
{ "fields": [ { "modifier": "", "original_string": "private static final String NON_BRACKETING_MESSAGE =\n \"function values at endpoints do not have different signs. \" +\n \"Endpoints: [{0}, {1}], Values: [{2}, {3}]\";", "type": "String", "var_name": "NON_BRACKETING_MESSAG...
{ "body": "public double solve(final UnivariateRealFunction f,\n final double min, final double max, final double initial)\n throws MaxIterationsExceededException, FunctionEvaluationException {\n\n clearResult();\n verifySequence(min, initial, max);\n\n // return the...
[ { "covered_lines": 43, "line_coverage": 0.7414, "name": "org.apache.commons.math.analysis.solvers.BrentSolverTest::testBadEndpoints", "total_lines": 58 } ]
792
Math
74
{ "fields": [ { "modifier": "", "original_string": "private final boolean fsal;", "type": "boolean", "var_name": "fsal" }, { "modifier": "", "original_string": "private final double[] c;", "type": "double[]", "var_name": "c" }, { "modifier": ""...
{ "body": "@Override\n public double integrate(final FirstOrderDifferentialEquations equations,\n final double t0, final double[] y0,\n final double t, final double[] y)\n throws DerivativeException, IntegratorException {\n\n sanityChecks(equations, t0, y0, t, y)...
[ { "covered_lines": 60, "line_coverage": 0.6593, "name": "org.apache.commons.math.ode.nonstiff.AdamsMoultonIntegratorTest::polynomial", "total_lines": 91 } ]
793
Math
75
{ "fields": [ { "modifier": "", "original_string": "private static final long serialVersionUID = -3845586908418844111L;", "type": "long", "var_name": "serialVersionUID" }, { "modifier": "", "original_string": "private final TreeMap<Comparable<?>, Long> freqTable;", ...
{ "body": "@Deprecated\n public double getPct(Object v) {\n return getPct((Comparable<?>) v);\n }", "class_method_signature": "Frequency.getPct(Object v)", "constructor": false, "full_signature": "@Deprecated\n public double getPct(Object v)", "identifier": "getPct", "invocations": [ "ge...
[ { "covered_lines": 1, "line_coverage": 1, "name": "org.apache.commons.math.stat.FrequencyTest::testPcts", "total_lines": 1 } ]
794
Math
76
{ "fields": [ { "modifier": "", "original_string": "private int m;", "type": "int", "var_name": "m" }, { "modifier": "", "original_string": "private int n;", "type": "int", "var_name": "n" }, { "modifier": "", "original_string": "private ...
{ "body": "public RealMatrix getU()\n throws InvalidMatrixException {\n\n if (cachedU == null) {\n\n final int p = singularValues.length;\n if (m >= n) {\n // the tridiagonal matrix is Bt.B, where B is upper bidiagonal\n final RealMatrix e =\n ...
[ { "covered_lines": 24, "line_coverage": 0.8889, "name": "org.apache.commons.math.linear.SingularValueSolverTest::testMath320A", "total_lines": 27 }, { "covered_lines": 17, "line_coverage": 0.6296, "name": "org.apache.commons.math.linear.SingularValueSolverTest::testMath320B", "to...
795
Math
76
{ "fields": [ { "modifier": "", "original_string": "private int m;", "type": "int", "var_name": "m" }, { "modifier": "", "original_string": "private int n;", "type": "int", "var_name": "n" }, { "modifier": "", "original_string": "private ...
{ "body": "public RealMatrix getV()\n throws InvalidMatrixException {\n\n if (cachedV == null) {\n\n final int p = singularValues.length;\n if (m >= n) {\n // the tridiagonal matrix is Bt.B, where B is upper bidiagonal\n final RealMatrix e =\n ...
[ { "covered_lines": 8, "line_coverage": 0.2963, "name": "org.apache.commons.math.linear.SingularValueSolverTest::testMath320A", "total_lines": 27 }, { "covered_lines": 8, "line_coverage": 0.2963, "name": "org.apache.commons.math.linear.SingularValueSolverTest::testMath320B", "tota...
796
Math
77
{ "fields": [ { "modifier": "", "original_string": "private static final String NON_FITTING_POSITION_AND_SIZE_MESSAGE =\n \"position {0} and size {1} don't fit to the size of the input array {2}\";", "type": "String", "var_name": "NON_FITTING_POSITION_AND_SIZE_MESSAGE" }, { ...
{ "body": "@Override\n public double getLInfNorm() {\n double max = 0;\n for (double a : data) {\n max = Math.max(max, Math.abs(a));\n }\n return max;\n }", "class_method_signature": "ArrayRealVector.getLInfNorm()", "constructor": false, "full_signature": "@Override\...
[ { "covered_lines": 4, "line_coverage": 1, "name": "org.apache.commons.math.linear.ArrayRealVectorTest::testBasicFunctions", "total_lines": 4 }, { "covered_lines": 0, "line_coverage": 0, "name": "org.apache.commons.math.linear.SparseRealVectorTest::testBasicFunctions", "total_line...
797
Math
78
{ "fields": [ { "modifier": "", "original_string": "private final EventHandler handler;", "type": "EventHandler", "var_name": "handler" }, { "modifier": "", "original_string": "private final double maxCheckInterval;", "type": "double", "var_name": "maxCheckI...
{ "body": "public boolean evaluateStep(final StepInterpolator interpolator)\n throws DerivativeException, EventException, ConvergenceException {\n\n try {\n\n forward = interpolator.isForward();\n final double t1 = interpolator.getCurrentTime();\n final int n = Math....
[ { "covered_lines": 24, "line_coverage": 0.5714, "name": "org.apache.commons.math.ode.events.EventStateTest::closeEvents", "total_lines": 42 } ]
798
Math
79
{ "fields": [ { "modifier": "", "original_string": "public static final double EPSILON = 0x1.0p-53;", "type": "double", "var_name": "EPSILON" }, { "modifier": "", "original_string": "public static final double SAFE_MIN = 0x1.0p-1022;", "type": "double", "var...
{ "body": "public static double distance(int[] p1, int[] p2) {\n double sum = 0;\n for (int i = 0; i < p1.length; i++) {\n final double dp = p1[i] - p2[i];\n sum += dp * dp;\n }\n return Math.sqrt(sum);\n }", "class_method_signature": "MathUtils.distance(int[] p1, int[] p2)"...
[ { "covered_lines": 5, "line_coverage": 1, "name": "org.apache.commons.math.stat.clustering.KMeansPlusPlusClustererTest::testPerformClusterAnalysisDegenerate", "total_lines": 5 } ]
799
Math
80
{ "fields": [ { "modifier": "", "original_string": "private static final double TOLERANCE = 100 * MathUtils.EPSILON;", "type": "double", "var_name": "TOLERANCE" }, { "modifier": "", "original_string": "private static final double TOLERANCE_2 = TOLERANCE * TOLERANCE;", ...
{ "body": "private boolean flipIfWarranted(final int n, final int step) {\n if (1.5 * work[pingPong] < work[4 * (n - 1) + pingPong]) {\n // flip array\n int j = 4 * (n - 1);\n for (int i = 0; i < j; i += 4) {\n for (int k = 0; k < 4; k += step) {\n ...
[ { "covered_lines": 10, "line_coverage": 1, "name": "org.apache.commons.math.linear.EigenDecompositionImplTest::testMathpbx02", "total_lines": 10 } ]
800
Math
81
{ "fields": [ { "modifier": "", "original_string": "private static final double TOLERANCE = 100 * MathUtils.EPSILON;", "type": "double", "var_name": "TOLERANCE" }, { "modifier": "", "original_string": "private static final double TOLERANCE_2 = TOLERANCE * TOLERANCE;", ...
{ "body": "private void computeGershgorinCircles() {\n\n final int m = main.length;\n final int lowerStart = 4 * m;\n final int upperStart = 5 * m;\n lowerSpectra = Double.POSITIVE_INFINITY;\n upperSpectra = Double.NEGATIVE_INFINITY;\n double eMax = 0;\n\n double e...
[ { "covered_lines": 27, "line_coverage": 1, "name": "org.apache.commons.math.linear.EigenDecompositionImplTest::testMath308", "total_lines": 27 } ]